diff --git a/inc/ch32v003hw.h b/inc/ch32v003hw.h deleted file mode 100644 index 24fb26c..0000000 --- a/inc/ch32v003hw.h +++ /dev/null @@ -1,4700 +0,0 @@ -#ifndef TODO_HARDWARE_H -#define TODO_HARDWARE_H - -#include "ch32fun.h" - -#ifndef __ASSEMBLER__ // Things before this can be used in assembly. - -#ifdef __cplusplus -extern "C" -{ -#endif - - /* Interrupt Number Definition, according to the selected device */ - typedef enum IRQn - { - /****** RISC-V Processor Exceptions Numbers *******************************************************/ - NonMaskableInt_IRQn = 2, /* 2 Non Maskable Interrupt */ - EXC_IRQn = 3, /* 3 Exception Interrupt */ - SysTicK_IRQn = 12, /* 12 System timer Interrupt */ - Software_IRQn = 14, /* 14 software Interrupt */ - - /****** RISC-V specific Interrupt Numbers *********************************************************/ - WWDG_IRQn = 16, /* Window WatchDog Interrupt */ - PVD_IRQn = 17, /* PVD through EXTI Line detection Interrupt */ - FLASH_IRQn = 18, /* FLASH global Interrupt */ - RCC_IRQn = 19, /* RCC global Interrupt */ - EXTI7_0_IRQn = 20, /* External Line[7:0] Interrupts */ - AWU_IRQn = 21, /* AWU global Interrupt */ - DMA1_Channel1_IRQn = 22, /* DMA1 Channel 1 global Interrupt */ - DMA1_Channel2_IRQn = 23, /* DMA1 Channel 2 global Interrupt */ - DMA1_Channel3_IRQn = 24, /* DMA1 Channel 3 global Interrupt */ - DMA1_Channel4_IRQn = 25, /* DMA1 Channel 4 global Interrupt */ - DMA1_Channel5_IRQn = 26, /* DMA1 Channel 5 global Interrupt */ - DMA1_Channel6_IRQn = 27, /* DMA1 Channel 6 global Interrupt */ - DMA1_Channel7_IRQn = 28, /* DMA1 Channel 7 global Interrupt */ - ADC_IRQn = 29, /* ADC global Interrupt */ - I2C1_EV_IRQn = 30, /* I2C1 Event Interrupt */ - I2C1_ER_IRQn = 31, /* I2C1 Error Interrupt */ - USART1_IRQn = 32, /* USART1 global Interrupt */ - SPI1_IRQn = 33, /* SPI1 global Interrupt */ - TIM1_BRK_IRQn = 34, /* TIM1 Break Interrupt */ - TIM1_UP_IRQn = 35, /* TIM1 Update Interrupt */ - TIM1_TRG_COM_IRQn = 36, /* TIM1 Trigger and Commutation Interrupt */ - TIM1_CC_IRQn = 37, /* TIM1 Capture Compare Interrupt */ - TIM2_IRQn = 38, /* TIM2 global Interrupt */ - } IRQn_Type; - -#define DEFAULT_INTERRUPT_VECTOR_CONTENTS "\n\ - .align 2\n\ - .option push;\n\ - .option norvc;\n\ - j handle_reset\n\ - .word 0\n\ - .word NMI_Handler /* NMI Handler */ \n\ - .word HardFault_Handler /* Hard Fault Handler */ \n\ - .word 0\n\ - .word 0\n\ - .word 0\n\ - .word 0\n\ - .word 0\n\ - .word 0\n\ - .word 0\n\ - .word 0\n\ - .word SysTick_Handler /* SysTick Handler */ \n\ - .word 0\n\ - .word SW_Handler /* SW Handler */ \n\ - .word 0\n\ - .word WWDG_IRQHandler /* Window Watchdog */ \n\ - .word PVD_IRQHandler /* PVD through EXTI Line detect */ \n\ - .word FLASH_IRQHandler /* Flash */ \n\ - .word RCC_IRQHandler /* RCC */ \n\ - .word EXTI7_0_IRQHandler /* EXTI Line 7..0 */ \n\ - .word AWU_IRQHandler /* AWU */ \n\ - .word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */ \n\ - .word DMA1_Channel2_IRQHandler /* DMA1 Channel 2 */ \n\ - .word DMA1_Channel3_IRQHandler /* DMA1 Channel 3 */ \n\ - .word DMA1_Channel4_IRQHandler /* DMA1 Channel 4 */ \n\ - .word DMA1_Channel5_IRQHandler /* DMA1 Channel 5 */ \n\ - .word DMA1_Channel6_IRQHandler /* DMA1 Channel 6 */ \n\ - .word DMA1_Channel7_IRQHandler /* DMA1 Channel 7 */ \n\ - .word ADC1_IRQHandler /* ADC1 */ \n\ - .word I2C1_EV_IRQHandler /* I2C1 Event */ \n\ - .word I2C1_ER_IRQHandler /* I2C1 Error */ \n\ - .word USART1_IRQHandler /* USART1 */ \n\ - .word SPI1_IRQHandler /* SPI1 */ \n\ - .word TIM1_BRK_IRQHandler /* TIM1 Break */ \n\ - .word TIM1_UP_IRQHandler /* TIM1 Update */ \n\ - .word TIM1_TRG_COM_IRQHandler /* TIM1 Trigger and Commutation */ \n\ - .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ \n\ - .word TIM2_IRQHandler /* TIM2 */ \n\ - .option pop;\n" - - /* memory mapped structure for SysTick */ - typedef struct - { - __IO uint32_t CTLR; - __IO uint32_t SR; - __IO uint32_t CNT; - uint32_t RESERVED0; - __IO uint32_t CMP; - uint32_t RESERVED1; - } SysTick_Type; - -#endif /* __ASSEMBLER__*/ - -#define HardFault_IRQn EXC_IRQn - -/* Standard Peripheral Library old definitions (maintained for legacy purpose) */ -#define HSI_Value HSI_VALUE -#define HSE_Value HSE_VALUE -#define HSEStartUp_TimeOut HSE_STARTUP_TIMEOUT - -#ifndef __ASSEMBLER__ - /* Analog to Digital Converter */ - typedef struct - { - __IO uint32_t STATR; - __IO uint32_t CTLR1; - __IO uint32_t CTLR2; - __IO uint32_t SAMPTR1; - __IO uint32_t SAMPTR2; - __IO uint32_t IOFR1; - __IO uint32_t IOFR2; - __IO uint32_t IOFR3; - __IO uint32_t IOFR4; - __IO uint32_t WDHTR; - __IO uint32_t WDLTR; - __IO uint32_t RSQR1; - __IO uint32_t RSQR2; - __IO uint32_t RSQR3; - __IO uint32_t ISQR; - __IO uint32_t IDATAR1; - __IO uint32_t IDATAR2; - __IO uint32_t IDATAR3; - __IO uint32_t IDATAR4; - __IO uint32_t RDATAR; - __IO uint32_t DLYR; - } ADC_TypeDef; - - /* CRC Calculation Unit */ - typedef struct - { - __IO uint32_t DATAR; - __IO uint8_t IDATAR; - uint8_t RESERVED0; - uint16_t RESERVED1; - __IO uint32_t CTLR; - } CRC_TypeDef; - - /* Debug MCU */ - typedef struct - { - __IO uint32_t CFGR0; - __IO uint32_t CFGR1; - } DBGMCU_TypeDef; - - /* DMA Controller */ - typedef struct - { - __IO uint32_t CFGR; - __IO uint32_t CNTR; - __IO uint32_t PADDR; - __IO uint32_t MADDR; - } DMA_Channel_TypeDef; - - typedef struct - { - __IO uint32_t INTFR; - __IO uint32_t INTFCR; - } DMA_TypeDef; - - /* External Interrupt/Event Controller */ - typedef struct - { - __IO uint32_t INTENR; - __IO uint32_t EVENR; - __IO uint32_t RTENR; - __IO uint32_t FTENR; - __IO uint32_t SWIEVR; - __IO uint32_t INTFR; - } EXTI_TypeDef; - - /* FLASH Registers */ - typedef struct - { - __IO uint32_t ACTLR; - __IO uint32_t KEYR; - __IO uint32_t OBKEYR; - __IO uint32_t STATR; - __IO uint32_t CTLR; - __IO uint32_t ADDR; - __IO uint32_t RESERVED; - __IO uint32_t OBR; - __IO uint32_t WPR; - __IO uint32_t MODEKEYR; - __IO uint32_t BOOT_MODEKEYR; - } FLASH_TypeDef; - - /* Option Bytes Registers */ - typedef struct - { - __IO uint16_t RDPR; - __IO uint16_t USER; - __IO uint16_t Data0; - __IO uint16_t Data1; - __IO uint16_t WRPR0; - __IO uint16_t WRPR1; - } OB_TypeDef; - - typedef struct - { - __IO uint16_t CAP; - __IO uint16_t RES1; - __IO uint32_t RES2; - __IO uint32_t UID0; - __IO uint32_t UID1; - __IO uint32_t UID2; - __IO uint32_t RES3; - } ESG_TypeDef; - - typedef struct - { - union - { - __I uint32_t CHIPID; - struct - { - __I uint16_t REVID; - __I uint16_t DEVID; - }; - }; - } INFO_TypeDef; - - /* General Purpose I/O */ - typedef enum - { - GPIO_CFGLR_IN_ANALOG = 0, - GPIO_CFGLR_IN_FLOAT = 4, - GPIO_CFGLR_IN_PUPD = 8, - GPIO_CFGLR_OUT_10Mhz_PP = 1, - GPIO_CFGLR_OUT_2Mhz_PP = 2, - GPIO_CFGLR_OUT_50Mhz_PP = 3, - GPIO_CFGLR_OUT_10Mhz_OD = 5, - GPIO_CFGLR_OUT_2Mhz_OD = 6, - GPIO_CFGLR_OUT_50Mhz_OD = 7, - GPIO_CFGLR_OUT_10Mhz_AF_PP = 9, - GPIO_CFGLR_OUT_2Mhz_AF_PP = 10, - GPIO_CFGLR_OUT_50Mhz_AF_PP = 11, - GPIO_CFGLR_OUT_10Mhz_AF_OD = 13, - GPIO_CFGLR_OUT_2Mhz_AF_OD = 14, - GPIO_CFGLR_OUT_50Mhz_AF_OD = 15, - } GPIO_CFGLR_PIN_MODE_Typedef; - - typedef union - { - uint32_t __FULL; - struct - { - GPIO_CFGLR_PIN_MODE_Typedef PIN0 : 4; - GPIO_CFGLR_PIN_MODE_Typedef PIN1 : 4; - GPIO_CFGLR_PIN_MODE_Typedef PIN2 : 4; - GPIO_CFGLR_PIN_MODE_Typedef PIN3 : 4; - GPIO_CFGLR_PIN_MODE_Typedef PIN4 : 4; - GPIO_CFGLR_PIN_MODE_Typedef PIN5 : 4; - GPIO_CFGLR_PIN_MODE_Typedef PIN6 : 4; - GPIO_CFGLR_PIN_MODE_Typedef PIN7 : 4; - }; - } GPIO_CFGLR_t; - typedef union - { - uint32_t __FULL; - const struct - { - uint32_t IDR0 : 1; - uint32_t IDR1 : 1; - uint32_t IDR2 : 1; - uint32_t IDR3 : 1; - uint32_t IDR4 : 1; - uint32_t IDR5 : 1; - uint32_t IDR6 : 1; - uint32_t IDR7 : 1; - uint32_t : 24; - }; - } GPIO_INDR_t; - typedef union - { - uint32_t __FULL; - struct - { - uint32_t ODR0 : 1; - uint32_t ODR1 : 1; - uint32_t ODR2 : 1; - uint32_t ODR3 : 1; - uint32_t ODR4 : 1; - uint32_t ODR5 : 1; - uint32_t ODR6 : 1; - uint32_t ODR7 : 1; - uint32_t : 24; - }; - } GPIO_OUTDR_t; - typedef union - { - uint32_t __FULL; - struct - { - uint32_t BS0 : 1; - uint32_t BS1 : 1; - uint32_t BS2 : 1; - uint32_t BS3 : 1; - uint32_t BS4 : 1; - uint32_t BS5 : 1; - uint32_t BS6 : 1; - uint32_t BS7 : 1; - uint32_t : 8; - uint32_t BR0 : 1; - uint32_t BR1 : 1; - uint32_t BR2 : 1; - uint32_t BR3 : 1; - uint32_t BR4 : 1; - uint32_t BR5 : 1; - uint32_t BR6 : 1; - uint32_t BR7 : 1; - uint32_t : 8; - }; - } GPIO_BSHR_t; - typedef union - { - uint32_t __FULL; - struct - { - uint32_t BR0 : 1; - uint32_t BR1 : 1; - uint32_t BR2 : 1; - uint32_t BR3 : 1; - uint32_t BR4 : 1; - uint32_t BR5 : 1; - uint32_t BR6 : 1; - uint32_t BR7 : 1; - uint32_t : 24; - }; - } GPIO_BCR_t; - typedef union - { - uint32_t __FULL; - struct - { - uint32_t LCK0 : 1; - uint32_t LCK1 : 1; - uint32_t LCK2 : 1; - uint32_t LCK3 : 1; - uint32_t LCK4 : 1; - uint32_t LCK5 : 1; - uint32_t LCK6 : 1; - uint32_t LCK7 : 1; - uint32_t LCKK : 1; - uint32_t : 23; - }; - } GPIO_LCKR_t; - typedef struct - { - __IO uint32_t CFGLR; - __IO uint32_t CFGHR; - __I uint32_t INDR; - __IO uint32_t OUTDR; - __IO uint32_t BSHR; - __IO uint32_t BCR; - __IO uint32_t LCKR; - } GPIO_TypeDef; - -#define DYN_GPIO_READ(gpio, field) ((GPIO_##field##_t){.__FULL = gpio->field}) -#define DYN_GPIO_WRITE(gpio, field, ...) gpio->field = ((const GPIO_##field##_t)__VA_ARGS__).__FULL -#define DYN_GPIO_MOD(gpio, field, reg, val) \ - { \ - GPIO_##field##_t tmp; \ - tmp.__FULL = gpio->field; \ - tmp.reg = val; \ - gpio->field = tmp.__FULL; \ - } - - /* Alternate Function I/O */ - typedef struct - { - uint32_t RESERVED0; - __IO uint32_t PCFR1; - __IO uint32_t EXTICR; - } AFIO_TypeDef; - - /* Inter Integrated Circuit Interface */ - typedef struct - { - __IO uint16_t CTLR1; - uint16_t RESERVED0; - __IO uint16_t CTLR2; - uint16_t RESERVED1; - __IO uint16_t OADDR1; - uint16_t RESERVED2; - __IO uint16_t OADDR2; - uint16_t RESERVED3; - __IO uint16_t DATAR; - uint16_t RESERVED4; - __IO uint16_t STAR1; - uint16_t RESERVED5; - __IO uint16_t STAR2; - uint16_t RESERVED6; - __IO uint16_t CKCFGR; - uint16_t RESERVED7; - } I2C_TypeDef; - - /* Independent WatchDog */ - typedef struct - { - __IO uint32_t CTLR; - __IO uint32_t PSCR; - __IO uint32_t RLDR; - __IO uint32_t STATR; - } IWDG_TypeDef; - - /* Power Control */ - typedef struct - { - __IO uint32_t CTLR; - __IO uint32_t CSR; - __IO uint32_t AWUCSR; - __IO uint32_t AWUWR; - __IO uint32_t AWUPSC; - } PWR_TypeDef; - - /* Reset and Clock Control */ - typedef struct - { - __IO uint32_t CTLR; - __IO uint32_t CFGR0; - __IO uint32_t INTR; - __IO uint32_t APB2PRSTR; - __IO uint32_t APB1PRSTR; - __IO uint32_t AHBPCENR; - __IO uint32_t APB2PCENR; - __IO uint32_t APB1PCENR; - __IO uint32_t RESERVED0; - __IO uint32_t RSTSCKR; - } RCC_TypeDef; - - /* Serial Peripheral Interface */ - typedef struct - { - __IO uint16_t CTLR1; - uint16_t RESERVED0; - __IO uint16_t CTLR2; - uint16_t RESERVED1; - __IO uint16_t STATR; - uint16_t RESERVED2; - __IO uint16_t DATAR; - uint16_t RESERVED3; - __IO uint16_t CRCR; - uint16_t RESERVED4; - __IO uint16_t RCRCR; - uint16_t RESERVED5; - __IO uint16_t TCRCR; - uint16_t RESERVED6; - uint32_t RESERVED7; - uint32_t RESERVED8; - __IO uint16_t HSCR; - uint16_t RESERVED9; - } SPI_TypeDef; - - /* TIM */ - typedef struct - { - __IO uint16_t CTLR1; - uint16_t RESERVED0; - __IO uint16_t CTLR2; - uint16_t RESERVED1; - __IO uint16_t SMCFGR; - uint16_t RESERVED2; - __IO uint16_t DMAINTENR; - uint16_t RESERVED3; - __IO uint16_t INTFR; - uint16_t RESERVED4; - __IO uint16_t SWEVGR; - uint16_t RESERVED5; - __IO uint16_t CHCTLR1; - uint16_t RESERVED6; - __IO uint16_t CHCTLR2; - uint16_t RESERVED7; - __IO uint16_t CCER; - uint16_t RESERVED8; - __IO uint16_t CNT; - uint16_t RESERVED9; - __IO uint16_t PSC; - uint16_t RESERVED10; - __IO uint16_t ATRLR; - uint16_t RESERVED11; - __IO uint16_t RPTCR; - uint16_t RESERVED12; - __IO uint32_t CH1CVR; - __IO uint32_t CH2CVR; - __IO uint32_t CH3CVR; - __IO uint32_t CH4CVR; - __IO uint16_t BDTR; - uint16_t RESERVED13; - __IO uint16_t DMACFGR; - uint16_t RESERVED14; - __IO uint16_t DMAADR; - uint16_t RESERVED15; - } TIM_TypeDef; - - /* Universal Synchronous Asynchronous Receiver Transmitter */ - typedef struct - { - __IO uint16_t STATR; - uint16_t RESERVED0; - __IO uint16_t DATAR; - uint16_t RESERVED1; - __IO uint16_t BRR; - uint16_t RESERVED2; - __IO uint16_t CTLR1; - uint16_t RESERVED3; - __IO uint16_t CTLR2; - uint16_t RESERVED4; - __IO uint16_t CTLR3; - uint16_t RESERVED5; - __IO uint16_t GPR; - uint16_t RESERVED6; - } USART_TypeDef; - - /* Window WatchDog */ - typedef struct - { - __IO uint32_t CTLR; - __IO uint32_t CFGR; - __IO uint32_t STATR; - } WWDG_TypeDef; - - /* Enhanced Registers */ - typedef struct - { - __IO uint32_t EXTEN_CTR; - } EXTEN_TypeDef; - - /* The reference manual for the ch32v2xx/v3xx reference this as "CTR" field in the "EXTEND" register so adding an alias here. */ - typedef struct - { - __IO uint32_t CTR; - } EXTEND_TypeDef; - -#endif - -/* Peripheral memory map */ -#ifdef __ASSEMBLER__ -#define FLASH_BASE (0x08000000) /* FLASH base address in the alias region */ -#define SRAM_BASE (0x20000000) /* SRAM base address in the alias region */ -#define PERIPH_BASE (0x40000000) /* Peripheral base address in the alias region */ -#define CORE_PERIPH_BASE (0xE0000000) /* System peripherals base address in the alias region */ -#else -#define FLASH_BASE ((uint32_t)0x08000000) /* FLASH base address in the alias region */ -#define SRAM_BASE ((uint32_t)0x20000000) /* SRAM base address in the alias region */ -#define PERIPH_BASE ((uint32_t)0x40000000) /* Peripheral base address in the alias region */ -#define CORE_PERIPH_BASE ((uint32_t)0xE0000000) /* System peripherals base address in the alias region */ -#endif - -#define APB1PERIPH_BASE (PERIPH_BASE) -#define APB2PERIPH_BASE (PERIPH_BASE + 0x10000) -#define AHBPERIPH_BASE (PERIPH_BASE + 0x20000) - -#define TIM2_BASE (APB1PERIPH_BASE + 0x0000) -#define WWDG_BASE (APB1PERIPH_BASE + 0x2C00) -#define IWDG_BASE (APB1PERIPH_BASE + 0x3000) -#define I2C1_BASE (APB1PERIPH_BASE + 0x5400) -#define PWR_BASE (APB1PERIPH_BASE + 0x7000) - -#define AFIO_BASE (APB2PERIPH_BASE + 0x0000) -#define EXTI_BASE (APB2PERIPH_BASE + 0x0400) -#define GPIOA_BASE (APB2PERIPH_BASE + 0x0800) -#define GPIOC_BASE (APB2PERIPH_BASE + 0x1000) -#define GPIOD_BASE (APB2PERIPH_BASE + 0x1400) -#define ADC1_BASE (APB2PERIPH_BASE + 0x2400) -#define TIM1_BASE (APB2PERIPH_BASE + 0x2C00) -#define SPI1_BASE (APB2PERIPH_BASE + 0x3000) -#define USART1_BASE (APB2PERIPH_BASE + 0x3800) - -#define DMA1_BASE (AHBPERIPH_BASE + 0x0000) -#define DMA1_Channel1_BASE (AHBPERIPH_BASE + 0x0008) -#define DMA1_Channel2_BASE (AHBPERIPH_BASE + 0x001C) -#define DMA1_Channel3_BASE (AHBPERIPH_BASE + 0x0030) -#define DMA1_Channel4_BASE (AHBPERIPH_BASE + 0x0044) -#define DMA1_Channel5_BASE (AHBPERIPH_BASE + 0x0058) -#define DMA1_Channel6_BASE (AHBPERIPH_BASE + 0x006C) -#define DMA1_Channel7_BASE (AHBPERIPH_BASE + 0x0080) -#define RCC_BASE (AHBPERIPH_BASE + 0x1000) - -#define FLASH_R_BASE (AHBPERIPH_BASE + 0x2000) /* Flash registers base address */ - -#define OB_BASE ((uint32_t)0x1FFFF800) /* Flash Option Bytes base address */ -#define ESIG_BASE ((uint32_t)0x1FFFF7E0) -#define INFO_BASE ((uint32_t)0x1FFFF704) - -#define EXTEN_BASE ((uint32_t)0x40023800) - -#define VENDOR_CFG0_BASE ((uint32_t)0x1FFFF7D4) -#define CFG0_PLL_TRIM (VENDOR_CFG0_BASE) - -#define PFIC_BASE (CORE_PERIPH_BASE + 0xE000) -#define SysTick_BASE (CORE_PERIPH_BASE + 0xF000) - -// AFIO CTLR Bits -#define PB6_FILT_EN (1 << 27) -#define PB5_FILT_EN (1 << 26) -#define PA4_FILT_EN (1 << 25) -#define PA3_FILT_EN (1 << 24) -#define UDM_BC_CMPO (1 << 19) -#define UDP_BC_CMPO (1 << 17) -#define UDM_BC_VSRC (1 << 17) -#define UDP_BC_VSRC (1 << 16) -#define USBPD_IN_HVT (1 << 9) -#define USBPD_PHY_V33 (1 << 8) -#define USB_IOEN (1 << 7) -#define USB_PHY_V33 (1 << 6) -#define UDP_PUE_00 (0b00 << 2) -#define UDP_PUE_01 (0b01 << 2) -#define UDP_PUE_10 (0b10 << 2) -#define UDP_PUE_11 (0b11 << 2) -#define UDM_PUE_00 (0b00 << 0) -#define UDM_PUE_01 (0b01 << 0) -#define UDM_PUE_10 (0b10 << 0) -#define UDM_PUE_11 (0b11 << 0) -#define UDP_PUE_MASK 0x0000000C -#define UDP_PUE_DISABLE 0x00000000 -#define UDP_PUE_35UA 0x00000004 -#define UDP_PUE_10K 0x00000008 -#define UDP_PUE_1K5 0x0000000C -#define UDM_PUE_MASK 0x00000003 -#define UDM_PUE_DISABLE 0x00000000 -#define UDM_PUE_35UA 0x00000001 -#define UDM_PUE_10K 0x00000002 -#define UDM_PUE_1K5 0x00000003 - -// USB PD Bits -#define IE_TX_END (1 << 15) -#define IE_RX_RESET (1 << 14) -#define IE_RX_ACT (1 << 13) -#define IE_RX_BYTE (1 << 12) -#define IE_RX_BIT (1 << 11) -#define IE_PD_IO (1 << 10) -#define WAKE_POLAR (1 << 5) -#define PD_RST_EN (1 << 4) -#define PD_DMA_EN (1 << 3) -#define CC_SEL (1 << 2) -#define PD_ALL_CLR (1 << 1) -#define PD_FILT_EN (1 << 0) -#define BMC_CLK_CNT_MASK (0xff) - -// R8_CONTROL -#define BMC_BYTE_HI (1 << 7) -#define TX_BIT_BACK (1 << 6) -#define DATA_FLAG (1 << 5) -#define RX_STATE_MASK (0x7 << 2) -#define RX_STATE_0 (1 << 2) -#define RX_STATE_1 (1 << 3) -#define RX_STATE_2 (1 << 4) -#define BMC_START (1 << 1) -#define PD_TX_EN (1 << 0) - -#define TX_SEL4_MASK (3 << 6) -#define TX_SEL4_0 (1 << 6) -#define TX_SEL4_1 (1 << 7) - -#define TX_SEL3_MASK (3 << 4) -#define TX_SEL3_0 (1 << 4) -#define TX_SEL3_1 (1 << 5) - -#define TX_SEL2_MASK (3 << 2) -#define TX_SEL2_0 (1 << 2) -#define TX_SEL2_1 (1 << 3) - -#define TX_SEL1 (1 << 0) - -#define BMC_TX_SZ_MASK (0x1ff) - -// R8_STATUS -#define IF_TX_END (1 << 7) -#define IF_RX_RESET (1 << 6) -#define IF_RX_ACT (1 << 5) -#define IF_RX_BYTE (1 << 4) -#define IF_RX_BIT (1 << 3) -#define IFBUF_ERR (1 << 2) -#define BMC_AUX_MASK (3 << 0) -#define BMC_AUX_1 (1 << 1) -#define BMC_AUX_0 (1 << 0) - -// PORT CC1 -#define CC1_CE_MASK (7 << 5) -#define CC1_CE_0 (1 << 5) -#define CC1_CE_1 (2 << 5) -#define CC1_CE_2 (4 << 5) - -#define CC1_LVE (1 << 4) -#define CC1_PU_MASK (3 << 2) -#define CC1_PU_DISABLE (0 << 2) -#define CC1_PU_330uA (1 << 2) -#define CC1_PU_180uA (2 << 2) -#define CC1_PU_80uA (3 << 2) -#define PA_CC1_AI (1 << 0) - -#define CC2_CE_MASK (7 << 5) -#define CC2_CE_0 (1 << 5) -#define CC2_CE_1 (2 << 5) -#define CC2_CE_2 (4 << 5) - -#define CC2_LVE (1 << 4) -#define CC2_PU_MASK (3 << 2) -#define CC2_PU_DISABLE (0 << 2) -#define CC2_PU_330uA (1 << 2) -#define CC2_PU_180uA (2 << 2) -#define CC2_PU_80uA (3 << 2) -#define PA_CC2_AI (1 << 0) - -/* Peripheral declaration */ -#define TIM2 ((TIM_TypeDef *)TIM2_BASE) -#define WWDG ((WWDG_TypeDef *)WWDG_BASE) -#define IWDG ((IWDG_TypeDef *)IWDG_BASE) -#define I2C1 ((I2C_TypeDef *)I2C1_BASE) -#define PWR ((PWR_TypeDef *)PWR_BASE) - -#define AFIO ((AFIO_TypeDef *)AFIO_BASE) -#define EXTI ((EXTI_TypeDef *)EXTI_BASE) -#define GPIOA ((GPIO_TypeDef *)GPIOA_BASE) -#define GPIOC ((GPIO_TypeDef *)GPIOC_BASE) -#define GPIOD ((GPIO_TypeDef *)GPIOD_BASE) -#define ADC1 ((ADC_TypeDef *)ADC1_BASE) -#define TIM1 ((TIM_TypeDef *)TIM1_BASE) -#define SPI1 ((SPI_TypeDef *)SPI1_BASE) -#define USART1 ((USART_TypeDef *)USART1_BASE) - -#define DMA1 ((DMA_TypeDef *)DMA1_BASE) -#define DMA1_Channel1 ((DMA_Channel_TypeDef *)DMA1_Channel1_BASE) -#define DMA1_Channel2 ((DMA_Channel_TypeDef *)DMA1_Channel2_BASE) -#define DMA1_Channel3 ((DMA_Channel_TypeDef *)DMA1_Channel3_BASE) -#define DMA1_Channel4 ((DMA_Channel_TypeDef *)DMA1_Channel4_BASE) -#define DMA1_Channel5 ((DMA_Channel_TypeDef *)DMA1_Channel5_BASE) -#define DMA1_Channel6 ((DMA_Channel_TypeDef *)DMA1_Channel6_BASE) -#define DMA1_Channel7 ((DMA_Channel_TypeDef *)DMA1_Channel7_BASE) -#define RCC ((RCC_TypeDef *)RCC_BASE) -#define FLASH ((FLASH_TypeDef *)FLASH_R_BASE) -#define OB ((OB_TypeDef *)OB_BASE) -#define ESIG ((ESG_TypeDef *)ESIG_BASE) -// Mentioned in ch32v30x_dbgmcu.c, may not work on all processors. -#define INFO ((INFO_TypeDef *)INFO_BASE) -#define EXTEN ((EXTEN_TypeDef *)EXTEN_BASE) -#define EXTEND ((EXTEND_TypeDef *)EXTEN_BASE) // Alias to EXTEN - -/******************************************************************************/ -/* Peripheral Registers Bits Definition */ -/******************************************************************************/ - -/******************************************************************************/ -/* Analog to Digital Converter */ -/******************************************************************************/ - -/******************** Bit definition for ADC_STATR register ********************/ -#define ADC_AWD ((uint8_t)0x01) /* Analog watchdog flag */ -#define ADC_EOC ((uint8_t)0x02) /* End of conversion */ -#define ADC_JEOC ((uint8_t)0x04) /* Injected channel end of conversion */ -#define ADC_JSTRT ((uint8_t)0x08) /* Injected channel Start flag */ -#define ADC_STRT ((uint8_t)0x10) /* Regular channel Start flag */ - -/******************* Bit definition for ADC_CTLR1 register ********************/ -#define ADC_AWDCH ((uint32_t)0x0000001F) /* AWDCH[4:0] bits (Analog watchdog channel select bits) */ -#define ADC_AWDCH_0 ((uint32_t)0x00000001) /* Bit 0 */ -#define ADC_AWDCH_1 ((uint32_t)0x00000002) /* Bit 1 */ -#define ADC_AWDCH_2 ((uint32_t)0x00000004) /* Bit 2 */ -#define ADC_AWDCH_3 ((uint32_t)0x00000008) /* Bit 3 */ -#define ADC_AWDCH_4 ((uint32_t)0x00000010) /* Bit 4 */ - -#define ADC_EOCIE ((uint32_t)0x00000020) /* Interrupt enable for EOC */ -#define ADC_AWDIE ((uint32_t)0x00000040) /* Analog Watchdog interrupt enable */ -#define ADC_JEOCIE ((uint32_t)0x00000080) /* Interrupt enable for injected channels */ -#define ADC_SCAN ((uint32_t)0x00000100) /* Scan mode */ -#define ADC_AWDSGL ((uint32_t)0x00000200) /* Enable the watchdog on a single channel in scan mode */ -#define ADC_JAUTO ((uint32_t)0x00000400) /* Automatic injected group conversion */ -#define ADC_DISCEN ((uint32_t)0x00000800) /* Discontinuous mode on regular channels */ -#define ADC_JDISCEN ((uint32_t)0x00001000) /* Discontinuous mode on injected channels */ - -#define ADC_DISCNUM ((uint32_t)0x0000E000) /* DISCNUM[2:0] bits (Discontinuous mode channel count) */ -#define ADC_DISCNUM_0 ((uint32_t)0x00002000) /* Bit 0 */ -#define ADC_DISCNUM_1 ((uint32_t)0x00004000) /* Bit 1 */ -#define ADC_DISCNUM_2 ((uint32_t)0x00008000) /* Bit 2 */ - -#define ADC_DUALMOD ((uint32_t)0x000F0000) /* DUALMOD[3:0] bits (Dual mode selection) */ -#define ADC_DUALMOD_0 ((uint32_t)0x00010000) /* Bit 0 */ -#define ADC_DUALMOD_1 ((uint32_t)0x00020000) /* Bit 1 */ -#define ADC_DUALMOD_2 ((uint32_t)0x00040000) /* Bit 2 */ -#define ADC_DUALMOD_3 ((uint32_t)0x00080000) /* Bit 3 */ - -#define ADC_JAWDEN ((uint32_t)0x00400000) /* Analog watchdog enable on injected channels */ -#define ADC_AWDEN ((uint32_t)0x00800000) /* Analog watchdog enable on regular channels */ -#define ADC_CALVOLSELECT ((uint32_t)0x06000000) -#define ADC_CALVOLSELECT_0 ((uint32_t)0x02000000) -#define ADC_CALVOLSELECT_1 ((uint32_t)0x04000000) - -/******************* Bit definition for ADC_CTLR2 register ********************/ -#define ADC_ADON ((uint32_t)0x00000001) /* A/D Converter ON / OFF */ -#define ADC_CONT ((uint32_t)0x00000002) /* Continuous Conversion */ -#define ADC_CAL ((uint32_t)0x00000004) /* A/D Calibration */ -#define ADC_RSTCAL ((uint32_t)0x00000008) /* Reset Calibration */ -#define ADC_DMA ((uint32_t)0x00000100) /* Direct Memory access mode */ -#define ADC_ALIGN ((uint32_t)0x00000800) /* Data Alignment */ - -#define ADC_JEXTSEL ((uint32_t)0x00007000) /* JEXTSEL[2:0] bits (External event select for injected group) */ -#define ADC_JEXTSEL_0 ((uint32_t)0x00001000) /* Bit 0 */ -#define ADC_JEXTSEL_1 ((uint32_t)0x00002000) /* Bit 1 */ -#define ADC_JEXTSEL_2 ((uint32_t)0x00004000) /* Bit 2 */ - -#define ADC_JEXTTRIG ((uint32_t)0x00008000) /* External Trigger Conversion mode for injected channels */ - -#define ADC_EXTSEL ((uint32_t)0x000E0000) /* EXTSEL[2:0] bits (External Event Select for regular group) */ -#define ADC_EXTSEL_0 ((uint32_t)0x00020000) /* Bit 0 */ -#define ADC_EXTSEL_1 ((uint32_t)0x00040000) /* Bit 1 */ -#define ADC_EXTSEL_2 ((uint32_t)0x00080000) /* Bit 2 */ - -#define ADC_EXTTRIG ((uint32_t)0x00100000) /* External Trigger Conversion mode for regular channels */ -#define ADC_JSWSTART ((uint32_t)0x00200000) /* Start Conversion of injected channels */ -#define ADC_SWSTART ((uint32_t)0x00400000) /* Start Conversion of regular channels */ -#define ADC_TSVREFE ((uint32_t)0x00800000) /* Temperature Sensor and VREFINT Enable */ - -/****************** Bit definition for ADC_SAMPTR1 register *******************/ -#define ADC_SMP10 ((uint32_t)0x00000007) /* SMP10[2:0] bits (Channel 10 Sample time selection) */ -#define ADC_SMP10_0 ((uint32_t)0x00000001) /* Bit 0 */ -#define ADC_SMP10_1 ((uint32_t)0x00000002) /* Bit 1 */ -#define ADC_SMP10_2 ((uint32_t)0x00000004) /* Bit 2 */ - -#define ADC_SMP11 ((uint32_t)0x00000038) /* SMP11[2:0] bits (Channel 11 Sample time selection) */ -#define ADC_SMP11_0 ((uint32_t)0x00000008) /* Bit 0 */ -#define ADC_SMP11_1 ((uint32_t)0x00000010) /* Bit 1 */ -#define ADC_SMP11_2 ((uint32_t)0x00000020) /* Bit 2 */ - -#define ADC_SMP12 ((uint32_t)0x000001C0) /* SMP12[2:0] bits (Channel 12 Sample time selection) */ -#define ADC_SMP12_0 ((uint32_t)0x00000040) /* Bit 0 */ -#define ADC_SMP12_1 ((uint32_t)0x00000080) /* Bit 1 */ -#define ADC_SMP12_2 ((uint32_t)0x00000100) /* Bit 2 */ - -#define ADC_SMP13 ((uint32_t)0x00000E00) /* SMP13[2:0] bits (Channel 13 Sample time selection) */ -#define ADC_SMP13_0 ((uint32_t)0x00000200) /* Bit 0 */ -#define ADC_SMP13_1 ((uint32_t)0x00000400) /* Bit 1 */ -#define ADC_SMP13_2 ((uint32_t)0x00000800) /* Bit 2 */ - -#define ADC_SMP14 ((uint32_t)0x00007000) /* SMP14[2:0] bits (Channel 14 Sample time selection) */ -#define ADC_SMP14_0 ((uint32_t)0x00001000) /* Bit 0 */ -#define ADC_SMP14_1 ((uint32_t)0x00002000) /* Bit 1 */ -#define ADC_SMP14_2 ((uint32_t)0x00004000) /* Bit 2 */ - -#define ADC_SMP15 ((uint32_t)0x00038000) /* SMP15[2:0] bits (Channel 15 Sample time selection) */ -#define ADC_SMP15_0 ((uint32_t)0x00008000) /* Bit 0 */ -#define ADC_SMP15_1 ((uint32_t)0x00010000) /* Bit 1 */ -#define ADC_SMP15_2 ((uint32_t)0x00020000) /* Bit 2 */ - -#define ADC_SMP16 ((uint32_t)0x001C0000) /* SMP16[2:0] bits (Channel 16 Sample time selection) */ -#define ADC_SMP16_0 ((uint32_t)0x00040000) /* Bit 0 */ -#define ADC_SMP16_1 ((uint32_t)0x00080000) /* Bit 1 */ -#define ADC_SMP16_2 ((uint32_t)0x00100000) /* Bit 2 */ - -#define ADC_SMP17 ((uint32_t)0x00E00000) /* SMP17[2:0] bits (Channel 17 Sample time selection) */ -#define ADC_SMP17_0 ((uint32_t)0x00200000) /* Bit 0 */ -#define ADC_SMP17_1 ((uint32_t)0x00400000) /* Bit 1 */ -#define ADC_SMP17_2 ((uint32_t)0x00800000) /* Bit 2 */ - -/****************** Bit definition for ADC_SAMPTR2 register *******************/ -#define ADC_SMP0 ((uint32_t)0x00000007) /* SMP0[2:0] bits (Channel 0 Sample time selection) */ -#define ADC_SMP0_0 ((uint32_t)0x00000001) /* Bit 0 */ -#define ADC_SMP0_1 ((uint32_t)0x00000002) /* Bit 1 */ -#define ADC_SMP0_2 ((uint32_t)0x00000004) /* Bit 2 */ - -#define ADC_SMP1 ((uint32_t)0x00000038) /* SMP1[2:0] bits (Channel 1 Sample time selection) */ -#define ADC_SMP1_0 ((uint32_t)0x00000008) /* Bit 0 */ -#define ADC_SMP1_1 ((uint32_t)0x00000010) /* Bit 1 */ -#define ADC_SMP1_2 ((uint32_t)0x00000020) /* Bit 2 */ - -#define ADC_SMP2 ((uint32_t)0x000001C0) /* SMP2[2:0] bits (Channel 2 Sample time selection) */ -#define ADC_SMP2_0 ((uint32_t)0x00000040) /* Bit 0 */ -#define ADC_SMP2_1 ((uint32_t)0x00000080) /* Bit 1 */ -#define ADC_SMP2_2 ((uint32_t)0x00000100) /* Bit 2 */ - -#define ADC_SMP3 ((uint32_t)0x00000E00) /* SMP3[2:0] bits (Channel 3 Sample time selection) */ -#define ADC_SMP3_0 ((uint32_t)0x00000200) /* Bit 0 */ -#define ADC_SMP3_1 ((uint32_t)0x00000400) /* Bit 1 */ -#define ADC_SMP3_2 ((uint32_t)0x00000800) /* Bit 2 */ - -#define ADC_SMP4 ((uint32_t)0x00007000) /* SMP4[2:0] bits (Channel 4 Sample time selection) */ -#define ADC_SMP4_0 ((uint32_t)0x00001000) /* Bit 0 */ -#define ADC_SMP4_1 ((uint32_t)0x00002000) /* Bit 1 */ -#define ADC_SMP4_2 ((uint32_t)0x00004000) /* Bit 2 */ - -#define ADC_SMP5 ((uint32_t)0x00038000) /* SMP5[2:0] bits (Channel 5 Sample time selection) */ -#define ADC_SMP5_0 ((uint32_t)0x00008000) /* Bit 0 */ -#define ADC_SMP5_1 ((uint32_t)0x00010000) /* Bit 1 */ -#define ADC_SMP5_2 ((uint32_t)0x00020000) /* Bit 2 */ - -#define ADC_SMP6 ((uint32_t)0x001C0000) /* SMP6[2:0] bits (Channel 6 Sample time selection) */ -#define ADC_SMP6_0 ((uint32_t)0x00040000) /* Bit 0 */ -#define ADC_SMP6_1 ((uint32_t)0x00080000) /* Bit 1 */ -#define ADC_SMP6_2 ((uint32_t)0x00100000) /* Bit 2 */ - -#define ADC_SMP7 ((uint32_t)0x00E00000) /* SMP7[2:0] bits (Channel 7 Sample time selection) */ -#define ADC_SMP7_0 ((uint32_t)0x00200000) /* Bit 0 */ -#define ADC_SMP7_1 ((uint32_t)0x00400000) /* Bit 1 */ -#define ADC_SMP7_2 ((uint32_t)0x00800000) /* Bit 2 */ - -#define ADC_SMP8 ((uint32_t)0x07000000) /* SMP8[2:0] bits (Channel 8 Sample time selection) */ -#define ADC_SMP8_0 ((uint32_t)0x01000000) /* Bit 0 */ -#define ADC_SMP8_1 ((uint32_t)0x02000000) /* Bit 1 */ -#define ADC_SMP8_2 ((uint32_t)0x04000000) /* Bit 2 */ - -#define ADC_SMP9 ((uint32_t)0x38000000) /* SMP9[2:0] bits (Channel 9 Sample time selection) */ -#define ADC_SMP9_0 ((uint32_t)0x08000000) /* Bit 0 */ -#define ADC_SMP9_1 ((uint32_t)0x10000000) /* Bit 1 */ -#define ADC_SMP9_2 ((uint32_t)0x20000000) /* Bit 2 */ - -/****************** Bit definition for ADC_IOFR1 register *******************/ -#define ADC_JOFFSET1 ((uint16_t)0x0FFF) /* Data offset for injected channel 1 */ - -/****************** Bit definition for ADC_IOFR2 register *******************/ -#define ADC_JOFFSET2 ((uint16_t)0x0FFF) /* Data offset for injected channel 2 */ - -/****************** Bit definition for ADC_IOFR3 register *******************/ -#define ADC_JOFFSET3 ((uint16_t)0x0FFF) /* Data offset for injected channel 3 */ - -/****************** Bit definition for ADC_IOFR4 register *******************/ -#define ADC_JOFFSET4 ((uint16_t)0x0FFF) /* Data offset for injected channel 4 */ - -/******************* Bit definition for ADC_WDHTR register ********************/ -#define ADC_HT ((uint16_t)0x0FFF) /* Analog watchdog high threshold */ - -/******************* Bit definition for ADC_WDLTR register ********************/ -#define ADC_LT ((uint16_t)0x0FFF) /* Analog watchdog low threshold */ - -/******************* Bit definition for ADC_RSQR1 register *******************/ -#define ADC_SQ13 ((uint32_t)0x0000001F) /* SQ13[4:0] bits (13th conversion in regular sequence) */ -#define ADC_SQ13_0 ((uint32_t)0x00000001) /* Bit 0 */ -#define ADC_SQ13_1 ((uint32_t)0x00000002) /* Bit 1 */ -#define ADC_SQ13_2 ((uint32_t)0x00000004) /* Bit 2 */ -#define ADC_SQ13_3 ((uint32_t)0x00000008) /* Bit 3 */ -#define ADC_SQ13_4 ((uint32_t)0x00000010) /* Bit 4 */ - -#define ADC_SQ14 ((uint32_t)0x000003E0) /* SQ14[4:0] bits (14th conversion in regular sequence) */ -#define ADC_SQ14_0 ((uint32_t)0x00000020) /* Bit 0 */ -#define ADC_SQ14_1 ((uint32_t)0x00000040) /* Bit 1 */ -#define ADC_SQ14_2 ((uint32_t)0x00000080) /* Bit 2 */ -#define ADC_SQ14_3 ((uint32_t)0x00000100) /* Bit 3 */ -#define ADC_SQ14_4 ((uint32_t)0x00000200) /* Bit 4 */ - -#define ADC_SQ15 ((uint32_t)0x00007C00) /* SQ15[4:0] bits (15th conversion in regular sequence) */ -#define ADC_SQ15_0 ((uint32_t)0x00000400) /* Bit 0 */ -#define ADC_SQ15_1 ((uint32_t)0x00000800) /* Bit 1 */ -#define ADC_SQ15_2 ((uint32_t)0x00001000) /* Bit 2 */ -#define ADC_SQ15_3 ((uint32_t)0x00002000) /* Bit 3 */ -#define ADC_SQ15_4 ((uint32_t)0x00004000) /* Bit 4 */ - -#define ADC_SQ16 ((uint32_t)0x000F8000) /* SQ16[4:0] bits (16th conversion in regular sequence) */ -#define ADC_SQ16_0 ((uint32_t)0x00008000) /* Bit 0 */ -#define ADC_SQ16_1 ((uint32_t)0x00010000) /* Bit 1 */ -#define ADC_SQ16_2 ((uint32_t)0x00020000) /* Bit 2 */ -#define ADC_SQ16_3 ((uint32_t)0x00040000) /* Bit 3 */ -#define ADC_SQ16_4 ((uint32_t)0x00080000) /* Bit 4 */ - -#define ADC_L ((uint32_t)0x00F00000) /* L[3:0] bits (Regular channel sequence length) */ -#define ADC_L_0 ((uint32_t)0x00100000) /* Bit 0 */ -#define ADC_L_1 ((uint32_t)0x00200000) /* Bit 1 */ -#define ADC_L_2 ((uint32_t)0x00400000) /* Bit 2 */ -#define ADC_L_3 ((uint32_t)0x00800000) /* Bit 3 */ - -/******************* Bit definition for ADC_RSQR2 register *******************/ -#define ADC_SQ7 ((uint32_t)0x0000001F) /* SQ7[4:0] bits (7th conversion in regular sequence) */ -#define ADC_SQ7_0 ((uint32_t)0x00000001) /* Bit 0 */ -#define ADC_SQ7_1 ((uint32_t)0x00000002) /* Bit 1 */ -#define ADC_SQ7_2 ((uint32_t)0x00000004) /* Bit 2 */ -#define ADC_SQ7_3 ((uint32_t)0x00000008) /* Bit 3 */ -#define ADC_SQ7_4 ((uint32_t)0x00000010) /* Bit 4 */ - -#define ADC_SQ8 ((uint32_t)0x000003E0) /* SQ8[4:0] bits (8th conversion in regular sequence) */ -#define ADC_SQ8_0 ((uint32_t)0x00000020) /* Bit 0 */ -#define ADC_SQ8_1 ((uint32_t)0x00000040) /* Bit 1 */ -#define ADC_SQ8_2 ((uint32_t)0x00000080) /* Bit 2 */ -#define ADC_SQ8_3 ((uint32_t)0x00000100) /* Bit 3 */ -#define ADC_SQ8_4 ((uint32_t)0x00000200) /* Bit 4 */ - -#define ADC_SQ9 ((uint32_t)0x00007C00) /* SQ9[4:0] bits (9th conversion in regular sequence) */ -#define ADC_SQ9_0 ((uint32_t)0x00000400) /* Bit 0 */ -#define ADC_SQ9_1 ((uint32_t)0x00000800) /* Bit 1 */ -#define ADC_SQ9_2 ((uint32_t)0x00001000) /* Bit 2 */ -#define ADC_SQ9_3 ((uint32_t)0x00002000) /* Bit 3 */ -#define ADC_SQ9_4 ((uint32_t)0x00004000) /* Bit 4 */ - -#define ADC_SQ10 ((uint32_t)0x000F8000) /* SQ10[4:0] bits (10th conversion in regular sequence) */ -#define ADC_SQ10_0 ((uint32_t)0x00008000) /* Bit 0 */ -#define ADC_SQ10_1 ((uint32_t)0x00010000) /* Bit 1 */ -#define ADC_SQ10_2 ((uint32_t)0x00020000) /* Bit 2 */ -#define ADC_SQ10_3 ((uint32_t)0x00040000) /* Bit 3 */ -#define ADC_SQ10_4 ((uint32_t)0x00080000) /* Bit 4 */ - -#define ADC_SQ11 ((uint32_t)0x01F00000) /* SQ11[4:0] bits (11th conversion in regular sequence) */ -#define ADC_SQ11_0 ((uint32_t)0x00100000) /* Bit 0 */ -#define ADC_SQ11_1 ((uint32_t)0x00200000) /* Bit 1 */ -#define ADC_SQ11_2 ((uint32_t)0x00400000) /* Bit 2 */ -#define ADC_SQ11_3 ((uint32_t)0x00800000) /* Bit 3 */ -#define ADC_SQ11_4 ((uint32_t)0x01000000) /* Bit 4 */ - -#define ADC_SQ12 ((uint32_t)0x3E000000) /* SQ12[4:0] bits (12th conversion in regular sequence) */ -#define ADC_SQ12_0 ((uint32_t)0x02000000) /* Bit 0 */ -#define ADC_SQ12_1 ((uint32_t)0x04000000) /* Bit 1 */ -#define ADC_SQ12_2 ((uint32_t)0x08000000) /* Bit 2 */ -#define ADC_SQ12_3 ((uint32_t)0x10000000) /* Bit 3 */ -#define ADC_SQ12_4 ((uint32_t)0x20000000) /* Bit 4 */ - -/******************* Bit definition for ADC_RSQR3 register *******************/ -#define ADC_SQ1 ((uint32_t)0x0000001F) /* SQ1[4:0] bits (1st conversion in regular sequence) */ -#define ADC_SQ1_0 ((uint32_t)0x00000001) /* Bit 0 */ -#define ADC_SQ1_1 ((uint32_t)0x00000002) /* Bit 1 */ -#define ADC_SQ1_2 ((uint32_t)0x00000004) /* Bit 2 */ -#define ADC_SQ1_3 ((uint32_t)0x00000008) /* Bit 3 */ -#define ADC_SQ1_4 ((uint32_t)0x00000010) /* Bit 4 */ - -#define ADC_SQ2 ((uint32_t)0x000003E0) /* SQ2[4:0] bits (2nd conversion in regular sequence) */ -#define ADC_SQ2_0 ((uint32_t)0x00000020) /* Bit 0 */ -#define ADC_SQ2_1 ((uint32_t)0x00000040) /* Bit 1 */ -#define ADC_SQ2_2 ((uint32_t)0x00000080) /* Bit 2 */ -#define ADC_SQ2_3 ((uint32_t)0x00000100) /* Bit 3 */ -#define ADC_SQ2_4 ((uint32_t)0x00000200) /* Bit 4 */ - -#define ADC_SQ3 ((uint32_t)0x00007C00) /* SQ3[4:0] bits (3rd conversion in regular sequence) */ -#define ADC_SQ3_0 ((uint32_t)0x00000400) /* Bit 0 */ -#define ADC_SQ3_1 ((uint32_t)0x00000800) /* Bit 1 */ -#define ADC_SQ3_2 ((uint32_t)0x00001000) /* Bit 2 */ -#define ADC_SQ3_3 ((uint32_t)0x00002000) /* Bit 3 */ -#define ADC_SQ3_4 ((uint32_t)0x00004000) /* Bit 4 */ - -#define ADC_SQ4 ((uint32_t)0x000F8000) /* SQ4[4:0] bits (4th conversion in regular sequence) */ -#define ADC_SQ4_0 ((uint32_t)0x00008000) /* Bit 0 */ -#define ADC_SQ4_1 ((uint32_t)0x00010000) /* Bit 1 */ -#define ADC_SQ4_2 ((uint32_t)0x00020000) /* Bit 2 */ -#define ADC_SQ4_3 ((uint32_t)0x00040000) /* Bit 3 */ -#define ADC_SQ4_4 ((uint32_t)0x00080000) /* Bit 4 */ - -#define ADC_SQ5 ((uint32_t)0x01F00000) /* SQ5[4:0] bits (5th conversion in regular sequence) */ -#define ADC_SQ5_0 ((uint32_t)0x00100000) /* Bit 0 */ -#define ADC_SQ5_1 ((uint32_t)0x00200000) /* Bit 1 */ -#define ADC_SQ5_2 ((uint32_t)0x00400000) /* Bit 2 */ -#define ADC_SQ5_3 ((uint32_t)0x00800000) /* Bit 3 */ -#define ADC_SQ5_4 ((uint32_t)0x01000000) /* Bit 4 */ - -#define ADC_SQ6 ((uint32_t)0x3E000000) /* SQ6[4:0] bits (6th conversion in regular sequence) */ -#define ADC_SQ6_0 ((uint32_t)0x02000000) /* Bit 0 */ -#define ADC_SQ6_1 ((uint32_t)0x04000000) /* Bit 1 */ -#define ADC_SQ6_2 ((uint32_t)0x08000000) /* Bit 2 */ -#define ADC_SQ6_3 ((uint32_t)0x10000000) /* Bit 3 */ -#define ADC_SQ6_4 ((uint32_t)0x20000000) /* Bit 4 */ - -/******************* Bit definition for ADC_ISQR register *******************/ -#define ADC_JSQ1 ((uint32_t)0x0000001F) /* JSQ1[4:0] bits (1st conversion in injected sequence) */ -#define ADC_JSQ1_0 ((uint32_t)0x00000001) /* Bit 0 */ -#define ADC_JSQ1_1 ((uint32_t)0x00000002) /* Bit 1 */ -#define ADC_JSQ1_2 ((uint32_t)0x00000004) /* Bit 2 */ -#define ADC_JSQ1_3 ((uint32_t)0x00000008) /* Bit 3 */ -#define ADC_JSQ1_4 ((uint32_t)0x00000010) /* Bit 4 */ - -#define ADC_JSQ2 ((uint32_t)0x000003E0) /* JSQ2[4:0] bits (2nd conversion in injected sequence) */ -#define ADC_JSQ2_0 ((uint32_t)0x00000020) /* Bit 0 */ -#define ADC_JSQ2_1 ((uint32_t)0x00000040) /* Bit 1 */ -#define ADC_JSQ2_2 ((uint32_t)0x00000080) /* Bit 2 */ -#define ADC_JSQ2_3 ((uint32_t)0x00000100) /* Bit 3 */ -#define ADC_JSQ2_4 ((uint32_t)0x00000200) /* Bit 4 */ - -#define ADC_JSQ3 ((uint32_t)0x00007C00) /* JSQ3[4:0] bits (3rd conversion in injected sequence) */ -#define ADC_JSQ3_0 ((uint32_t)0x00000400) /* Bit 0 */ -#define ADC_JSQ3_1 ((uint32_t)0x00000800) /* Bit 1 */ -#define ADC_JSQ3_2 ((uint32_t)0x00001000) /* Bit 2 */ -#define ADC_JSQ3_3 ((uint32_t)0x00002000) /* Bit 3 */ -#define ADC_JSQ3_4 ((uint32_t)0x00004000) /* Bit 4 */ - -#define ADC_JSQ4 ((uint32_t)0x000F8000) /* JSQ4[4:0] bits (4th conversion in injected sequence) */ -#define ADC_JSQ4_0 ((uint32_t)0x00008000) /* Bit 0 */ -#define ADC_JSQ4_1 ((uint32_t)0x00010000) /* Bit 1 */ -#define ADC_JSQ4_2 ((uint32_t)0x00020000) /* Bit 2 */ -#define ADC_JSQ4_3 ((uint32_t)0x00040000) /* Bit 3 */ -#define ADC_JSQ4_4 ((uint32_t)0x00080000) /* Bit 4 */ - -#define ADC_JL ((uint32_t)0x00300000) /* JL[1:0] bits (Injected Sequence length) */ -#define ADC_JL_0 ((uint32_t)0x00100000) /* Bit 0 */ -#define ADC_JL_1 ((uint32_t)0x00200000) /* Bit 1 */ - -/******************* Bit definition for ADC_IDATAR1 register *******************/ -#define ADC_IDATAR1_JDATA ((uint16_t)0xFFFF) /* Injected data */ - -/******************* Bit definition for ADC_IDATAR2 register *******************/ -#define ADC_IDATAR2_JDATA ((uint16_t)0xFFFF) /* Injected data */ - -/******************* Bit definition for ADC_IDATAR3 register *******************/ -#define ADC_IDATAR3_JDATA ((uint16_t)0xFFFF) /* Injected data */ - -/******************* Bit definition for ADC_IDATAR4 register *******************/ -#define ADC_IDATAR4_JDATA ((uint16_t)0xFFFF) /* Injected data */ - -/******************** Bit definition for ADC_RDATAR register ********************/ -#define ADC_RDATAR_DATA ((uint32_t)0x0000FFFF) /* Regular data */ -#define ADC_RDATAR_ADC2DATA ((uint32_t)0xFFFF0000) /* ADC2 data */ - -/******************** Bit definition for ADC_DLYR register ********************/ -#define ADC_DLYR_DLYVLU ((uint32_t)0x1FF) -#define ADC_DLYR_DLYSRC ((uint32_t)0x200) - -/******************************************************************************/ -/* DMA Controller */ -/******************************************************************************/ - -/******************* Bit definition for DMA_INTFR register ********************/ -#define DMA_GIF1 ((uint32_t)0x00000001) /* Channel 1 Global interrupt flag */ -#define DMA_TCIF1 ((uint32_t)0x00000002) /* Channel 1 Transfer Complete flag */ -#define DMA_HTIF1 ((uint32_t)0x00000004) /* Channel 1 Half Transfer flag */ -#define DMA_TEIF1 ((uint32_t)0x00000008) /* Channel 1 Transfer Error flag */ -#define DMA_GIF2 ((uint32_t)0x00000010) /* Channel 2 Global interrupt flag */ -#define DMA_TCIF2 ((uint32_t)0x00000020) /* Channel 2 Transfer Complete flag */ -#define DMA_HTIF2 ((uint32_t)0x00000040) /* Channel 2 Half Transfer flag */ -#define DMA_TEIF2 ((uint32_t)0x00000080) /* Channel 2 Transfer Error flag */ -#define DMA_GIF3 ((uint32_t)0x00000100) /* Channel 3 Global interrupt flag */ -#define DMA_TCIF3 ((uint32_t)0x00000200) /* Channel 3 Transfer Complete flag */ -#define DMA_HTIF3 ((uint32_t)0x00000400) /* Channel 3 Half Transfer flag */ -#define DMA_TEIF3 ((uint32_t)0x00000800) /* Channel 3 Transfer Error flag */ -#define DMA_GIF4 ((uint32_t)0x00001000) /* Channel 4 Global interrupt flag */ -#define DMA_TCIF4 ((uint32_t)0x00002000) /* Channel 4 Transfer Complete flag */ -#define DMA_HTIF4 ((uint32_t)0x00004000) /* Channel 4 Half Transfer flag */ -#define DMA_TEIF4 ((uint32_t)0x00008000) /* Channel 4 Transfer Error flag */ -#define DMA_GIF5 ((uint32_t)0x00010000) /* Channel 5 Global interrupt flag */ -#define DMA_TCIF5 ((uint32_t)0x00020000) /* Channel 5 Transfer Complete flag */ -#define DMA_HTIF5 ((uint32_t)0x00040000) /* Channel 5 Half Transfer flag */ -#define DMA_TEIF5 ((uint32_t)0x00080000) /* Channel 5 Transfer Error flag */ -#define DMA_GIF6 ((uint32_t)0x00100000) /* Channel 6 Global interrupt flag */ -#define DMA_TCIF6 ((uint32_t)0x00200000) /* Channel 6 Transfer Complete flag */ -#define DMA_HTIF6 ((uint32_t)0x00400000) /* Channel 6 Half Transfer flag */ -#define DMA_TEIF6 ((uint32_t)0x00800000) /* Channel 6 Transfer Error flag */ -#define DMA_GIF7 ((uint32_t)0x01000000) /* Channel 7 Global interrupt flag */ -#define DMA_TCIF7 ((uint32_t)0x02000000) /* Channel 7 Transfer Complete flag */ -#define DMA_HTIF7 ((uint32_t)0x04000000) /* Channel 7 Half Transfer flag */ -#define DMA_TEIF7 ((uint32_t)0x08000000) /* Channel 7 Transfer Error flag */ - -/******************* Bit definition for DMA_INTFCR register *******************/ -#define DMA_CGIF1 ((uint32_t)0x00000001) /* Channel 1 Global interrupt clear */ -#define DMA_CTCIF1 ((uint32_t)0x00000002) /* Channel 1 Transfer Complete clear */ -#define DMA_CHTIF1 ((uint32_t)0x00000004) /* Channel 1 Half Transfer clear */ -#define DMA_CTEIF1 ((uint32_t)0x00000008) /* Channel 1 Transfer Error clear */ -#define DMA_CGIF2 ((uint32_t)0x00000010) /* Channel 2 Global interrupt clear */ -#define DMA_CTCIF2 ((uint32_t)0x00000020) /* Channel 2 Transfer Complete clear */ -#define DMA_CHTIF2 ((uint32_t)0x00000040) /* Channel 2 Half Transfer clear */ -#define DMA_CTEIF2 ((uint32_t)0x00000080) /* Channel 2 Transfer Error clear */ -#define DMA_CGIF3 ((uint32_t)0x00000100) /* Channel 3 Global interrupt clear */ -#define DMA_CTCIF3 ((uint32_t)0x00000200) /* Channel 3 Transfer Complete clear */ -#define DMA_CHTIF3 ((uint32_t)0x00000400) /* Channel 3 Half Transfer clear */ -#define DMA_CTEIF3 ((uint32_t)0x00000800) /* Channel 3 Transfer Error clear */ -#define DMA_CGIF4 ((uint32_t)0x00001000) /* Channel 4 Global interrupt clear */ -#define DMA_CTCIF4 ((uint32_t)0x00002000) /* Channel 4 Transfer Complete clear */ -#define DMA_CHTIF4 ((uint32_t)0x00004000) /* Channel 4 Half Transfer clear */ -#define DMA_CTEIF4 ((uint32_t)0x00008000) /* Channel 4 Transfer Error clear */ -#define DMA_CGIF5 ((uint32_t)0x00010000) /* Channel 5 Global interrupt clear */ -#define DMA_CTCIF5 ((uint32_t)0x00020000) /* Channel 5 Transfer Complete clear */ -#define DMA_CHTIF5 ((uint32_t)0x00040000) /* Channel 5 Half Transfer clear */ -#define DMA_CTEIF5 ((uint32_t)0x00080000) /* Channel 5 Transfer Error clear */ -#define DMA_CGIF6 ((uint32_t)0x00100000) /* Channel 6 Global interrupt clear */ -#define DMA_CTCIF6 ((uint32_t)0x00200000) /* Channel 6 Transfer Complete clear */ -#define DMA_CHTIF6 ((uint32_t)0x00400000) /* Channel 6 Half Transfer clear */ -#define DMA_CTEIF6 ((uint32_t)0x00800000) /* Channel 6 Transfer Error clear */ -#define DMA_CGIF7 ((uint32_t)0x01000000) /* Channel 7 Global interrupt clear */ -#define DMA_CTCIF7 ((uint32_t)0x02000000) /* Channel 7 Transfer Complete clear */ -#define DMA_CHTIF7 ((uint32_t)0x04000000) /* Channel 7 Half Transfer clear */ -#define DMA_CTEIF7 ((uint32_t)0x08000000) /* Channel 7 Transfer Error clear */ - -/******************* Bit definition for DMA_CFGR1 register *******************/ -#define DMA_CFGR1_EN ((uint16_t)0x0001) /* Channel enable*/ -#define DMA_CFGR1_TCIE ((uint16_t)0x0002) /* Transfer complete interrupt enable */ -#define DMA_CFGR1_HTIE ((uint16_t)0x0004) /* Half Transfer interrupt enable */ -#define DMA_CFGR1_TEIE ((uint16_t)0x0008) /* Transfer error interrupt enable */ -#define DMA_CFGR1_DIR ((uint16_t)0x0010) /* Data transfer direction (Setting = Memory -> Peripheral) */ -#define DMA_CFGR1_CIRC ((uint16_t)0x0020) /* Circular mode */ -#define DMA_CFGR1_PINC ((uint16_t)0x0040) /* Peripheral increment mode */ -#define DMA_CFGR1_MINC ((uint16_t)0x0080) /* Memory increment mode */ - -#define DMA_CFGR1_PSIZE ((uint16_t)0x0300) /* PSIZE[1:0] bits (Peripheral size) */ -#define DMA_CFGR1_PSIZE_0 ((uint16_t)0x0100) /* Bit 0 */ -#define DMA_CFGR1_PSIZE_1 ((uint16_t)0x0200) /* Bit 1 */ - -#define DMA_CFGR1_MSIZE ((uint16_t)0x0C00) /* MSIZE[1:0] bits (Memory size) */ -#define DMA_CFGR1_MSIZE_0 ((uint16_t)0x0400) /* Bit 0 */ -#define DMA_CFGR1_MSIZE_1 ((uint16_t)0x0800) /* Bit 1 */ - -#define DMA_CFGR1_PL ((uint16_t)0x3000) /* PL[1:0] bits(Channel Priority level) */ -#define DMA_CFGR1_PL_0 ((uint16_t)0x1000) /* Bit 0 */ -#define DMA_CFGR1_PL_1 ((uint16_t)0x2000) /* Bit 1 */ - -#define DMA_CFGR1_MEM2MEM ((uint16_t)0x4000) /* Memory to memory mode */ - -/******************* Bit definition for DMA_CFGR2 register *******************/ -#define DMA_CFGR2_EN ((uint16_t)0x0001) /* Channel enable */ -#define DMA_CFGR2_TCIE ((uint16_t)0x0002) /* Transfer complete interrupt enable */ -#define DMA_CFGR2_HTIE ((uint16_t)0x0004) /* Half Transfer interrupt enable */ -#define DMA_CFGR2_TEIE ((uint16_t)0x0008) /* Transfer error interrupt enable */ -#define DMA_CFGR2_DIR ((uint16_t)0x0010) /* Data transfer direction */ -#define DMA_CFGR2_CIRC ((uint16_t)0x0020) /* Circular mode */ -#define DMA_CFGR2_PINC ((uint16_t)0x0040) /* Peripheral increment mode */ -#define DMA_CFGR2_MINC ((uint16_t)0x0080) /* Memory increment mode */ - -#define DMA_CFGR2_PSIZE ((uint16_t)0x0300) /* PSIZE[1:0] bits (Peripheral size) */ -#define DMA_CFGR2_PSIZE_0 ((uint16_t)0x0100) /* Bit 0 */ -#define DMA_CFGR2_PSIZE_1 ((uint16_t)0x0200) /* Bit 1 */ - -#define DMA_CFGR2_MSIZE ((uint16_t)0x0C00) /* MSIZE[1:0] bits (Memory size) */ -#define DMA_CFGR2_MSIZE_0 ((uint16_t)0x0400) /* Bit 0 */ -#define DMA_CFGR2_MSIZE_1 ((uint16_t)0x0800) /* Bit 1 */ - -#define DMA_CFGR2_PL ((uint16_t)0x3000) /* PL[1:0] bits (Channel Priority level) */ -#define DMA_CFGR2_PL_0 ((uint16_t)0x1000) /* Bit 0 */ -#define DMA_CFGR2_PL_1 ((uint16_t)0x2000) /* Bit 1 */ - -#define DMA_CFGR2_MEM2MEM ((uint16_t)0x4000) /* Memory to memory mode */ - -/******************* Bit definition for DMA_CFGR3 register *******************/ -#define DMA_CFGR3_EN ((uint16_t)0x0001) /* Channel enable */ -#define DMA_CFGR3_TCIE ((uint16_t)0x0002) /* Transfer complete interrupt enable */ -#define DMA_CFGR3_HTIE ((uint16_t)0x0004) /* Half Transfer interrupt enable */ -#define DMA_CFGR3_TEIE ((uint16_t)0x0008) /* Transfer error interrupt enable */ -#define DMA_CFGR3_DIR ((uint16_t)0x0010) /* Data transfer direction */ -#define DMA_CFGR3_CIRC ((uint16_t)0x0020) /* Circular mode */ -#define DMA_CFGR3_PINC ((uint16_t)0x0040) /* Peripheral increment mode */ -#define DMA_CFGR3_MINC ((uint16_t)0x0080) /* Memory increment mode */ - -#define DMA_CFGR3_PSIZE ((uint16_t)0x0300) /* PSIZE[1:0] bits (Peripheral size) */ -#define DMA_CFGR3_PSIZE_0 ((uint16_t)0x0100) /* Bit 0 */ -#define DMA_CFGR3_PSIZE_1 ((uint16_t)0x0200) /* Bit 1 */ - -#define DMA_CFGR3_MSIZE ((uint16_t)0x0C00) /* MSIZE[1:0] bits (Memory size) */ -#define DMA_CFGR3_MSIZE_0 ((uint16_t)0x0400) /* Bit 0 */ -#define DMA_CFGR3_MSIZE_1 ((uint16_t)0x0800) /* Bit 1 */ - -#define DMA_CFGR3_PL ((uint16_t)0x3000) /* PL[1:0] bits (Channel Priority level) */ -#define DMA_CFGR3_PL_0 ((uint16_t)0x1000) /* Bit 0 */ -#define DMA_CFGR3_PL_1 ((uint16_t)0x2000) /* Bit 1 */ - -#define DMA_CFGR3_MEM2MEM ((uint16_t)0x4000) /* Memory to memory mode */ - -/******************* Bit definition for DMA_CFGR4 register *******************/ -#define DMA_CFGR4_EN ((uint16_t)0x0001) /* Channel enable */ -#define DMA_CFGR4_TCIE ((uint16_t)0x0002) /* Transfer complete interrupt enable */ -#define DMA_CFGR4_HTIE ((uint16_t)0x0004) /* Half Transfer interrupt enable */ -#define DMA_CFGR4_TEIE ((uint16_t)0x0008) /* Transfer error interrupt enable */ -#define DMA_CFGR4_DIR ((uint16_t)0x0010) /* Data transfer direction */ -#define DMA_CFGR4_CIRC ((uint16_t)0x0020) /* Circular mode */ -#define DMA_CFGR4_PINC ((uint16_t)0x0040) /* Peripheral increment mode */ -#define DMA_CFGR4_MINC ((uint16_t)0x0080) /* Memory increment mode */ - -#define DMA_CFGR4_PSIZE ((uint16_t)0x0300) /* PSIZE[1:0] bits (Peripheral size) */ -#define DMA_CFGR4_PSIZE_0 ((uint16_t)0x0100) /* Bit 0 */ -#define DMA_CFGR4_PSIZE_1 ((uint16_t)0x0200) /* Bit 1 */ - -#define DMA_CFGR4_MSIZE ((uint16_t)0x0C00) /* MSIZE[1:0] bits (Memory size) */ -#define DMA_CFGR4_MSIZE_0 ((uint16_t)0x0400) /* Bit 0 */ -#define DMA_CFGR4_MSIZE_1 ((uint16_t)0x0800) /* Bit 1 */ - -#define DMA_CFGR4_PL ((uint16_t)0x3000) /* PL[1:0] bits (Channel Priority level) */ -#define DMA_CFGR4_PL_0 ((uint16_t)0x1000) /* Bit 0 */ -#define DMA_CFGR4_PL_1 ((uint16_t)0x2000) /* Bit 1 */ - -#define DMA_CFGR4_MEM2MEM ((uint16_t)0x4000) /* Memory to memory mode */ - -/****************** Bit definition for DMA_CFGR5 register *******************/ -#define DMA_CFGR5_EN ((uint16_t)0x0001) /* Channel enable */ -#define DMA_CFGR5_TCIE ((uint16_t)0x0002) /* Transfer complete interrupt enable */ -#define DMA_CFGR5_HTIE ((uint16_t)0x0004) /* Half Transfer interrupt enable */ -#define DMA_CFGR5_TEIE ((uint16_t)0x0008) /* Transfer error interrupt enable */ -#define DMA_CFGR5_DIR ((uint16_t)0x0010) /* Data transfer direction */ -#define DMA_CFGR5_CIRC ((uint16_t)0x0020) /* Circular mode */ -#define DMA_CFGR5_PINC ((uint16_t)0x0040) /* Peripheral increment mode */ -#define DMA_CFGR5_MINC ((uint16_t)0x0080) /* Memory increment mode */ - -#define DMA_CFGR5_PSIZE ((uint16_t)0x0300) /* PSIZE[1:0] bits (Peripheral size) */ -#define DMA_CFGR5_PSIZE_0 ((uint16_t)0x0100) /* Bit 0 */ -#define DMA_CFGR5_PSIZE_1 ((uint16_t)0x0200) /* Bit 1 */ - -#define DMA_CFGR5_MSIZE ((uint16_t)0x0C00) /* MSIZE[1:0] bits (Memory size) */ -#define DMA_CFGR5_MSIZE_0 ((uint16_t)0x0400) /* Bit 0 */ -#define DMA_CFGR5_MSIZE_1 ((uint16_t)0x0800) /* Bit 1 */ - -#define DMA_CFGR5_PL ((uint16_t)0x3000) /* PL[1:0] bits (Channel Priority level) */ -#define DMA_CFGR5_PL_0 ((uint16_t)0x1000) /* Bit 0 */ -#define DMA_CFGR5_PL_1 ((uint16_t)0x2000) /* Bit 1 */ - -#define DMA_CFGR5_MEM2MEM ((uint16_t)0x4000) /* Memory to memory mode enable */ - -/******************* Bit definition for DMA_CFGR6 register *******************/ -#define DMA_CFGR6_EN ((uint16_t)0x0001) /* Channel enable */ -#define DMA_CFGR6_TCIE ((uint16_t)0x0002) /* Transfer complete interrupt enable */ -#define DMA_CFGR6_HTIE ((uint16_t)0x0004) /* Half Transfer interrupt enable */ -#define DMA_CFGR6_TEIE ((uint16_t)0x0008) /* Transfer error interrupt enable */ -#define DMA_CFGR6_DIR ((uint16_t)0x0010) /* Data transfer direction */ -#define DMA_CFGR6_CIRC ((uint16_t)0x0020) /* Circular mode */ -#define DMA_CFGR6_PINC ((uint16_t)0x0040) /* Peripheral increment mode */ -#define DMA_CFGR6_MINC ((uint16_t)0x0080) /* Memory increment mode */ - -#define DMA_CFGR6_PSIZE ((uint16_t)0x0300) /* PSIZE[1:0] bits (Peripheral size) */ -#define DMA_CFGR6_PSIZE_0 ((uint16_t)0x0100) /* Bit 0 */ -#define DMA_CFGR6_PSIZE_1 ((uint16_t)0x0200) /* Bit 1 */ - -#define DMA_CFGR6_MSIZE ((uint16_t)0x0C00) /* MSIZE[1:0] bits (Memory size) */ -#define DMA_CFGR6_MSIZE_0 ((uint16_t)0x0400) /* Bit 0 */ -#define DMA_CFGR6_MSIZE_1 ((uint16_t)0x0800) /* Bit 1 */ - -#define DMA_CFGR6_PL ((uint16_t)0x3000) /* PL[1:0] bits (Channel Priority level) */ -#define DMA_CFGR6_PL_0 ((uint16_t)0x1000) /* Bit 0 */ -#define DMA_CFGR6_PL_1 ((uint16_t)0x2000) /* Bit 1 */ - -#define DMA_CFGR6_MEM2MEM ((uint16_t)0x4000) /* Memory to memory mode */ - -/******************* Bit definition for DMA_CFGR7 register *******************/ -#define DMA_CFGR7_EN ((uint16_t)0x0001) /* Channel enable */ -#define DMA_CFGR7_TCIE ((uint16_t)0x0002) /* Transfer complete interrupt enable */ -#define DMA_CFGR7_HTIE ((uint16_t)0x0004) /* Half Transfer interrupt enable */ -#define DMA_CFGR7_TEIE ((uint16_t)0x0008) /* Transfer error interrupt enable */ -#define DMA_CFGR7_DIR ((uint16_t)0x0010) /* Data transfer direction */ -#define DMA_CFGR7_CIRC ((uint16_t)0x0020) /* Circular mode */ -#define DMA_CFGR7_PINC ((uint16_t)0x0040) /* Peripheral increment mode */ -#define DMA_CFGR7_MINC ((uint16_t)0x0080) /* Memory increment mode */ - -#define DMA_CFGR7_PSIZE ((uint16_t)0x0300) /* PSIZE[1:0] bits (Peripheral size) */ -#define DMA_CFGR7_PSIZE_0 ((uint16_t)0x0100) /* Bit 0 */ -#define DMA_CFGR7_PSIZE_1 ((uint16_t)0x0200) /* Bit 1 */ - -#define DMA_CFGR7_MSIZE ((uint16_t)0x0C00) /* MSIZE[1:0] bits (Memory size) */ -#define DMA_CFGR7_MSIZE_0 ((uint16_t)0x0400) /* Bit 0 */ -#define DMA_CFGR7_MSIZE_1 ((uint16_t)0x0800) /* Bit 1 */ - -#define DMA_CFGR7_PL ((uint16_t)0x3000) /* PL[1:0] bits (Channel Priority level) */ -#define DMA_CFGR7_PL_0 ((uint16_t)0x1000) /* Bit 0 */ -#define DMA_CFGR7_PL_1 ((uint16_t)0x2000) /* Bit 1 */ - -#define DMA_CFGR7_MEM2MEM ((uint16_t)0x4000) /* Memory to memory mode enable */ - -/****************** Bit definition for DMA_CNTR1 register ******************/ -#define DMA_CNTR1_NDT ((uint16_t)0xFFFF) /* Number of data to Transfer */ - -/****************** Bit definition for DMA_CNTR2 register ******************/ -#define DMA_CNTR2_NDT ((uint16_t)0xFFFF) /* Number of data to Transfer */ - -/****************** Bit definition for DMA_CNTR3 register ******************/ -#define DMA_CNTR3_NDT ((uint16_t)0xFFFF) /* Number of data to Transfer */ - -/****************** Bit definition for DMA_CNTR4 register ******************/ -#define DMA_CNTR4_NDT ((uint16_t)0xFFFF) /* Number of data to Transfer */ - -/****************** Bit definition for DMA_CNTR5 register ******************/ -#define DMA_CNTR5_NDT ((uint16_t)0xFFFF) /* Number of data to Transfer */ - -/****************** Bit definition for DMA_CNTR6 register ******************/ -#define DMA_CNTR6_NDT ((uint16_t)0xFFFF) /* Number of data to Transfer */ - -/****************** Bit definition for DMA_CNTR7 register ******************/ -#define DMA_CNTR7_NDT ((uint16_t)0xFFFF) /* Number of data to Transfer */ - -/****************** Bit definition for DMA_PADDR1 register *******************/ -#define DMA_PADDR1_PA ((uint32_t)0xFFFFFFFF) /* Peripheral Address */ - -/****************** Bit definition for DMA_PADDR2 register *******************/ -#define DMA_PADDR2_PA ((uint32_t)0xFFFFFFFF) /* Peripheral Address */ - -/****************** Bit definition for DMA_PADDR3 register *******************/ -#define DMA_PADDR3_PA ((uint32_t)0xFFFFFFFF) /* Peripheral Address */ - -/****************** Bit definition for DMA_PADDR4 register *******************/ -#define DMA_PADDR4_PA ((uint32_t)0xFFFFFFFF) /* Peripheral Address */ - -/****************** Bit definition for DMA_PADDR5 register *******************/ -#define DMA_PADDR5_PA ((uint32_t)0xFFFFFFFF) /* Peripheral Address */ - -/****************** Bit definition for DMA_PADDR6 register *******************/ -#define DMA_PADDR6_PA ((uint32_t)0xFFFFFFFF) /* Peripheral Address */ - -/****************** Bit definition for DMA_PADDR7 register *******************/ -#define DMA_PADDR7_PA ((uint32_t)0xFFFFFFFF) /* Peripheral Address */ - -/****************** Bit definition for DMA_MADDR1 register *******************/ -#define DMA_MADDR1_MA ((uint32_t)0xFFFFFFFF) /* Memory Address */ - -/****************** Bit definition for DMA_MADDR2 register *******************/ -#define DMA_MADDR2_MA ((uint32_t)0xFFFFFFFF) /* Memory Address */ - -/****************** Bit definition for DMA_MADDR3 register *******************/ -#define DMA_MADDR3_MA ((uint32_t)0xFFFFFFFF) /* Memory Address */ - -/****************** Bit definition for DMA_MADDR4 register *******************/ -#define DMA_MADDR4_MA ((uint32_t)0xFFFFFFFF) /* Memory Address */ - -/****************** Bit definition for DMA_MADDR5 register *******************/ -#define DMA_MADDR5_MA ((uint32_t)0xFFFFFFFF) /* Memory Address */ - -/****************** Bit definition for DMA_MADDR6 register *******************/ -#define DMA_MADDR6_MA ((uint32_t)0xFFFFFFFF) /* Memory Address */ - -/****************** Bit definition for DMA_MADDR7 register *******************/ -#define DMA_MADDR7_MA ((uint32_t)0xFFFFFFFF) /* Memory Address */ - -/******************************************************************************/ -/* External Interrupt/Event Controller */ -/******************************************************************************/ - -/******************* Bit definition for EXTI_INTENR register *******************/ -#define EXTI_INTENR_MR0 ((uint32_t)0x00000001) /* Interrupt Mask on line 0 */ -#define EXTI_INTENR_MR1 ((uint32_t)0x00000002) /* Interrupt Mask on line 1 */ -#define EXTI_INTENR_MR2 ((uint32_t)0x00000004) /* Interrupt Mask on line 2 */ -#define EXTI_INTENR_MR3 ((uint32_t)0x00000008) /* Interrupt Mask on line 3 */ -#define EXTI_INTENR_MR4 ((uint32_t)0x00000010) /* Interrupt Mask on line 4 */ -#define EXTI_INTENR_MR5 ((uint32_t)0x00000020) /* Interrupt Mask on line 5 */ -#define EXTI_INTENR_MR6 ((uint32_t)0x00000040) /* Interrupt Mask on line 6 */ -#define EXTI_INTENR_MR7 ((uint32_t)0x00000080) /* Interrupt Mask on line 7 */ -#define EXTI_INTENR_MR8 ((uint32_t)0x00000100) /* Interrupt Mask on line 8 */ -#define EXTI_INTENR_MR9 ((uint32_t)0x00000200) /* Interrupt Mask on line 9 */ - -/******************* Bit definition for EXTI_EVENR register *******************/ -#define EXTI_EVENR_MR0 ((uint32_t)0x00000001) /* Event Mask on line 0 */ -#define EXTI_EVENR_MR1 ((uint32_t)0x00000002) /* Event Mask on line 1 */ -#define EXTI_EVENR_MR2 ((uint32_t)0x00000004) /* Event Mask on line 2 */ -#define EXTI_EVENR_MR3 ((uint32_t)0x00000008) /* Event Mask on line 3 */ -#define EXTI_EVENR_MR4 ((uint32_t)0x00000010) /* Event Mask on line 4 */ -#define EXTI_EVENR_MR5 ((uint32_t)0x00000020) /* Event Mask on line 5 */ -#define EXTI_EVENR_MR6 ((uint32_t)0x00000040) /* Event Mask on line 6 */ -#define EXTI_EVENR_MR7 ((uint32_t)0x00000080) /* Event Mask on line 7 */ -#define EXTI_EVENR_MR8 ((uint32_t)0x00000100) /* Event Mask on line 8 */ -#define EXTI_EVENR_MR9 ((uint32_t)0x00000200) /* Event Mask on line 9 */ - -/****************** Bit definition for EXTI_RTENR register *******************/ -#define EXTI_RTENR_TR0 ((uint32_t)0x00000001) /* Rising trigger event configuration bit of line 0 */ -#define EXTI_RTENR_TR1 ((uint32_t)0x00000002) /* Rising trigger event configuration bit of line 1 */ -#define EXTI_RTENR_TR2 ((uint32_t)0x00000004) /* Rising trigger event configuration bit of line 2 */ -#define EXTI_RTENR_TR3 ((uint32_t)0x00000008) /* Rising trigger event configuration bit of line 3 */ -#define EXTI_RTENR_TR4 ((uint32_t)0x00000010) /* Rising trigger event configuration bit of line 4 */ -#define EXTI_RTENR_TR5 ((uint32_t)0x00000020) /* Rising trigger event configuration bit of line 5 */ -#define EXTI_RTENR_TR6 ((uint32_t)0x00000040) /* Rising trigger event configuration bit of line 6 */ -#define EXTI_RTENR_TR7 ((uint32_t)0x00000080) /* Rising trigger event configuration bit of line 7 */ -#define EXTI_RTENR_TR8 ((uint32_t)0x00000100) /* Rising trigger event configuration bit of line 8 */ -#define EXTI_RTENR_TR9 ((uint32_t)0x00000200) /* Rising trigger event configuration bit of line 9 */ - -/****************** Bit definition for EXTI_FTENR register *******************/ -#define EXTI_FTENR_TR0 ((uint32_t)0x00000001) /* Falling trigger event configuration bit of line 0 */ -#define EXTI_FTENR_TR1 ((uint32_t)0x00000002) /* Falling trigger event configuration bit of line 1 */ -#define EXTI_FTENR_TR2 ((uint32_t)0x00000004) /* Falling trigger event configuration bit of line 2 */ -#define EXTI_FTENR_TR3 ((uint32_t)0x00000008) /* Falling trigger event configuration bit of line 3 */ -#define EXTI_FTENR_TR4 ((uint32_t)0x00000010) /* Falling trigger event configuration bit of line 4 */ -#define EXTI_FTENR_TR5 ((uint32_t)0x00000020) /* Falling trigger event configuration bit of line 5 */ -#define EXTI_FTENR_TR6 ((uint32_t)0x00000040) /* Falling trigger event configuration bit of line 6 */ -#define EXTI_FTENR_TR7 ((uint32_t)0x00000080) /* Falling trigger event configuration bit of line 7 */ -#define EXTI_FTENR_TR8 ((uint32_t)0x00000100) /* Falling trigger event configuration bit of line 8 */ -#define EXTI_FTENR_TR9 ((uint32_t)0x00000200) /* Falling trigger event configuration bit of line 9 */ - -/****************** Bit definition for EXTI_SWIEVR register ******************/ -#define EXTI_SWIEVR_SWIEVR0 ((uint32_t)0x00000001) /* Software Interrupt on line 0 */ -#define EXTI_SWIEVR_SWIEVR1 ((uint32_t)0x00000002) /* Software Interrupt on line 1 */ -#define EXTI_SWIEVR_SWIEVR2 ((uint32_t)0x00000004) /* Software Interrupt on line 2 */ -#define EXTI_SWIEVR_SWIEVR3 ((uint32_t)0x00000008) /* Software Interrupt on line 3 */ -#define EXTI_SWIEVR_SWIEVR4 ((uint32_t)0x00000010) /* Software Interrupt on line 4 */ -#define EXTI_SWIEVR_SWIEVR5 ((uint32_t)0x00000020) /* Software Interrupt on line 5 */ -#define EXTI_SWIEVR_SWIEVR6 ((uint32_t)0x00000040) /* Software Interrupt on line 6 */ -#define EXTI_SWIEVR_SWIEVR7 ((uint32_t)0x00000080) /* Software Interrupt on line 7 */ -#define EXTI_SWIEVR_SWIEVR8 ((uint32_t)0x00000100) /* Software Interrupt on line 8 */ -#define EXTI_SWIEVR_SWIEVR9 ((uint32_t)0x00000200) /* Software Interrupt on line 9 */ - -/******************* Bit definition for EXTI_INTFR register ********************/ -#define EXTI_INTF_INTF0 ((uint32_t)0x00000001) /* Pending bit for line 0 */ -#define EXTI_INTF_INTF1 ((uint32_t)0x00000002) /* Pending bit for line 1 */ -#define EXTI_INTF_INTF2 ((uint32_t)0x00000004) /* Pending bit for line 2 */ -#define EXTI_INTF_INTF3 ((uint32_t)0x00000008) /* Pending bit for line 3 */ -#define EXTI_INTF_INTF4 ((uint32_t)0x00000010) /* Pending bit for line 4 */ -#define EXTI_INTF_INTF5 ((uint32_t)0x00000020) /* Pending bit for line 5 */ -#define EXTI_INTF_INTF6 ((uint32_t)0x00000040) /* Pending bit for line 6 */ -#define EXTI_INTF_INTF7 ((uint32_t)0x00000080) /* Pending bit for line 7 */ -#define EXTI_INTF_INTF8 ((uint32_t)0x00000100) /* Pending bit for line 8 */ -#define EXTI_INTF_INTF9 ((uint32_t)0x00000200) /* Pending bit for line 9 */ - -/******************************************************************************/ -/* FLASH and Option Bytes Registers */ -/******************************************************************************/ - -/******************* Bit definition for FLASH_ACTLR register ******************/ -#define FLASH_ACTLR_LATENCY ((uint8_t)0x03) /* LATENCY[2:0] bits (Latency) */ -#define FLASH_ACTLR_LATENCY_0 ((uint8_t)0x00) /* Bit 0 */ -#define FLASH_ACTLR_LATENCY_1 ((uint8_t)0x01) /* Bit 0 */ -#define FLASH_ACTLR_LATENCY_2 ((uint8_t)0x02) /* Bit 1 */ - -/****************** Bit definition for FLASH_KEYR register ******************/ -#define FLASH_KEYR_FKEYR ((uint32_t)0xFFFFFFFF) /* FPEC Key */ - -/***************** Bit definition for FLASH_OBKEYR register ****************/ -#define FLASH_OBKEYR_OBKEYR ((uint32_t)0xFFFFFFFF) /* Option Byte Key */ - -/****************** Bit definition for FLASH_STATR register *******************/ -#define FLASH_STATR_BSY ((uint8_t)0x01) /* Busy */ -#define FLASH_STATR_WRPRTERR ((uint8_t)0x10) /* Write Protection Error */ -#define FLASH_STATR_EOP ((uint8_t)0x20) /* End of operation */ -#define FLASH_STATR_MODE ((uint16_t)0x4000) -#define FLASH_STATR_LOCK ((uint16_t)0x8000) - -/******************* Bit definition for FLASH_CTLR register *******************/ -#define FLASH_CTLR_PG (0x0001) /* Programming */ -#define FLASH_CTLR_PER (0x0002) /* Page Erase 1KByte*/ -#define FLASH_CTLR_MER (0x0004) /* Mass Erase */ -#define FLASH_CTLR_OPTPG (0x0010) /* Option Byte Programming */ -#define FLASH_CTLR_OPTER (0x0020) /* Option Byte Erase */ -#define FLASH_CTLR_STRT (0x0040) /* Start */ -#define FLASH_CTLR_LOCK (0x0080) /* Lock */ -#define FLASH_CTLR_OPTWRE (0x0200) /* Option Bytes Write Enable */ -#define FLASH_CTLR_ERRIE (0x0400) /* Error Interrupt Enable */ -#define FLASH_CTLR_EOPIE (0x1000) /* End of operation interrupt enable */ -#define FLASH_CTLR_FLOCK (0x8000) -#define FLASH_CTLR_PAGE_PG (0x00010000) /* Page Programming 64Byte */ -#define FLASH_CTLR_PAGE_ER (0x00020000) /* Page Erase 64Byte */ -#define FLASH_CTLR_BUF_LOAD (0x00040000) /* Buffer Load */ -#define FLASH_CTLR_BUF_RST (0x00080000) /* Buffer Reset */ - -/******************* Bit definition for FLASH_ADDR register *******************/ -#define FLASH_ADDR_FAR ((uint32_t)0xFFFFFFFF) /* Flash Address */ - -/****************** Bit definition for FLASH_OBR register *******************/ -#define FLASH_OBR_OPTERR ((uint16_t)0x0001) /* Option Byte Error */ -#define FLASH_OBR_RDPRT ((uint16_t)0x0002) /* Read protection */ - -#define FLASH_OBR_USER ((uint16_t)0x03FC) /* User Option Bytes */ -#define FLASH_OBR_WDG_SW ((uint16_t)0x0004) /* WDG_SW */ -#define FLASH_OBR_nRST_STOP ((uint16_t)0x0008) /* nRST_STOP */ -#define FLASH_OBR_STANDY_RST ((uint16_t)0x0010) -#define FLASH_OBR_nRST_STDBY ((uint16_t)0x0010) /* nRST_STDBY */ -#define FLASH_OBR_RST_MODE ((uint16_t)0x0060) /* RST_MODE */ -#define FLASH_OBR_STATR_MODE ((uint16_t)0x0080) -#define FLASH_OBR_FIX_11 ((uint16_t)0x0300) - -/****************** Bit definition for FLASH_WPR register ******************/ -#define FLASH_WPR_WRP ((uint32_t)0xFFFFFFFF) /* Write Protect */ - -/****************** Bit definition for FLASH_RDPR register *******************/ -#define FLASH_RDPR_RDPR ((uint32_t)0x000000FF) /* Read protection option byte */ -#define FLASH_RDPR_nRDPR ((uint32_t)0x0000FF00) /* Read protection complemented option byte */ - -/****************** Bit definition for FLASH_USER register ******************/ -#define FLASH_USER_USER ((uint32_t)0x00FF0000) /* User option byte */ -#define FLASH_USER_nUSER ((uint32_t)0xFF000000) /* User complemented option byte */ - -/****************** Bit definition for FLASH_Data0 register *****************/ -#define FLASH_Data0_Data0 ((uint32_t)0x000000FF) /* User data storage option byte */ -#define FLASH_Data0_nData0 ((uint32_t)0x0000FF00) /* User data storage complemented option byte */ - -/****************** Bit definition for FLASH_Data1 register *****************/ -#define FLASH_Data1_Data1 ((uint32_t)0x00FF0000) /* User data storage option byte */ -#define FLASH_Data1_nData1 ((uint32_t)0xFF000000) /* User data storage complemented option byte */ - -/****************** Bit definition for FLASH_WRPR0 register ******************/ -#define FLASH_WRPR0_WRPR0 ((uint32_t)0x000000FF) /* Flash memory write protection option bytes */ -#define FLASH_WRPR0_nWRPR0 ((uint32_t)0x0000FF00) /* Flash memory write protection complemented option bytes */ - -/****************** Bit definition for FLASH_WRPR1 register ******************/ -#define FLASH_WRPR1_WRPR1 ((uint32_t)0x00FF0000) /* Flash memory write protection option bytes */ -#define FLASH_WRPR1_nWRPR1 ((uint32_t)0xFF000000) /* Flash memory write protection complemented option bytes */ - -/****************** Bit definition for FLASH_MODEKEYR register ******************/ -#define FLASH_MODEKEYR_KEY1 ((uint32_t)0x45670123) -#define FLASH_MODEKEYR_KEY2 ((uint32_t)0xCDEF89AB) - -/****************** Bit definition for FLASH__BOOT_MODEKEYR register ******************/ -#define FLASH_BOOT_MODEKEYR_KEY1 ((uint32_t)0x45670123) -#define FLASH_BOOT_MODEKEYR_KEY2 ((uint32_t)0xCDEF89AB) - -/******************************************************************************/ -/* General Purpose and Alternate Function I/O */ -/******************************************************************************/ - -/******************* Bit definition for GPIO_CFGLR register *******************/ -#define GPIO_CFGLR_MODE ((uint32_t)0x33333333) /* Port x mode bits */ - -#define GPIO_CFGLR_MODE0 ((uint32_t)0x00000003) /* MODE0[1:0] bits (Port x mode bits, pin 0) */ -#define GPIO_CFGLR_MODE0_0 ((uint32_t)0x00000001) /* Bit 0 */ -#define GPIO_CFGLR_MODE0_1 ((uint32_t)0x00000002) /* Bit 1 */ - -#define GPIO_CFGLR_MODE1 ((uint32_t)0x00000030) /* MODE1[1:0] bits (Port x mode bits, pin 1) */ -#define GPIO_CFGLR_MODE1_0 ((uint32_t)0x00000010) /* Bit 0 */ -#define GPIO_CFGLR_MODE1_1 ((uint32_t)0x00000020) /* Bit 1 */ - -#define GPIO_CFGLR_MODE2 ((uint32_t)0x00000300) /* MODE2[1:0] bits (Port x mode bits, pin 2) */ -#define GPIO_CFGLR_MODE2_0 ((uint32_t)0x00000100) /* Bit 0 */ -#define GPIO_CFGLR_MODE2_1 ((uint32_t)0x00000200) /* Bit 1 */ - -#define GPIO_CFGLR_MODE3 ((uint32_t)0x00003000) /* MODE3[1:0] bits (Port x mode bits, pin 3) */ -#define GPIO_CFGLR_MODE3_0 ((uint32_t)0x00001000) /* Bit 0 */ -#define GPIO_CFGLR_MODE3_1 ((uint32_t)0x00002000) /* Bit 1 */ - -#define GPIO_CFGLR_MODE4 ((uint32_t)0x00030000) /* MODE4[1:0] bits (Port x mode bits, pin 4) */ -#define GPIO_CFGLR_MODE4_0 ((uint32_t)0x00010000) /* Bit 0 */ -#define GPIO_CFGLR_MODE4_1 ((uint32_t)0x00020000) /* Bit 1 */ - -#define GPIO_CFGLR_MODE5 ((uint32_t)0x00300000) /* MODE5[1:0] bits (Port x mode bits, pin 5) */ -#define GPIO_CFGLR_MODE5_0 ((uint32_t)0x00100000) /* Bit 0 */ -#define GPIO_CFGLR_MODE5_1 ((uint32_t)0x00200000) /* Bit 1 */ - -#define GPIO_CFGLR_MODE6 ((uint32_t)0x03000000) /* MODE6[1:0] bits (Port x mode bits, pin 6) */ -#define GPIO_CFGLR_MODE6_0 ((uint32_t)0x01000000) /* Bit 0 */ -#define GPIO_CFGLR_MODE6_1 ((uint32_t)0x02000000) /* Bit 1 */ - -#define GPIO_CFGLR_MODE7 ((uint32_t)0x30000000) /* MODE7[1:0] bits (Port x mode bits, pin 7) */ -#define GPIO_CFGLR_MODE7_0 ((uint32_t)0x10000000) /* Bit 0 */ -#define GPIO_CFGLR_MODE7_1 ((uint32_t)0x20000000) /* Bit 1 */ - -#define GPIO_CFGLR_CNF ((uint32_t)0xCCCCCCCC) /* Port x configuration bits */ - -#define GPIO_CFGLR_CNF0 ((uint32_t)0x0000000C) /* CNF0[1:0] bits (Port x configuration bits, pin 0) */ -#define GPIO_CFGLR_CNF0_0 ((uint32_t)0x00000004) /* Bit 0 */ -#define GPIO_CFGLR_CNF0_1 ((uint32_t)0x00000008) /* Bit 1 */ - -#define GPIO_CFGLR_CNF1 ((uint32_t)0x000000C0) /* CNF1[1:0] bits (Port x configuration bits, pin 1) */ -#define GPIO_CFGLR_CNF1_0 ((uint32_t)0x00000040) /* Bit 0 */ -#define GPIO_CFGLR_CNF1_1 ((uint32_t)0x00000080) /* Bit 1 */ - -#define GPIO_CFGLR_CNF2 ((uint32_t)0x00000C00) /* CNF2[1:0] bits (Port x configuration bits, pin 2) */ -#define GPIO_CFGLR_CNF2_0 ((uint32_t)0x00000400) /* Bit 0 */ -#define GPIO_CFGLR_CNF2_1 ((uint32_t)0x00000800) /* Bit 1 */ - -#define GPIO_CFGLR_CNF3 ((uint32_t)0x0000C000) /* CNF3[1:0] bits (Port x configuration bits, pin 3) */ -#define GPIO_CFGLR_CNF3_0 ((uint32_t)0x00004000) /* Bit 0 */ -#define GPIO_CFGLR_CNF3_1 ((uint32_t)0x00008000) /* Bit 1 */ - -#define GPIO_CFGLR_CNF4 ((uint32_t)0x000C0000) /* CNF4[1:0] bits (Port x configuration bits, pin 4) */ -#define GPIO_CFGLR_CNF4_0 ((uint32_t)0x00040000) /* Bit 0 */ -#define GPIO_CFGLR_CNF4_1 ((uint32_t)0x00080000) /* Bit 1 */ - -#define GPIO_CFGLR_CNF5 ((uint32_t)0x00C00000) /* CNF5[1:0] bits (Port x configuration bits, pin 5) */ -#define GPIO_CFGLR_CNF5_0 ((uint32_t)0x00400000) /* Bit 0 */ -#define GPIO_CFGLR_CNF5_1 ((uint32_t)0x00800000) /* Bit 1 */ - -#define GPIO_CFGLR_CNF6 ((uint32_t)0x0C000000) /* CNF6[1:0] bits (Port x configuration bits, pin 6) */ -#define GPIO_CFGLR_CNF6_0 ((uint32_t)0x04000000) /* Bit 0 */ -#define GPIO_CFGLR_CNF6_1 ((uint32_t)0x08000000) /* Bit 1 */ - -#define GPIO_CFGLR_CNF7 ((uint32_t)0xC0000000) /* CNF7[1:0] bits (Port x configuration bits, pin 7) */ -#define GPIO_CFGLR_CNF7_0 ((uint32_t)0x40000000) /* Bit 0 */ -#define GPIO_CFGLR_CNF7_1 ((uint32_t)0x80000000) /* Bit 1 */ - -/******************* Bit definition for GPIO_CFGHR register *******************/ -#define GPIO_CFGHR_MODE ((uint32_t)0x33333333) /* Port x mode bits */ - -#define GPIO_CFGHR_MODE8 ((uint32_t)0x00000003) /* MODE8[1:0] bits (Port x mode bits, pin 8) */ -#define GPIO_CFGHR_MODE8_0 ((uint32_t)0x00000001) /* Bit 0 */ -#define GPIO_CFGHR_MODE8_1 ((uint32_t)0x00000002) /* Bit 1 */ - -#define GPIO_CFGHR_MODE9 ((uint32_t)0x00000030) /* MODE9[1:0] bits (Port x mode bits, pin 9) */ -#define GPIO_CFGHR_MODE9_0 ((uint32_t)0x00000010) /* Bit 0 */ -#define GPIO_CFGHR_MODE9_1 ((uint32_t)0x00000020) /* Bit 1 */ - -#define GPIO_CFGHR_MODE10 ((uint32_t)0x00000300) /* MODE10[1:0] bits (Port x mode bits, pin 10) */ -#define GPIO_CFGHR_MODE10_0 ((uint32_t)0x00000100) /* Bit 0 */ -#define GPIO_CFGHR_MODE10_1 ((uint32_t)0x00000200) /* Bit 1 */ - -#define GPIO_CFGHR_MODE11 ((uint32_t)0x00003000) /* MODE11[1:0] bits (Port x mode bits, pin 11) */ -#define GPIO_CFGHR_MODE11_0 ((uint32_t)0x00001000) /* Bit 0 */ -#define GPIO_CFGHR_MODE11_1 ((uint32_t)0x00002000) /* Bit 1 */ - -#define GPIO_CFGHR_MODE12 ((uint32_t)0x00030000) /* MODE12[1:0] bits (Port x mode bits, pin 12) */ -#define GPIO_CFGHR_MODE12_0 ((uint32_t)0x00010000) /* Bit 0 */ -#define GPIO_CFGHR_MODE12_1 ((uint32_t)0x00020000) /* Bit 1 */ - -#define GPIO_CFGHR_MODE13 ((uint32_t)0x00300000) /* MODE13[1:0] bits (Port x mode bits, pin 13) */ -#define GPIO_CFGHR_MODE13_0 ((uint32_t)0x00100000) /* Bit 0 */ -#define GPIO_CFGHR_MODE13_1 ((uint32_t)0x00200000) /* Bit 1 */ - -#define GPIO_CFGHR_MODE14 ((uint32_t)0x03000000) /* MODE14[1:0] bits (Port x mode bits, pin 14) */ -#define GPIO_CFGHR_MODE14_0 ((uint32_t)0x01000000) /* Bit 0 */ -#define GPIO_CFGHR_MODE14_1 ((uint32_t)0x02000000) /* Bit 1 */ - -#define GPIO_CFGHR_MODE15 ((uint32_t)0x30000000) /* MODE15[1:0] bits (Port x mode bits, pin 15) */ -#define GPIO_CFGHR_MODE15_0 ((uint32_t)0x10000000) /* Bit 0 */ -#define GPIO_CFGHR_MODE15_1 ((uint32_t)0x20000000) /* Bit 1 */ - -#define GPIO_CFGHR_CNF ((uint32_t)0xCCCCCCCC) /* Port x configuration bits */ - -#define GPIO_CFGHR_CNF8 ((uint32_t)0x0000000C) /* CNF8[1:0] bits (Port x configuration bits, pin 8) */ -#define GPIO_CFGHR_CNF8_0 ((uint32_t)0x00000004) /* Bit 0 */ -#define GPIO_CFGHR_CNF8_1 ((uint32_t)0x00000008) /* Bit 1 */ - -#define GPIO_CFGHR_CNF9 ((uint32_t)0x000000C0) /* CNF9[1:0] bits (Port x configuration bits, pin 9) */ -#define GPIO_CFGHR_CNF9_0 ((uint32_t)0x00000040) /* Bit 0 */ -#define GPIO_CFGHR_CNF9_1 ((uint32_t)0x00000080) /* Bit 1 */ - -#define GPIO_CFGHR_CNF10 ((uint32_t)0x00000C00) /* CNF10[1:0] bits (Port x configuration bits, pin 10) */ -#define GPIO_CFGHR_CNF10_0 ((uint32_t)0x00000400) /* Bit 0 */ -#define GPIO_CFGHR_CNF10_1 ((uint32_t)0x00000800) /* Bit 1 */ - -#define GPIO_CFGHR_CNF11 ((uint32_t)0x0000C000) /* CNF11[1:0] bits (Port x configuration bits, pin 11) */ -#define GPIO_CFGHR_CNF11_0 ((uint32_t)0x00004000) /* Bit 0 */ -#define GPIO_CFGHR_CNF11_1 ((uint32_t)0x00008000) /* Bit 1 */ - -#define GPIO_CFGHR_CNF12 ((uint32_t)0x000C0000) /* CNF12[1:0] bits (Port x configuration bits, pin 12) */ -#define GPIO_CFGHR_CNF12_0 ((uint32_t)0x00040000) /* Bit 0 */ -#define GPIO_CFGHR_CNF12_1 ((uint32_t)0x00080000) /* Bit 1 */ - -#define GPIO_CFGHR_CNF13 ((uint32_t)0x00C00000) /* CNF13[1:0] bits (Port x configuration bits, pin 13) */ -#define GPIO_CFGHR_CNF13_0 ((uint32_t)0x00400000) /* Bit 0 */ -#define GPIO_CFGHR_CNF13_1 ((uint32_t)0x00800000) /* Bit 1 */ - -#define GPIO_CFGHR_CNF14 ((uint32_t)0x0C000000) /* CNF14[1:0] bits (Port x configuration bits, pin 14) */ -#define GPIO_CFGHR_CNF14_0 ((uint32_t)0x04000000) /* Bit 0 */ -#define GPIO_CFGHR_CNF14_1 ((uint32_t)0x08000000) /* Bit 1 */ - -#define GPIO_CFGHR_CNF15 ((uint32_t)0xC0000000) /* CNF15[1:0] bits (Port x configuration bits, pin 15) */ -#define GPIO_CFGHR_CNF15_0 ((uint32_t)0x40000000) /* Bit 0 */ -#define GPIO_CFGHR_CNF15_1 ((uint32_t)0x80000000) /* Bit 1 */ - -/******************* Bit definition for GPIO_INDR register *******************/ -#define GPIO_INDR_IDR0 ((uint16_t)0x0001) /* Port input data, bit 0 */ -#define GPIO_INDR_IDR1 ((uint16_t)0x0002) /* Port input data, bit 1 */ -#define GPIO_INDR_IDR2 ((uint16_t)0x0004) /* Port input data, bit 2 */ -#define GPIO_INDR_IDR3 ((uint16_t)0x0008) /* Port input data, bit 3 */ -#define GPIO_INDR_IDR4 ((uint16_t)0x0010) /* Port input data, bit 4 */ -#define GPIO_INDR_IDR5 ((uint16_t)0x0020) /* Port input data, bit 5 */ -#define GPIO_INDR_IDR6 ((uint16_t)0x0040) /* Port input data, bit 6 */ -#define GPIO_INDR_IDR7 ((uint16_t)0x0080) /* Port input data, bit 7 */ -#define GPIO_INDR_IDR8 ((uint16_t)0x0100) /* Port input data, bit 8 */ -#define GPIO_INDR_IDR9 ((uint16_t)0x0200) /* Port input data, bit 9 */ -#define GPIO_INDR_IDR10 ((uint16_t)0x0400) /* Port input data, bit 10 */ -#define GPIO_INDR_IDR11 ((uint16_t)0x0800) /* Port input data, bit 11 */ -#define GPIO_INDR_IDR12 ((uint16_t)0x1000) /* Port input data, bit 12 */ -#define GPIO_INDR_IDR13 ((uint16_t)0x2000) /* Port input data, bit 13 */ -#define GPIO_INDR_IDR14 ((uint16_t)0x4000) /* Port input data, bit 14 */ -#define GPIO_INDR_IDR15 ((uint16_t)0x8000) /* Port input data, bit 15 */ - -/******************* Bit definition for GPIO_OUTDR register *******************/ -#define GPIO_OUTDR_ODR0 ((uint16_t)0x0001) /* Port output data, bit 0 */ -#define GPIO_OUTDR_ODR1 ((uint16_t)0x0002) /* Port output data, bit 1 */ -#define GPIO_OUTDR_ODR2 ((uint16_t)0x0004) /* Port output data, bit 2 */ -#define GPIO_OUTDR_ODR3 ((uint16_t)0x0008) /* Port output data, bit 3 */ -#define GPIO_OUTDR_ODR4 ((uint16_t)0x0010) /* Port output data, bit 4 */ -#define GPIO_OUTDR_ODR5 ((uint16_t)0x0020) /* Port output data, bit 5 */ -#define GPIO_OUTDR_ODR6 ((uint16_t)0x0040) /* Port output data, bit 6 */ -#define GPIO_OUTDR_ODR7 ((uint16_t)0x0080) /* Port output data, bit 7 */ -#define GPIO_OUTDR_ODR8 ((uint16_t)0x0100) /* Port output data, bit 8 */ -#define GPIO_OUTDR_ODR9 ((uint16_t)0x0200) /* Port output data, bit 9 */ -#define GPIO_OUTDR_ODR10 ((uint16_t)0x0400) /* Port output data, bit 10 */ -#define GPIO_OUTDR_ODR11 ((uint16_t)0x0800) /* Port output data, bit 11 */ -#define GPIO_OUTDR_ODR12 ((uint16_t)0x1000) /* Port output data, bit 12 */ -#define GPIO_OUTDR_ODR13 ((uint16_t)0x2000) /* Port output data, bit 13 */ -#define GPIO_OUTDR_ODR14 ((uint16_t)0x4000) /* Port output data, bit 14 */ -#define GPIO_OUTDR_ODR15 ((uint16_t)0x8000) /* Port output data, bit 15 */ - -/****************** Bit definition for GPIO_BSHR register *******************/ -#define GPIO_BSHR_BS0 ((uint32_t)0x00000001) /* Port x Set bit 0 */ -#define GPIO_BSHR_BS1 ((uint32_t)0x00000002) /* Port x Set bit 1 */ -#define GPIO_BSHR_BS2 ((uint32_t)0x00000004) /* Port x Set bit 2 */ -#define GPIO_BSHR_BS3 ((uint32_t)0x00000008) /* Port x Set bit 3 */ -#define GPIO_BSHR_BS4 ((uint32_t)0x00000010) /* Port x Set bit 4 */ -#define GPIO_BSHR_BS5 ((uint32_t)0x00000020) /* Port x Set bit 5 */ -#define GPIO_BSHR_BS6 ((uint32_t)0x00000040) /* Port x Set bit 6 */ -#define GPIO_BSHR_BS7 ((uint32_t)0x00000080) /* Port x Set bit 7 */ -#define GPIO_BSHR_BS8 ((uint32_t)0x00000100) /* Port x Set bit 8 */ -#define GPIO_BSHR_BS9 ((uint32_t)0x00000200) /* Port x Set bit 9 */ -#define GPIO_BSHR_BS10 ((uint32_t)0x00000400) /* Port x Set bit 10 */ -#define GPIO_BSHR_BS11 ((uint32_t)0x00000800) /* Port x Set bit 11 */ -#define GPIO_BSHR_BS12 ((uint32_t)0x00001000) /* Port x Set bit 12 */ -#define GPIO_BSHR_BS13 ((uint32_t)0x00002000) /* Port x Set bit 13 */ -#define GPIO_BSHR_BS14 ((uint32_t)0x00004000) /* Port x Set bit 14 */ -#define GPIO_BSHR_BS15 ((uint32_t)0x00008000) /* Port x Set bit 15 */ - -#define GPIO_BSHR_BR0 ((uint32_t)0x00010000) /* Port x Reset bit 0 */ -#define GPIO_BSHR_BR1 ((uint32_t)0x00020000) /* Port x Reset bit 1 */ -#define GPIO_BSHR_BR2 ((uint32_t)0x00040000) /* Port x Reset bit 2 */ -#define GPIO_BSHR_BR3 ((uint32_t)0x00080000) /* Port x Reset bit 3 */ -#define GPIO_BSHR_BR4 ((uint32_t)0x00100000) /* Port x Reset bit 4 */ -#define GPIO_BSHR_BR5 ((uint32_t)0x00200000) /* Port x Reset bit 5 */ -#define GPIO_BSHR_BR6 ((uint32_t)0x00400000) /* Port x Reset bit 6 */ -#define GPIO_BSHR_BR7 ((uint32_t)0x00800000) /* Port x Reset bit 7 */ -#define GPIO_BSHR_BR8 ((uint32_t)0x01000000) /* Port x Reset bit 8 */ -#define GPIO_BSHR_BR9 ((uint32_t)0x02000000) /* Port x Reset bit 9 */ -#define GPIO_BSHR_BR10 ((uint32_t)0x04000000) /* Port x Reset bit 10 */ -#define GPIO_BSHR_BR11 ((uint32_t)0x08000000) /* Port x Reset bit 11 */ -#define GPIO_BSHR_BR12 ((uint32_t)0x10000000) /* Port x Reset bit 12 */ -#define GPIO_BSHR_BR13 ((uint32_t)0x20000000) /* Port x Reset bit 13 */ -#define GPIO_BSHR_BR14 ((uint32_t)0x40000000) /* Port x Reset bit 14 */ -#define GPIO_BSHR_BR15 ((uint32_t)0x80000000) /* Port x Reset bit 15 */ - -/******************* Bit definition for GPIO_BCR register *******************/ -#define GPIO_BCR_BR0 ((uint16_t)0x0001) /* Port x Reset bit 0 */ -#define GPIO_BCR_BR1 ((uint16_t)0x0002) /* Port x Reset bit 1 */ -#define GPIO_BCR_BR2 ((uint16_t)0x0004) /* Port x Reset bit 2 */ -#define GPIO_BCR_BR3 ((uint16_t)0x0008) /* Port x Reset bit 3 */ -#define GPIO_BCR_BR4 ((uint16_t)0x0010) /* Port x Reset bit 4 */ -#define GPIO_BCR_BR5 ((uint16_t)0x0020) /* Port x Reset bit 5 */ -#define GPIO_BCR_BR6 ((uint16_t)0x0040) /* Port x Reset bit 6 */ -#define GPIO_BCR_BR7 ((uint16_t)0x0080) /* Port x Reset bit 7 */ -#define GPIO_BCR_BR8 ((uint16_t)0x0100) /* Port x Reset bit 8 */ -#define GPIO_BCR_BR9 ((uint16_t)0x0200) /* Port x Reset bit 9 */ -#define GPIO_BCR_BR10 ((uint16_t)0x0400) /* Port x Reset bit 10 */ -#define GPIO_BCR_BR11 ((uint16_t)0x0800) /* Port x Reset bit 11 */ -#define GPIO_BCR_BR12 ((uint16_t)0x1000) /* Port x Reset bit 12 */ -#define GPIO_BCR_BR13 ((uint16_t)0x2000) /* Port x Reset bit 13 */ -#define GPIO_BCR_BR14 ((uint16_t)0x4000) /* Port x Reset bit 14 */ -#define GPIO_BCR_BR15 ((uint16_t)0x8000) /* Port x Reset bit 15 */ - -/****************** Bit definition for GPIO_LCKR register *******************/ -#define GPIO_LCK0 ((uint32_t)0x00000001) /* Port x Lock bit 0 */ -#define GPIO_LCK1 ((uint32_t)0x00000002) /* Port x Lock bit 1 */ -#define GPIO_LCK2 ((uint32_t)0x00000004) /* Port x Lock bit 2 */ -#define GPIO_LCK3 ((uint32_t)0x00000008) /* Port x Lock bit 3 */ -#define GPIO_LCK4 ((uint32_t)0x00000010) /* Port x Lock bit 4 */ -#define GPIO_LCK5 ((uint32_t)0x00000020) /* Port x Lock bit 5 */ -#define GPIO_LCK6 ((uint32_t)0x00000040) /* Port x Lock bit 6 */ -#define GPIO_LCK7 ((uint32_t)0x00000080) /* Port x Lock bit 7 */ -#define GPIO_LCK8 ((uint32_t)0x00000100) /* Port x Lock bit 8 */ -#define GPIO_LCK9 ((uint32_t)0x00000200) /* Port x Lock bit 9 */ -#define GPIO_LCK10 ((uint32_t)0x00000400) /* Port x Lock bit 10 */ -#define GPIO_LCK11 ((uint32_t)0x00000800) /* Port x Lock bit 11 */ -#define GPIO_LCK12 ((uint32_t)0x00001000) /* Port x Lock bit 12 */ -#define GPIO_LCK13 ((uint32_t)0x00002000) /* Port x Lock bit 13 */ -#define GPIO_LCK14 ((uint32_t)0x00004000) /* Port x Lock bit 14 */ -#define GPIO_LCK15 ((uint32_t)0x00008000) /* Port x Lock bit 15 */ -#define GPIO_LCKK ((uint32_t)0x00010000) /* Lock key */ - -/****************** Bit definition for AFIO_PCFR1register *******************/ -#define AFIO_PCFR1_SPI1_REMAP ((uint32_t)0x00000001) /* SPI1 remapping */ -#define AFIO_PCFR1_I2C1_REMAP ((uint32_t)0x00000002) /* I2C1 remapping */ -#define AFIO_PCFR1_USART1_REMAP ((uint32_t)0x00000004) /* USART1 remapping */ -#define AFIO_PCFR1_USART1_REMAP_1 ((uint32_t)0x00200000) /* USART1 remapping higher bit */ -#define AFIO_PCFR1_USART2_REMAP ((uint32_t)0x00000008) /* USART2 remapping */ - -#define AFIO_PCFR1_USART3_REMAP ((uint32_t)0x00000030) /* USART3_REMAP[1:0] bits (USART3 remapping) */ -#define AFIO_PCFR1_USART3_REMAP_0 ((uint32_t)0x00000010) /* Bit 0 */ -#define AFIO_PCFR1_USART3_REMAP_1 ((uint32_t)0x00000020) /* Bit 1 */ - -#define AFIO_PCFR1_USART3_REMAP_NOREMAP ((uint32_t)0x00000000) /* No remap (TX/PB10, RX/PB11, CK/PB12, CTS/PB13, RTS/PB14) */ -#define AFIO_PCFR1_USART3_REMAP_PARTIALREMAP ((uint32_t)0x00000010) /* Partial remap (TX/PC10, RX/PC11, CK/PC12, CTS/PB13, RTS/PB14) */ -#define AFIO_PCFR1_USART3_REMAP_FULLREMAP ((uint32_t)0x00000030) /* Full remap (TX/PD8, RX/PD9, CK/PD10, CTS/PD11, RTS/PD12) */ - -#define AFIO_PCFR1_TIM1_REMAP ((uint32_t)0x000000C0) /* TIM1_REMAP[1:0] bits (TIM1 remapping) */ -#define AFIO_PCFR1_TIM1_REMAP_0 ((uint32_t)0x00000040) /* Bit 0 */ -#define AFIO_PCFR1_TIM1_REMAP_1 ((uint32_t)0x00000080) /* Bit 1 */ - -#define AFIO_PCFR1_TIM1_REMAP_NOREMAP ((uint32_t)0x00000000) /* No remap (ETR/PA12, CH1/PA8, CH2/PA9, CH3/PA10, CH4/PA11, BKIN/PB12, CH1N/PB13, CH2N/PB14, CH3N/PB15) */ -#define AFIO_PCFR1_TIM1_REMAP_PARTIALREMAP1 ((uint32_t)0x00000040) /* Partial remap (ETR/PA12, CH1/PA8, CH2/PA9, CH3/PA10, CH4/PA11, BKIN/PA6, CH1N/PA7, CH2N/PB0, CH3N/PB1) */ -#define AFIO_PCFR1_TIM1_REMAP_PARTIALREMAP AFIO_PCFR1_TIM1_REMAP_PARTIALREMAP1 /* legacy compatibility */ -#define AFIO_PCFR1_TIM1_REMAP_PARTIALREMAP2 ((uint32_t)0x00000080) /* Partial remap (ETR/PD4, CH1/PD2, CH2/PA1, CH3/PC3, CH4/PC4, BKIN/PC2, CH1N/PD0, CN2N/PA2, CH3N/PD1) */ -#define AFIO_PCFR1_TIM1_REMAP_FULLREMAP ((uint32_t)0x000000C0) /* Full remap (ETR/PE7, CH1/PE9, CH2/PE11, CH3/PE13, CH4/PE14, BKIN/PE15, CH1N/PE8, CH2N/PE10, CH3N/PE12) */ - -#define AFIO_PCFR1_TIM2_REMAP ((uint32_t)0x00000300) /* TIM2_REMAP[1:0] bits (TIM2 remapping) */ -#define AFIO_PCFR1_TIM2_REMAP_0 ((uint32_t)0x00000100) /* Bit 0 */ -#define AFIO_PCFR1_TIM2_REMAP_1 ((uint32_t)0x00000200) /* Bit 1 */ - -#define AFIO_PCFR1_TIM2_REMAP_NOREMAP ((uint32_t)0x00000000) /* No remap (CH1/ETR/PA0, CH2/PA1, CH3/PA2, CH4/PA3) */ -#define AFIO_PCFR1_TIM2_REMAP_PARTIALREMAP1 ((uint32_t)0x00000100) /* Partial remap (CH1/ETR/PA15, CH2/PB3, CH3/PA2, CH4/PA3) */ -#define AFIO_PCFR1_TIM2_REMAP_PARTIALREMAP2 ((uint32_t)0x00000200) /* Partial remap (CH1/ETR/PA0, CH2/PA1, CH3/PB10, CH4/PB11) */ -#define AFIO_PCFR1_TIM2_REMAP_FULLREMAP ((uint32_t)0x00000300) /* Full remap (CH1/ETR/PA15, CH2/PB3, CH3/PB10, CH4/PB11) */ - -#define AFIO_PCFR1_TIM3_REMAP ((uint32_t)0x00000C00) /* TIM3_REMAP[1:0] bits (TIM3 remapping) */ -#define AFIO_PCFR1_TIM3_REMAP_0 ((uint32_t)0x00000400) /* Bit 0 */ -#define AFIO_PCFR1_TIM3_REMAP_1 ((uint32_t)0x00000800) /* Bit 1 */ - -#define AFIO_PCFR1_TIM3_REMAP_NOREMAP ((uint32_t)0x00000000) /* No remap (CH1/PA6, CH2/PA7, CH3/PB0, CH4/PB1) */ -#define AFIO_PCFR1_TIM3_REMAP_PARTIALREMAP ((uint32_t)0x00000800) /* Partial remap (CH1/PB4, CH2/PB5, CH3/PB0, CH4/PB1) */ -#define AFIO_PCFR1_TIM3_REMAP_FULLREMAP ((uint32_t)0x00000C00) /* Full remap (CH1/PC6, CH2/PC7, CH3/PC8, CH4/PC9) */ - -#define AFIO_PCFR1_TIM4_REMAP ((uint32_t)0x00001000) /* TIM4_REMAP bit (TIM4 remapping) */ - -#define AFIO_PCFR1_CAN_REMAP ((uint32_t)0x00006000) /* CAN_REMAP[1:0] bits (CAN Alternate function remapping) */ -#define AFIO_PCFR1_CAN_REMAP_0 ((uint32_t)0x00002000) /* Bit 0 */ -#define AFIO_PCFR1_CAN_REMAP_1 ((uint32_t)0x00004000) /* Bit 1 */ - -#define AFIO_PCFR1_CAN_REMAP_REMAP1 ((uint32_t)0x00000000) /* CANRX mapped to PA11, CANTX mapped to PA12 */ -#define AFIO_PCFR1_CAN_REMAP_REMAP2 ((uint32_t)0x00004000) /* CANRX mapped to PB8, CANTX mapped to PB9 */ -#define AFIO_PCFR1_CAN_REMAP_REMAP3 ((uint32_t)0x00006000) /* CANRX mapped to PD0, CANTX mapped to PD1 */ - -#define AFIO_PCFR1_PA12_REMAP ((uint32_t)0x00008000) /* Port D0/Port D1 mapping on OSC_IN/OSC_OUT */ -#define AFIO_PCFR1_TIM5CH4_IREMAP ((uint32_t)0x00010000) /* TIM5 Channel4 Internal Remap */ -#define AFIO_PCFR1_ADC1_ETRGINJ_REMAP ((uint32_t)0x00020000) /* ADC 1 External Trigger Injected Conversion remapping */ -#define AFIO_PCFR1_ADC1_ETRGREG_REMAP ((uint32_t)0x00040000) /* ADC 1 External Trigger Regular Conversion remapping */ -#define AFIO_PCFR1_ADC2_ETRGINJ_REMAP ((uint32_t)0x00080000) /* ADC 2 External Trigger Injected Conversion remapping */ -#define AFIO_PCFR1_ADC2_ETRGREG_REMAP ((uint32_t)0x00100000) /* ADC 2 External Trigger Regular Conversion remapping */ - -#define AFIO_PCFR1_USART1_HIGH_BIT_REMAP ((uint32_t)0x00200000) -#define AFIO_PCFR1_I2C1_HIGH_BIT_REMAP ((uint32_t)0x00400000) -#define AFIO_PCFR1_TIM1_1_RM ((uint32_t)0x00800000) - -#define AFIO_PCFR1_SWJ_CFG ((uint32_t)0x07000000) /* SWJ_CFG[2:0] bits (Serial Wire JTAG configuration) */ -#define AFIO_PCFR1_SWJ_CFG_0 ((uint32_t)0x01000000) /* Bit 0 */ -#define AFIO_PCFR1_SWJ_CFG_1 ((uint32_t)0x02000000) /* Bit 1 */ -#define AFIO_PCFR1_SWJ_CFG_2 ((uint32_t)0x04000000) /* Bit 2 */ - -#define AFIO_PCFR1_SWJ_CFG_RESET ((uint32_t)0x00000000) /* Full SWJ (JTAG-DP + SW-DP) : Reset State */ -#define AFIO_PCFR1_SWJ_CFG_NOJNTRST ((uint32_t)0x01000000) /* Full SWJ (JTAG-DP + SW-DP) but without JNTRST */ -#define AFIO_PCFR1_SWJ_CFG_JTAGDISABLE ((uint32_t)0x02000000) /* JTAG-DP Disabled and SW-DP Enabled */ -#define AFIO_PCFR1_SWJ_CFG_DISABLE ((uint32_t)0x04000000) /* JTAG-DP Disabled and SW-DP Disabled */ - -/***************** Bit definition for AFIO_EXTICR register *****************/ -#define AFIO_EXTICR_EXTI0 ((uint16_t)0x0003) /* EXTI 0 configuration */ -#define AFIO_EXTICR_EXTI1 ((uint16_t)0x000C) /* EXTI 1 configuration */ -#define AFIO_EXTICR_EXTI2 ((uint16_t)0x0030) /* EXTI 2 configuration */ -#define AFIO_EXTICR_EXTI3 ((uint16_t)0x00C0) /* EXTI 3 configuration */ -#define AFIO_EXTICR_EXTI4 ((uint16_t)0x0300) /* EXTI 4 configuration */ -#define AFIO_EXTICR_EXTI5 ((uint16_t)0x0C00) /* EXTI 5 configuration */ -#define AFIO_EXTICR_EXTI6 ((uint16_t)0x3000) /* EXTI 6 configuration */ -#define AFIO_EXTICR_EXTI7 ((uint16_t)0xC000) /* EXTI 7 configuration */ - -#define AFIO_EXTICR_EXTI0_PC ((uint16_t)0x0002) /* PC[0] pin */ -#define AFIO_EXTICR_EXTI0_PD ((uint16_t)0x0003) /* PD[0] pin */ -#define AFIO_EXTICR_EXTI1_PA ((uint16_t)0x0000) /* PA[1] pin */ -#define AFIO_EXTICR_EXTI1_PC ((uint16_t)0x0008) /* PC[1] pin */ -#define AFIO_EXTICR_EXTI1_PD ((uint16_t)0x000C) /* PD[1] pin */ -#define AFIO_EXTICR_EXTI2_PA ((uint16_t)0x0000) /* PA[2] pin */ -#define AFIO_EXTICR_EXTI2_PC ((uint16_t)0x0020) /* PC[2] pin */ -#define AFIO_EXTICR_EXTI2_PD ((uint16_t)0x0030) /* PD[2] pin */ -#define AFIO_EXTICR_EXTI3_PC ((uint16_t)0x0080) /* PC[3] pin */ -#define AFIO_EXTICR_EXTI3_PD ((uint16_t)0x00C0) /* PD[3] pin */ -#define AFIO_EXTICR_EXTI4_PC ((uint16_t)0x0200) /* PC[4] pin */ -#define AFIO_EXTICR_EXTI4_PD ((uint16_t)0x0300) /* PD[4] pin */ -#define AFIO_EXTICR_EXTI5_PC ((uint16_t)0x0800) /* PC[5] pin */ -#define AFIO_EXTICR_EXTI5_PD ((uint16_t)0x0C00) /* PD[5] pin */ -#define AFIO_EXTICR_EXTI6_PC ((uint16_t)0x2000) /* PC[6] pin */ -#define AFIO_EXTICR_EXTI6_PD ((uint16_t)0x3000) /* PD[6] pin */ -#define AFIO_EXTICR_EXTI7_PC ((uint16_t)0x8000) /* PC[7] pin */ -#define AFIO_EXTICR_EXTI7_PD ((uint16_t)0xC000) /* PD[7] pin */ - -/******************************************************************************/ -/* Independent WATCHDOG */ -/******************************************************************************/ - -/******************* Bit definition for IWDG_CTLR register ********************/ -#define IWDG_KEY ((uint16_t)0xFFFF) /* Key value (write only, read 0000h) */ - -/******************* Bit definition for IWDG_PSCR register ********************/ -#define IWDG_PR ((uint8_t)0x07) /* PR[2:0] (Prescaler divider) */ -#define IWDG_PR_0 ((uint8_t)0x01) /* Bit 0 */ -#define IWDG_PR_1 ((uint8_t)0x02) /* Bit 1 */ -#define IWDG_PR_2 ((uint8_t)0x04) /* Bit 2 */ - -/******************* Bit definition for IWDG_RLDR register *******************/ -#define IWDG_RL ((uint16_t)0x0FFF) /* Watchdog counter reload value */ - -/******************* Bit definition for IWDG_STATR register ********************/ -#define IWDG_PVU ((uint8_t)0x01) /* Watchdog prescaler value update */ -#define IWDG_RVU ((uint8_t)0x02) /* Watchdog counter reload value update */ - -/******************************************************************************/ -/* Inter-integrated Circuit Interface */ -/******************************************************************************/ - -/******************* Bit definition for I2C_CTLR1 register ********************/ -#define I2C_CTLR1_PE ((uint16_t)0x0001) /* Peripheral Enable */ -#define I2C_CTLR1_SMBUS ((uint16_t)0x0002) /* SMBus Mode */ -#define I2C_CTLR1_SMBTYPE ((uint16_t)0x0008) /* SMBus Type */ -#define I2C_CTLR1_ENARP ((uint16_t)0x0010) /* ARP Enable */ -#define I2C_CTLR1_ENPEC ((uint16_t)0x0020) /* PEC Enable */ -#define I2C_CTLR1_ENGC ((uint16_t)0x0040) /* General Call Enable */ -#define I2C_CTLR1_NOSTRETCH ((uint16_t)0x0080) /* Clock Stretching Disable (Slave mode) */ -#define I2C_CTLR1_START ((uint16_t)0x0100) /* Start Generation */ -#define I2C_CTLR1_STOP ((uint16_t)0x0200) /* Stop Generation */ -#define I2C_CTLR1_ACK ((uint16_t)0x0400) /* Acknowledge Enable */ -#define I2C_CTLR1_POS ((uint16_t)0x0800) /* Acknowledge/PEC Position (for data reception) */ -#define I2C_CTLR1_PEC ((uint16_t)0x1000) /* Packet Error Checking */ -#define I2C_CTLR1_ALERT ((uint16_t)0x2000) /* SMBus Alert */ -#define I2C_CTLR1_SWRST ((uint16_t)0x8000) /* Software Reset */ - -/******************* Bit definition for I2C_CTLR2 register ********************/ -#define I2C_CTLR2_FREQ ((uint16_t)0x003F) /* FREQ[5:0] bits (Peripheral Clock Frequency) */ -#define I2C_CTLR2_FREQ_0 ((uint16_t)0x0001) /* Bit 0 */ -#define I2C_CTLR2_FREQ_1 ((uint16_t)0x0002) /* Bit 1 */ -#define I2C_CTLR2_FREQ_2 ((uint16_t)0x0004) /* Bit 2 */ -#define I2C_CTLR2_FREQ_3 ((uint16_t)0x0008) /* Bit 3 */ -#define I2C_CTLR2_FREQ_4 ((uint16_t)0x0010) /* Bit 4 */ -#define I2C_CTLR2_FREQ_5 ((uint16_t)0x0020) /* Bit 5 */ - -#define I2C_CTLR2_ITERREN ((uint16_t)0x0100) /* Error Interrupt Enable */ -#define I2C_CTLR2_ITEVTEN ((uint16_t)0x0200) /* Event Interrupt Enable */ -#define I2C_CTLR2_ITBUFEN ((uint16_t)0x0400) /* Buffer Interrupt Enable */ -#define I2C_CTLR2_DMAEN ((uint16_t)0x0800) /* DMA Requests Enable */ -#define I2C_CTLR2_LAST ((uint16_t)0x1000) /* DMA Last Transfer */ - -/******************* Bit definition for I2C_OADDR1 register *******************/ -#define I2C_OADDR1_ADD1_7 ((uint16_t)0x00FE) /* Interface Address */ -#define I2C_OADDR1_ADD8_9 ((uint16_t)0x0300) /* Interface Address */ - -#define I2C_OADDR1_ADD0 ((uint16_t)0x0001) /* Bit 0 */ -#define I2C_OADDR1_ADD1 ((uint16_t)0x0002) /* Bit 1 */ -#define I2C_OADDR1_ADD2 ((uint16_t)0x0004) /* Bit 2 */ -#define I2C_OADDR1_ADD3 ((uint16_t)0x0008) /* Bit 3 */ -#define I2C_OADDR1_ADD4 ((uint16_t)0x0010) /* Bit 4 */ -#define I2C_OADDR1_ADD5 ((uint16_t)0x0020) /* Bit 5 */ -#define I2C_OADDR1_ADD6 ((uint16_t)0x0040) /* Bit 6 */ -#define I2C_OADDR1_ADD7 ((uint16_t)0x0080) /* Bit 7 */ -#define I2C_OADDR1_ADD8 ((uint16_t)0x0100) /* Bit 8 */ -#define I2C_OADDR1_ADD9 ((uint16_t)0x0200) /* Bit 9 */ - -#define I2C_OADDR1_ADDMODE ((uint16_t)0x8000) /* Addressing Mode (Slave mode) */ - -/******************* Bit definition for I2C_OADDR2 register *******************/ -#define I2C_OADDR2_ENDUAL ((uint8_t)0x01) /* Dual addressing mode enable */ -#define I2C_OADDR2_ADD2 ((uint8_t)0xFE) /* Interface address */ - -/******************** Bit definition for I2C_DATAR register ********************/ -#define I2C_DR_DATAR ((uint8_t)0xFF) /* 8-bit Data Register */ - -/******************* Bit definition for I2C_STAR1 register ********************/ -#define I2C_STAR1_SB ((uint16_t)0x0001) /* Start Bit (Master mode) */ -#define I2C_STAR1_ADDR ((uint16_t)0x0002) /* Address sent (master mode)/matched (slave mode) */ -#define I2C_STAR1_BTF ((uint16_t)0x0004) /* Byte Transfer Finished */ -#define I2C_STAR1_ADD10 ((uint16_t)0x0008) /* 10-bit header sent (Master mode) */ -#define I2C_STAR1_STOPF ((uint16_t)0x0010) /* Stop detection (Slave mode) */ -#define I2C_STAR1_RXNE ((uint16_t)0x0040) /* Data Register not Empty (receivers) */ -#define I2C_STAR1_TXE ((uint16_t)0x0080) /* Data Register Empty (transmitters) */ -#define I2C_STAR1_BERR ((uint16_t)0x0100) /* Bus Error */ -#define I2C_STAR1_ARLO ((uint16_t)0x0200) /* Arbitration Lost (master mode) */ -#define I2C_STAR1_AF ((uint16_t)0x0400) /* Acknowledge Failure */ -#define I2C_STAR1_OVR ((uint16_t)0x0800) /* Overrun/Underrun */ -#define I2C_STAR1_PECERR ((uint16_t)0x1000) /* PEC Error in reception */ -#define I2C_STAR1_TIMEOUT ((uint16_t)0x4000) /* Timeout or Tlow Error */ -#define I2C_STAR1_SMBALERT ((uint16_t)0x8000) /* SMBus Alert */ - -/******************* Bit definition for I2C_STAR2 register ********************/ -#define I2C_STAR2_MSL ((uint16_t)0x0001) /* Master/Slave */ -#define I2C_STAR2_BUSY ((uint16_t)0x0002) /* Bus Busy */ -#define I2C_STAR2_TRA ((uint16_t)0x0004) /* Transmitter/Receiver */ -#define I2C_STAR2_GENCALL ((uint16_t)0x0010) /* General Call Address (Slave mode) */ -#define I2C_STAR2_SMBDEFAULT ((uint16_t)0x0020) /* SMBus Device Default Address (Slave mode) */ -#define I2C_STAR2_SMBHOST ((uint16_t)0x0040) /* SMBus Host Header (Slave mode) */ -#define I2C_STAR2_DUALF ((uint16_t)0x0080) /* Dual Flag (Slave mode) */ -#define I2C_STAR2_PEC ((uint16_t)0xFF00) /* Packet Error Checking Register */ - -/******************* Bit definition for I2C_CKCFGR register ********************/ -#define I2C_CKCFGR_CCR ((uint16_t)0x0FFF) /* Clock Control Register in Fast/Standard mode (Master mode) */ -#define I2C_CKCFGR_DUTY ((uint16_t)0x4000) /* Fast Mode Duty Cycle */ -#define I2C_CKCFGR_FS ((uint16_t)0x8000) /* I2C Master Mode Selection */ - -/******************************************************************************/ -/* Power Control */ -/******************************************************************************/ - -/******************** Bit definition for PWR_CTLR register ********************/ -#define PWR_CTLR_LPDS ((uint16_t)0x0001) /* Low-Power Deepsleep */ -#define PWR_CTLR_PDDS ((uint16_t)0x0002) /* Power Down Deepsleep */ -#define PWR_CTLR_CWUF ((uint16_t)0x0004) /* Clear Wakeup Flag */ -#define PWR_CTLR_CSBF ((uint16_t)0x0008) /* Clear Standby Flag */ -#define PWR_CTLR_PVDE ((uint16_t)0x0010) /* Power Voltage Detector Enable */ - -#define PWR_CTLR_PLS ((uint16_t)0x00E0) /* PLS[2:0] bits (PVD Level Selection) */ -#define PWR_CTLR_PLS_0 ((uint16_t)0x0020) /* Bit 0 */ -#define PWR_CTLR_PLS_1 ((uint16_t)0x0040) /* Bit 1 */ -#define PWR_CTLR_PLS_2 ((uint16_t)0x0080) /* Bit 2 */ - -#define PWR_PVDLevel_0 ((uint16_t)0x0000) -#define PWR_PVDLevel_1 ((uint16_t)0x0020) -#define PWR_PVDLevel_2 ((uint16_t)0x0040) -#define PWR_PVDLevel_3 ((uint16_t)0x0060) -#define PWR_PVDLevel_4 ((uint16_t)0x0080) -#define PWR_PVDLevel_5 ((uint16_t)0x00A0) -#define PWR_PVDLevel_6 ((uint16_t)0x00C0) -#define PWR_PVDLevel_7 ((uint16_t)0x00E0) - -#define PWR_CTLR_DBP ((uint16_t)0x0100) /* Disable Backup Domain write protection */ - -/******************* Bit definition for PWR_CSR register ********************/ -#define PWR_CSR_WUF ((uint16_t)0x0001) /* Wakeup Flag */ -#define PWR_CSR_SBF ((uint16_t)0x0002) /* Standby Flag */ -#define PWR_CSR_PVDO ((uint16_t)0x0004) /* PVD Output */ -#define PWR_CSR_EWUP ((uint16_t)0x0100) /* Enable WKUP pin */ - -/******************* Bit definition for PWR_AWUCSR register ********************/ -#define PWR_AWUCSR_AWUEN ((uint16_t)0x0002) - -/******************* Bit definition for PWR_AWUWR register ********************/ -#define PWR_AWUWR ((uint16_t)0x003F) - -/******************* Bit definition for PWR_AWUWR register ********************/ -#define PWR_AWUPSC ((uint16_t)0x000F) -#define PWR_AWUPSC_0 ((uint16_t)0x0000) -#define PWR_AWUPSC_2 ((uint16_t)0x0002) -#define PWR_AWUPSC_4 ((uint16_t)0x0003) -#define PWR_AWUPSC_8 ((uint16_t)0x0004) -#define PWR_AWUPSC_16 ((uint16_t)0x0005) -#define PWR_AWUPSC_32 ((uint16_t)0x0006) -#define PWR_AWUPSC_64 ((uint16_t)0x0007) -#define PWR_AWUPSC_128 ((uint16_t)0x0008) -#define PWR_AWUPSC_256 ((uint16_t)0x0009) -#define PWR_AWUPSC_512 ((uint16_t)0x000A) -#define PWR_AWUPSC_1024 ((uint16_t)0x000B) -#define PWR_AWUPSC_2048 ((uint16_t)0x000C) -#define PWR_AWUPSC_4096 ((uint16_t)0x000D) -#define PWR_AWUPSC_10240 ((uint16_t)0x000E) -#define PWR_AWUPSC_61440 ((uint16_t)0x000F) - -/******************************************************************************/ -/* Reset and Clock Control */ -/******************************************************************************/ - -/******************** Bit definition for RCC_CTLR register ********************/ -#define RCC_HSION ((uint32_t)0x00000001) /* Internal High Speed clock enable */ -#define RCC_HSIRDY ((uint32_t)0x00000002) /* Internal High Speed clock ready flag */ -#define RCC_HSITRIM ((uint32_t)0x000000F8) /* Internal High Speed clock trimming */ -#define RCC_HSICAL ((uint32_t)0x0000FF00) /* Internal High Speed clock Calibration */ -#define RCC_HSEON ((uint32_t)0x00010000) /* External High Speed clock enable */ -#define RCC_HSERDY ((uint32_t)0x00020000) /* External High Speed clock ready flag */ -#define RCC_HSEBYP ((uint32_t)0x00040000) /* External High Speed clock Bypass */ -#define RCC_CSSON ((uint32_t)0x00080000) /* Clock Security System enable */ -#define RCC_PLLON ((uint32_t)0x01000000) /* PLL enable */ -#define RCC_PLLRDY ((uint32_t)0x02000000) /* PLL clock ready flag */ - -/******************* Bit definition for RCC_CFGR0 register *******************/ -#define RCC_SW ((uint32_t)0x00000003) /* SW[1:0] bits (System clock Switch) */ -#define RCC_SW_0 ((uint32_t)0x00000001) /* Bit 0 */ -#define RCC_SW_1 ((uint32_t)0x00000002) /* Bit 1 */ - -#define RCC_SW_HSI ((uint32_t)0x00000000) /* HSI selected as system clock */ -#define RCC_SW_HSE ((uint32_t)0x00000001) /* HSE selected as system clock */ -#define RCC_SW_PLL ((uint32_t)0x00000002) /* PLL selected as system clock */ - -#define RCC_SWS ((uint32_t)0x0000000C) /* SWS[1:0] bits (System Clock Switch Status) */ -#define RCC_SWS_0 ((uint32_t)0x00000004) /* Bit 0 */ -#define RCC_SWS_1 ((uint32_t)0x00000008) /* Bit 1 */ - -#define RCC_SWS_HSI ((uint32_t)0x00000000) /* HSI oscillator used as system clock */ -#define RCC_SWS_HSE ((uint32_t)0x00000004) /* HSE oscillator used as system clock */ -#define RCC_SWS_PLL ((uint32_t)0x00000008) /* PLL used as system clock */ - -#define RCC_HPRE ((uint32_t)0x000000F0) /* HPRE[3:0] bits (AHB prescaler) */ -#define RCC_HPRE_0 ((uint32_t)0x00000010) /* Bit 0 */ -#define RCC_HPRE_1 ((uint32_t)0x00000020) /* Bit 1 */ -#define RCC_HPRE_2 ((uint32_t)0x00000040) /* Bit 2 */ -#define RCC_HPRE_3 ((uint32_t)0x00000080) /* Bit 3 */ - -#define RCC_HPRE_DIV1 ((uint32_t)0x00000000) /* SYSCLK not divided */ -#define RCC_HPRE_DIV2 ((uint32_t)0x00000010) /* SYSCLK divided by 2 */ -#define RCC_HPRE_DIV3 ((uint32_t)0x00000020) /* SYSCLK divided by 3 */ -#define RCC_HPRE_DIV4 ((uint32_t)0x00000030) /* SYSCLK divided by 4 */ -#define RCC_HPRE_DIV5 ((uint32_t)0x00000040) /* SYSCLK divided by 5 */ -#define RCC_HPRE_DIV6 ((uint32_t)0x00000050) /* SYSCLK divided by 6 */ -#define RCC_HPRE_DIV7 ((uint32_t)0x00000060) /* SYSCLK divided by 7 */ -#define RCC_HPRE_DIV8 ((uint32_t)0x00000070) /* SYSCLK divided by 8 */ -#define RCC_HPRE_DIV16 ((uint32_t)0x000000B0) /* SYSCLK divided by 16 */ -#define RCC_HPRE_DIV32 ((uint32_t)0x000000C0) /* SYSCLK divided by 32 */ -#define RCC_HPRE_DIV64 ((uint32_t)0x000000D0) /* SYSCLK divided by 64 */ -#define RCC_HPRE_DIV128 ((uint32_t)0x000000E0) /* SYSCLK divided by 128 */ -#define RCC_HPRE_DIV256 ((uint32_t)0x000000F0) /* SYSCLK divided by 256 */ - -#define RCC_ADCPRE ((uint32_t)0x0000F800) /* ADCPRE[4:0] bits (ADC prescaler) */ -#define RCC_ADCPRE_0 ((uint32_t)0x00000800) /* Bit 0 */ -#define RCC_ADCPRE_1 ((uint32_t)0x00001000) /* Bit 1 */ -#define RCC_ADCPRE_2 ((uint32_t)0x00002000) -#define RCC_ADCPRE_3 ((uint32_t)0x00004000) -#define RCC_ADCPRE_4 ((uint32_t)0x00008000) - -#define RCC_ADCPRE_DIV2 ((uint32_t)0x00000000) /* PCLK2 divided by 2 */ -#define RCC_ADCPRE_DIV4 ((uint32_t)0x00004000) /* PCLK2 divided by 4 */ -#define RCC_ADCPRE_DIV6 ((uint32_t)0x00008000) /* PCLK2 divided by 6 */ -#define RCC_ADCPRE_DIV8 ((uint32_t)0x0000C000) /* PCLK2 divided by 8 */ - -#define RCC_PLLSRC ((uint32_t)0x00010000) /* PLL entry clock source */ - -#define RCC_PLLXTPRE ((uint32_t)0x00020000) /* HSE divider for PLL entry */ - -#define RCC_PLLMULL ((uint32_t)0x003C0000) /* PLLMUL[3:0] bits (PLL multiplication factor) */ -#define RCC_PLLMULL_0 ((uint32_t)0x00040000) /* Bit 0 */ -#define RCC_PLLMULL_1 ((uint32_t)0x00080000) /* Bit 1 */ -#define RCC_PLLMULL_2 ((uint32_t)0x00100000) /* Bit 2 */ -#define RCC_PLLMULL_3 ((uint32_t)0x00200000) /* Bit 3 */ - -#define RCC_PLLSRC_HSI_Mul2 ((uint32_t)0x00000000) /* HSI clock*2 selected as PLL entry clock source */ -#define RCC_PLLSRC_HSE_Mul2 ((uint32_t)0x00010000) /* HSE clock*2 selected as PLL entry clock source */ - -#define RCC_PLLXTPRE_HSE ((uint32_t)0x00000000) /* HSE clock not divided for PLL entry */ -#define RCC_PLLXTPRE_HSE_Div2 ((uint32_t)0x00020000) /* HSE clock divided by 2 for PLL entry */ - -#define RCC_PLLMULL2 ((uint32_t)0x00000000) /* PLL input clock*2 */ -#define RCC_PLLMULL3 ((uint32_t)0x00040000) /* PLL input clock*3 */ -#define RCC_PLLMULL4 ((uint32_t)0x00080000) /* PLL input clock*4 */ -#define RCC_PLLMULL5 ((uint32_t)0x000C0000) /* PLL input clock*5 */ -#define RCC_PLLMULL6 ((uint32_t)0x00100000) /* PLL input clock*6 */ -#define RCC_PLLMULL7 ((uint32_t)0x00140000) /* PLL input clock*7 */ -#define RCC_PLLMULL8 ((uint32_t)0x00180000) /* PLL input clock*8 */ -#define RCC_PLLMULL9 ((uint32_t)0x001C0000) /* PLL input clock*9 */ -#define RCC_PLLMULL10 ((uint32_t)0x00200000) /* PLL input clock10 */ -#define RCC_PLLMULL11 ((uint32_t)0x00240000) /* PLL input clock*11 */ -#define RCC_PLLMULL12 ((uint32_t)0x00280000) /* PLL input clock*12 */ -#define RCC_PLLMULL13 ((uint32_t)0x002C0000) /* PLL input clock*13 */ -#define RCC_PLLMULL14 ((uint32_t)0x00300000) /* PLL input clock*14 */ -#define RCC_PLLMULL15 ((uint32_t)0x00340000) /* PLL input clock*15 */ -#define RCC_PLLMULL16 ((uint32_t)0x00380000) /* PLL input clock*16 */ - -#define RCC_USBPRE ((uint32_t)0x00400000) /* USB Device prescaler */ - -#define RCC_CFGR0_MCO ((uint32_t)0x07000000) /* MCO[2:0] bits (Microcontroller Clock Output) */ -#define RCC_MCO_0 ((uint32_t)0x01000000) /* Bit 0 */ -#define RCC_MCO_1 ((uint32_t)0x02000000) /* Bit 1 */ -#define RCC_MCO_2 ((uint32_t)0x04000000) /* Bit 2 */ - -#define RCC_MCO_NOCLOCK ((uint32_t)0x00000000) /* No clock */ -#define RCC_CFGR0_MCO_SYSCLK ((uint32_t)0x04000000) /* System clock selected as MCO source */ -#define RCC_CFGR0_MCO_HSI ((uint32_t)0x05000000) /* HSI clock selected as MCO source */ -#define RCC_CFGR0_MCO_HSE ((uint32_t)0x06000000) /* HSE clock selected as MCO source */ -#define RCC_CFGR0_MCO_PLL ((uint32_t)0x07000000) /* PLL clock divided by 2 selected as MCO source */ - -/******************* Bit definition for RCC_CFGR2 register *******************/ - -/******************* Bit definition for RCC_INTR register ********************/ -#define RCC_LSIRDYF ((uint32_t)0x00000001) /* LSI Ready Interrupt flag */ -#define RCC_LSERDYF ((uint32_t)0x00000002) /* LSE Ready Interrupt flag */ -#define RCC_HSIRDYF ((uint32_t)0x00000004) /* HSI Ready Interrupt flag */ -#define RCC_HSERDYF ((uint32_t)0x00000008) /* HSE Ready Interrupt flag */ -#define RCC_PLLRDYF ((uint32_t)0x00000010) /* PLL Ready Interrupt flag */ -#define RCC_CSSF ((uint32_t)0x00000080) /* Clock Security System Interrupt flag */ -#define RCC_LSIRDYIE ((uint32_t)0x00000100) /* LSI Ready Interrupt Enable */ -#define RCC_LSERDYIE ((uint32_t)0x00000200) /* LSE Ready Interrupt Enable */ -#define RCC_HSIRDYIE ((uint32_t)0x00000400) /* HSI Ready Interrupt Enable */ -#define RCC_HSERDYIE ((uint32_t)0x00000800) /* HSE Ready Interrupt Enable */ -#define RCC_PLLRDYIE ((uint32_t)0x00001000) /* PLL Ready Interrupt Enable */ -#define RCC_LSIRDYC ((uint32_t)0x00010000) /* LSI Ready Interrupt Clear */ -#define RCC_LSERDYC ((uint32_t)0x00020000) /* LSE Ready Interrupt Clear */ -#define RCC_HSIRDYC ((uint32_t)0x00040000) /* HSI Ready Interrupt Clear */ -#define RCC_HSERDYC ((uint32_t)0x00080000) /* HSE Ready Interrupt Clear */ -#define RCC_PLLRDYC ((uint32_t)0x00100000) /* PLL Ready Interrupt Clear */ -#define RCC_CSSC ((uint32_t)0x00800000) /* Clock Security System Interrupt Clear */ - -/***************** Bit definition for RCC_APB2PRSTR register *****************/ -#define RCC_AFIORST ((uint32_t)0x00000001) /* Alternate Function I/O reset */ -#define RCC_IOPARST ((uint32_t)0x00000004) /* I/O port A reset */ -#define RCC_IOPBRST ((uint32_t)0x00000008) /* I/O port B reset */ -#define RCC_IOPCRST ((uint32_t)0x00000010) /* I/O port C reset */ -#define RCC_IOPDRST ((uint32_t)0x00000020) /* I/O port D reset */ -#define RCC_ADC1RST ((uint32_t)0x00000200) /* ADC 1 interface reset */ - -#define RCC_ADC2RST ((uint32_t)0x00000400) /* ADC 2 interface reset */ - -#define RCC_TIM1RST ((uint32_t)0x00000800) /* TIM1 Timer reset */ -#define RCC_SPI1RST ((uint32_t)0x00001000) /* SPI 1 reset */ -#define RCC_USART1RST ((uint32_t)0x00004000) /* USART1 reset */ - -#define RCC_IOPERST ((uint32_t)0x00000040) /* I/O port E reset */ - -/***************** Bit definition for RCC_APB1PRSTR register *****************/ -#define RCC_TIM2RST ((uint32_t)0x00000001) /* Timer 2 reset */ -#define RCC_TIM3RST ((uint32_t)0x00000002) /* Timer 3 reset */ -#define RCC_WWDGRST ((uint32_t)0x00000800) /* Window Watchdog reset */ -#define RCC_USART2RST ((uint32_t)0x00020000) /* USART 2 reset */ -#define RCC_I2C1RST ((uint32_t)0x00200000) /* I2C 1 reset */ - -#define RCC_CAN1RST ((uint32_t)0x02000000) /* CAN1 reset */ - -#define RCC_BKPRST ((uint32_t)0x08000000) /* Backup interface reset */ -#define RCC_PWRRST ((uint32_t)0x10000000) /* Power interface reset */ - -#define RCC_TIM4RST ((uint32_t)0x00000004) /* Timer 4 reset */ -#define RCC_SPI2RST ((uint32_t)0x00004000) /* SPI 2 reset */ -#define RCC_USART3RST ((uint32_t)0x00040000) /* USART 3 reset */ -#define RCC_I2C2RST ((uint32_t)0x00400000) /* I2C 2 reset */ - -#define RCC_USBRST ((uint32_t)0x00800000) /* USB Device reset */ - -/****************** Bit definition for RCC_AHBPCENR register ******************/ -#define RCC_DMA1EN ((uint32_t)0x0001) /* DMA1 clock enable */ -#define RCC_SRAMEN ((uint32_t)0x0004) /* SRAM interface clock enable */ -#define RCC_FLITFEN ((uint32_t)0x0010) /* FLITF clock enable */ -#define RCC_CRCEN ((uint32_t)0x0040) /* CRC clock enable */ -#define RCC_USBHD ((uint32_t)0x1000) -#define RCC_USBFS ((uint32_t)0x1000) -#define RCC_USBPD ((uint32_t)0x20000) - -/****************** Bit definition for RCC_APB2PCENR register *****************/ -#define RCC_AFIOEN ((uint32_t)0x00000001) /* Alternate Function I/O clock enable */ -#define RCC_IOPAEN ((uint32_t)0x00000004) /* I/O port A clock enable */ -#define RCC_IOPBEN ((uint32_t)0x00000008) /* I/O port B clock enable */ -#define RCC_IOPCEN ((uint32_t)0x00000010) /* I/O port C clock enable */ -#define RCC_IOPDEN ((uint32_t)0x00000020) /* I/O port D clock enable */ -#define RCC_ADC1EN ((uint32_t)0x00000200) /* ADC 1 interface clock enable */ - -#define RCC_ADC2EN ((uint32_t)0x00000400) /* ADC 2 interface clock enable */ - -#define RCC_TIM1EN ((uint32_t)0x00000800) /* TIM1 Timer clock enable */ -#define RCC_SPI1EN ((uint32_t)0x00001000) /* SPI 1 clock enable */ -#define RCC_USART1EN ((uint32_t)0x00004000) /* USART1 clock enable */ - -/***************** Bit definition for RCC_APB1PCENR register ******************/ -#define RCC_TIM2EN ((uint32_t)0x00000001) /* Timer 2 clock enabled*/ -#define RCC_TIM3EN ((uint32_t)0x00000002) /* Timer 3 clock enable */ -#define RCC_WWDGEN ((uint32_t)0x00000800) /* Window Watchdog clock enable */ -#define RCC_USART2EN ((uint32_t)0x00020000) /* USART 2 clock enable */ -#define RCC_I2C1EN ((uint32_t)0x00200000) /* I2C 1 clock enable */ - -#define RCC_BKPEN ((uint32_t)0x08000000) /* Backup interface clock enable */ -#define RCC_PWREN ((uint32_t)0x10000000) /* Power interface clock enable */ - -#define RCC_USBEN ((uint32_t)0x00800000) /* USB Device clock enable */ - -/******************* Bit definition for RCC_RSTSCKR register ********************/ -#define RCC_LSION ((uint32_t)0x00000001) /* Internal Low Speed oscillator enable */ -#define RCC_LSIRDY ((uint32_t)0x00000002) /* Internal Low Speed oscillator Ready */ -#define RCC_RMVF ((uint32_t)0x01000000) /* Remove reset flag */ -#define RCC_PINRSTF ((uint32_t)0x04000000) /* PIN reset flag */ -#define RCC_PORRSTF ((uint32_t)0x08000000) /* POR/PDR reset flag */ -#define RCC_SFTRSTF ((uint32_t)0x10000000) /* Software Reset flag */ -#define RCC_IWDGRSTF ((uint32_t)0x20000000) /* Independent Watchdog reset flag */ -#define RCC_WWDGRSTF ((uint32_t)0x40000000) /* Window watchdog reset flag */ -#define RCC_LPWRRSTF ((uint32_t)0x80000000) /* Low-Power reset flag */ - -/****************** Bit definition for RCC_AHBRSTR register *****************/ - -/******************************************************************************/ -/* Serial Peripheral Interface */ -/******************************************************************************/ - -/******************* Bit definition for SPI_CTLR1 register ********************/ -#define SPI_CTLR1_CPHA ((uint16_t)0x0001) /* Clock Phase */ -#define SPI_CTLR1_CPOL ((uint16_t)0x0002) /* Clock Polarity */ -#define SPI_CTLR1_MSTR ((uint16_t)0x0004) /* Master Selection */ - -#define SPI_CTLR1_BR ((uint16_t)0x0038) /* BR[2:0] bits (Baud Rate Control) */ -#define SPI_CTLR1_BR_0 ((uint16_t)0x0008) /* Bit 0 */ -#define SPI_CTLR1_BR_1 ((uint16_t)0x0010) /* Bit 1 */ -#define SPI_CTLR1_BR_2 ((uint16_t)0x0020) /* Bit 2 */ - -#define SPI_CTLR1_SPE ((uint16_t)0x0040) /* SPI Enable */ -#define SPI_CTLR1_LSBFIRST ((uint16_t)0x0080) -#define SPI_CTLR1_SSI ((uint16_t)0x0100) /* Internal slave select */ -#define SPI_CTLR1_SSM ((uint16_t)0x0200) /* Software slave management */ -#define SPI_CTLR1_RXONLY ((uint16_t)0x0400) /* Receive only */ -#define SPI_CTLR1_DFF ((uint16_t)0x0800) /* Data Frame Format */ -#define SPI_CTLR1_CRCNEXT ((uint16_t)0x1000) /* Transmit CRC next */ -#define SPI_CTLR1_CRCEN ((uint16_t)0x2000) /* Hardware CRC calculation enable */ -#define SPI_CTLR1_BIDIOE ((uint16_t)0x4000) /* Output enable in bidirectional mode */ -#define SPI_CTLR1_BIDIMODE ((uint16_t)0x8000) /* Bidirectional data mode enable */ - -/******************* Bit definition for SPI_CTLR2 register ********************/ -#define SPI_CTLR2_RXDMAEN ((uint8_t)0x01) /* Rx Buffer DMA Enable */ -#define SPI_CTLR2_TXDMAEN ((uint8_t)0x02) /* Tx Buffer DMA Enable */ -#define SPI_CTLR2_SSOE ((uint8_t)0x04) /* SS Output Enable */ -#define SPI_CTLR2_ERRIE ((uint8_t)0x20) /* Error Interrupt Enable */ -#define SPI_CTLR2_RXNEIE ((uint8_t)0x40) /* RX buffer Not Empty Interrupt Enable */ -#define SPI_CTLR2_TXEIE ((uint8_t)0x80) /* Tx buffer Empty Interrupt Enable */ - -/******************** Bit definition for SPI_STATR register ********************/ -#define SPI_STATR_RXNE ((uint8_t)0x01) /* Receive buffer Not Empty */ -#define SPI_STATR_TXE ((uint8_t)0x02) /* Transmit buffer Empty */ -#define SPI_STATR_CHSIDE ((uint8_t)0x04) /* Channel side */ -#define SPI_STATR_UDR ((uint8_t)0x08) /* Underrun flag */ -#define SPI_STATR_CRCERR ((uint8_t)0x10) /* CRC Error flag */ -#define SPI_STATR_MODF ((uint8_t)0x20) /* Mode fault */ -#define SPI_STATR_OVR ((uint8_t)0x40) /* Overrun flag */ -#define SPI_STATR_BSY ((uint8_t)0x80) /* Busy flag */ - -/******************** Bit definition for SPI_DATAR register ********************/ -#define SPI_DATAR_DR ((uint16_t)0xFFFF) /* Data Register */ - -/******************* Bit definition for SPI_CRCR register ******************/ -#define SPI_CRCR_CRCPOLY ((uint16_t)0xFFFF) /* CRC polynomial register */ - -/****************** Bit definition for SPI_RCRCR register ******************/ -#define SPI_RCRCR_RXCRC ((uint16_t)0xFFFF) /* Rx CRC Register */ - -/****************** Bit definition for SPI_TCRCR register ******************/ -#define SPI_TCRCR_TXCRC ((uint16_t)0xFFFF) /* Tx CRC Register */ - -/****************** Bit definition for SPI_HSCR register ******************/ -#define SPI_HSCR_HSRXEN ((uint16_t)0x0001) - -/******************************************************************************/ -/* TIM */ -/******************************************************************************/ - -/******************* Bit definition for TIM_CTLR1 register ********************/ -#define TIM_CEN ((uint16_t)0x0001) /* Counter enable */ -#define TIM_UDIS ((uint16_t)0x0002) /* Update disable */ -#define TIM_URS ((uint16_t)0x0004) /* Update request source */ -#define TIM_OPM ((uint16_t)0x0008) /* One pulse mode */ -#define TIM_DIR ((uint16_t)0x0010) /* Direction */ - -#define TIM_CMS ((uint16_t)0x0060) /* CMS[1:0] bits (Center-aligned mode selection) */ -#define TIM_CMS_0 ((uint16_t)0x0020) /* Bit 0 */ -#define TIM_CMS_1 ((uint16_t)0x0040) /* Bit 1 */ - -#define TIM_ARPE ((uint16_t)0x0080) /* Auto-reload preload enable */ - -#define TIM_CTLR1_CKD ((uint16_t)0x0300) /* CKD[1:0] bits (clock division) */ -#define TIM_CKD_0 ((uint16_t)0x0100) /* Bit 0 */ -#define TIM_CKD_1 ((uint16_t)0x0200) /* Bit 1 */ - -/******************* Bit definition for TIM_CTLR2 register ********************/ -#define TIM_CCPC ((uint16_t)0x0001) /* Capture/Compare Preloaded Control */ -#define TIM_CCUS ((uint16_t)0x0004) /* Capture/Compare Control Update Selection */ -#define TIM_CCDS ((uint16_t)0x0008) /* Capture/Compare DMA Selection */ - -#define TIM_MMS ((uint16_t)0x0070) /* MMS[2:0] bits (Master Mode Selection) */ -#define TIM_MMS_0 ((uint16_t)0x0010) /* Bit 0 */ -#define TIM_MMS_1 ((uint16_t)0x0020) /* Bit 1 */ -#define TIM_MMS_2 ((uint16_t)0x0040) /* Bit 2 */ - -#define TIM_TI1S ((uint16_t)0x0080) /* TI1 Selection */ -#define TIM_OIS1 ((uint16_t)0x0100) /* Output Idle state 1 (OC1 output) */ -#define TIM_OIS1N ((uint16_t)0x0200) /* Output Idle state 1 (OC1N output) */ -#define TIM_OIS2 ((uint16_t)0x0400) /* Output Idle state 2 (OC2 output) */ -#define TIM_OIS2N ((uint16_t)0x0800) /* Output Idle state 2 (OC2N output) */ -#define TIM_OIS3 ((uint16_t)0x1000) /* Output Idle state 3 (OC3 output) */ -#define TIM_OIS3N ((uint16_t)0x2000) /* Output Idle state 3 (OC3N output) */ -#define TIM_OIS4 ((uint16_t)0x4000) /* Output Idle state 4 (OC4 output) */ - -/******************* Bit definition for TIM_SMCFGR register *******************/ -#define TIM_SMS ((uint16_t)0x0007) /* SMS[2:0] bits (Slave mode selection) */ -#define TIM_SMS_0 ((uint16_t)0x0001) /* Bit 0 */ -#define TIM_SMS_1 ((uint16_t)0x0002) /* Bit 1 */ -#define TIM_SMS_2 ((uint16_t)0x0004) /* Bit 2 */ - -#define TIM_TS ((uint16_t)0x0070) /* TS[2:0] bits (Trigger selection) */ -#define TIM_TS_0 ((uint16_t)0x0010) /* Bit 0 */ -#define TIM_TS_1 ((uint16_t)0x0020) /* Bit 1 */ -#define TIM_TS_2 ((uint16_t)0x0040) /* Bit 2 */ - -#define TIM_MSM ((uint16_t)0x0080) /* Master/slave mode */ - -#define TIM_ETF ((uint16_t)0x0F00) /* ETF[3:0] bits (External trigger filter) */ -#define TIM_ETF_0 ((uint16_t)0x0100) /* Bit 0 */ -#define TIM_ETF_1 ((uint16_t)0x0200) /* Bit 1 */ -#define TIM_ETF_2 ((uint16_t)0x0400) /* Bit 2 */ -#define TIM_ETF_3 ((uint16_t)0x0800) /* Bit 3 */ - -#define TIM_ETPS ((uint16_t)0x3000) /* ETPS[1:0] bits (External trigger prescaler) */ -#define TIM_ETPS_0 ((uint16_t)0x1000) /* Bit 0 */ -#define TIM_ETPS_1 ((uint16_t)0x2000) /* Bit 1 */ - -#define TIM_ECE ((uint16_t)0x4000) /* External clock enable */ -#define TIM_ETP ((uint16_t)0x8000) /* External trigger polarity */ - -/******************* Bit definition for TIM_DMAINTENR register *******************/ -#define TIM_UIE ((uint16_t)0x0001) /* Update interrupt enable */ -#define TIM_CC1IE ((uint16_t)0x0002) /* Capture/Compare 1 interrupt enable */ -#define TIM_CC2IE ((uint16_t)0x0004) /* Capture/Compare 2 interrupt enable */ -#define TIM_CC3IE ((uint16_t)0x0008) /* Capture/Compare 3 interrupt enable */ -#define TIM_CC4IE ((uint16_t)0x0010) /* Capture/Compare 4 interrupt enable */ -#define TIM_COMIE ((uint16_t)0x0020) /* COM interrupt enable */ -#define TIM_TIE ((uint16_t)0x0040) /* Trigger interrupt enable */ -#define TIM_BIE ((uint16_t)0x0080) /* Break interrupt enable */ -#define TIM_UDE ((uint16_t)0x0100) /* Update DMA request enable */ -#define TIM_CC1DE ((uint16_t)0x0200) /* Capture/Compare 1 DMA request enable */ -#define TIM_CC2DE ((uint16_t)0x0400) /* Capture/Compare 2 DMA request enable */ -#define TIM_CC3DE ((uint16_t)0x0800) /* Capture/Compare 3 DMA request enable */ -#define TIM_CC4DE ((uint16_t)0x1000) /* Capture/Compare 4 DMA request enable */ -#define TIM_COMDE ((uint16_t)0x2000) /* COM DMA request enable */ -#define TIM_TDE ((uint16_t)0x4000) /* Trigger DMA request enable */ - -/******************** Bit definition for TIM_INTFR register ********************/ -#define TIM_UIF ((uint16_t)0x0001) /* Update interrupt Flag */ -#define TIM_CC1IF ((uint16_t)0x0002) /* Capture/Compare 1 interrupt Flag */ -#define TIM_CC2IF ((uint16_t)0x0004) /* Capture/Compare 2 interrupt Flag */ -#define TIM_CC3IF ((uint16_t)0x0008) /* Capture/Compare 3 interrupt Flag */ -#define TIM_CC4IF ((uint16_t)0x0010) /* Capture/Compare 4 interrupt Flag */ -#define TIM_COMIF ((uint16_t)0x0020) /* COM interrupt Flag */ -#define TIM_TIF ((uint16_t)0x0040) /* Trigger interrupt Flag */ -#define TIM_BIF ((uint16_t)0x0080) /* Break interrupt Flag */ -#define TIM_CC1OF ((uint16_t)0x0200) /* Capture/Compare 1 Overcapture Flag */ -#define TIM_CC2OF ((uint16_t)0x0400) /* Capture/Compare 2 Overcapture Flag */ -#define TIM_CC3OF ((uint16_t)0x0800) /* Capture/Compare 3 Overcapture Flag */ -#define TIM_CC4OF ((uint16_t)0x1000) /* Capture/Compare 4 Overcapture Flag */ - -/******************* Bit definition for TIM_SWEVGR register ********************/ -#define TIM_UG ((uint8_t)0x01) /* Update Generation */ -#define TIM_CC1G ((uint8_t)0x02) /* Capture/Compare 1 Generation */ -#define TIM_CC2G ((uint8_t)0x04) /* Capture/Compare 2 Generation */ -#define TIM_CC3G ((uint8_t)0x08) /* Capture/Compare 3 Generation */ -#define TIM_CC4G ((uint8_t)0x10) /* Capture/Compare 4 Generation */ -#define TIM_COMG ((uint8_t)0x20) /* Capture/Compare Control Update Generation */ -#define TIM_TG ((uint8_t)0x40) /* Trigger Generation */ -#define TIM_BG ((uint8_t)0x80) /* Break Generation */ - -/****************** Bit definition for TIM_CHCTLR1 register *******************/ -#define TIM_CC1S ((uint16_t)0x0003) /* CC1S[1:0] bits (Capture/Compare 1 Selection) */ -#define TIM_CC1S_0 ((uint16_t)0x0001) /* Bit 0 */ -#define TIM_CC1S_1 ((uint16_t)0x0002) /* Bit 1 */ - -#define TIM_OC1FE ((uint16_t)0x0004) /* Output Compare 1 Fast enable */ -#define TIM_OC1PE ((uint16_t)0x0008) /* Output Compare 1 Preload enable */ - -#define TIM_OC1M ((uint16_t)0x0070) /* OC1M[2:0] bits (Output Compare 1 Mode) */ -#define TIM_OC1M_0 ((uint16_t)0x0010) /* Bit 0 */ -#define TIM_OC1M_1 ((uint16_t)0x0020) /* Bit 1 */ -#define TIM_OC1M_2 ((uint16_t)0x0040) /* Bit 2 */ - -#define TIM_OC1CE ((uint16_t)0x0080) /* Output Compare 1Clear Enable */ - -#define TIM_CC2S ((uint16_t)0x0300) /* CC2S[1:0] bits (Capture/Compare 2 Selection) */ -#define TIM_CC2S_0 ((uint16_t)0x0100) /* Bit 0 */ -#define TIM_CC2S_1 ((uint16_t)0x0200) /* Bit 1 */ - -#define TIM_OC2FE ((uint16_t)0x0400) /* Output Compare 2 Fast enable */ -#define TIM_OC2PE ((uint16_t)0x0800) /* Output Compare 2 Preload enable */ - -#define TIM_OC2M ((uint16_t)0x7000) /* OC2M[2:0] bits (Output Compare 2 Mode) */ -#define TIM_OC2M_0 ((uint16_t)0x1000) /* Bit 0 */ -#define TIM_OC2M_1 ((uint16_t)0x2000) /* Bit 1 */ -#define TIM_OC2M_2 ((uint16_t)0x4000) /* Bit 2 */ - -#define TIM_OC2CE ((uint16_t)0x8000) /* Output Compare 2 Clear Enable */ - -#define TIM_IC1PSC ((uint16_t)0x000C) /* IC1PSC[1:0] bits (Input Capture 1 Prescaler) */ -#define TIM_IC1PSC_0 ((uint16_t)0x0004) /* Bit 0 */ -#define TIM_IC1PSC_1 ((uint16_t)0x0008) /* Bit 1 */ - -#define TIM_IC1F ((uint16_t)0x00F0) /* IC1F[3:0] bits (Input Capture 1 Filter) */ -#define TIM_IC1F_0 ((uint16_t)0x0010) /* Bit 0 */ -#define TIM_IC1F_1 ((uint16_t)0x0020) /* Bit 1 */ -#define TIM_IC1F_2 ((uint16_t)0x0040) /* Bit 2 */ -#define TIM_IC1F_3 ((uint16_t)0x0080) /* Bit 3 */ - -#define TIM_IC2PSC ((uint16_t)0x0C00) /* IC2PSC[1:0] bits (Input Capture 2 Prescaler) */ -#define TIM_IC2PSC_0 ((uint16_t)0x0400) /* Bit 0 */ -#define TIM_IC2PSC_1 ((uint16_t)0x0800) /* Bit 1 */ - -#define TIM_IC2F ((uint16_t)0xF000) /* IC2F[3:0] bits (Input Capture 2 Filter) */ -#define TIM_IC2F_0 ((uint16_t)0x1000) /* Bit 0 */ -#define TIM_IC2F_1 ((uint16_t)0x2000) /* Bit 1 */ -#define TIM_IC2F_2 ((uint16_t)0x4000) /* Bit 2 */ -#define TIM_IC2F_3 ((uint16_t)0x8000) /* Bit 3 */ - -/****************** Bit definition for TIM_CHCTLR2 register *******************/ -#define TIM_CC3S ((uint16_t)0x0003) /* CC3S[1:0] bits (Capture/Compare 3 Selection) */ -#define TIM_CC3S_0 ((uint16_t)0x0001) /* Bit 0 */ -#define TIM_CC3S_1 ((uint16_t)0x0002) /* Bit 1 */ - -#define TIM_OC3FE ((uint16_t)0x0004) /* Output Compare 3 Fast enable */ -#define TIM_OC3PE ((uint16_t)0x0008) /* Output Compare 3 Preload enable */ - -#define TIM_OC3M ((uint16_t)0x0070) /* OC3M[2:0] bits (Output Compare 3 Mode) */ -#define TIM_OC3M_0 ((uint16_t)0x0010) /* Bit 0 */ -#define TIM_OC3M_1 ((uint16_t)0x0020) /* Bit 1 */ -#define TIM_OC3M_2 ((uint16_t)0x0040) /* Bit 2 */ - -#define TIM_OC3CE ((uint16_t)0x0080) /* Output Compare 3 Clear Enable */ - -#define TIM_CC4S ((uint16_t)0x0300) /* CC4S[1:0] bits (Capture/Compare 4 Selection) */ -#define TIM_CC4S_0 ((uint16_t)0x0100) /* Bit 0 */ -#define TIM_CC4S_1 ((uint16_t)0x0200) /* Bit 1 */ - -#define TIM_OC4FE ((uint16_t)0x0400) /* Output Compare 4 Fast enable */ -#define TIM_OC4PE ((uint16_t)0x0800) /* Output Compare 4 Preload enable */ - -#define TIM_OC4M ((uint16_t)0x7000) /* OC4M[2:0] bits (Output Compare 4 Mode) */ -#define TIM_OC4M_0 ((uint16_t)0x1000) /* Bit 0 */ -#define TIM_OC4M_1 ((uint16_t)0x2000) /* Bit 1 */ -#define TIM_OC4M_2 ((uint16_t)0x4000) /* Bit 2 */ - -#define TIM_OC4CE ((uint16_t)0x8000) /* Output Compare 4 Clear Enable */ - -#define TIM_IC3PSC ((uint16_t)0x000C) /* IC3PSC[1:0] bits (Input Capture 3 Prescaler) */ -#define TIM_IC3PSC_0 ((uint16_t)0x0004) /* Bit 0 */ -#define TIM_IC3PSC_1 ((uint16_t)0x0008) /* Bit 1 */ - -#define TIM_IC3F ((uint16_t)0x00F0) /* IC3F[3:0] bits (Input Capture 3 Filter) */ -#define TIM_IC3F_0 ((uint16_t)0x0010) /* Bit 0 */ -#define TIM_IC3F_1 ((uint16_t)0x0020) /* Bit 1 */ -#define TIM_IC3F_2 ((uint16_t)0x0040) /* Bit 2 */ -#define TIM_IC3F_3 ((uint16_t)0x0080) /* Bit 3 */ - -#define TIM_IC4PSC ((uint16_t)0x0C00) /* IC4PSC[1:0] bits (Input Capture 4 Prescaler) */ -#define TIM_IC4PSC_0 ((uint16_t)0x0400) /* Bit 0 */ -#define TIM_IC4PSC_1 ((uint16_t)0x0800) /* Bit 1 */ - -#define TIM_IC4F ((uint16_t)0xF000) /* IC4F[3:0] bits (Input Capture 4 Filter) */ -#define TIM_IC4F_0 ((uint16_t)0x1000) /* Bit 0 */ -#define TIM_IC4F_1 ((uint16_t)0x2000) /* Bit 1 */ -#define TIM_IC4F_2 ((uint16_t)0x4000) /* Bit 2 */ -#define TIM_IC4F_3 ((uint16_t)0x8000) /* Bit 3 */ - -/******************* Bit definition for TIM_CCER register *******************/ -#define TIM_CC1E ((uint16_t)0x0001) /* Capture/Compare 1 output enable */ -#define TIM_CC1P ((uint16_t)0x0002) /* Capture/Compare 1 output Polarity */ -#define TIM_CC1NE ((uint16_t)0x0004) /* Capture/Compare 1 Complementary output enable */ -#define TIM_CC1NP ((uint16_t)0x0008) /* Capture/Compare 1 Complementary output Polarity */ -#define TIM_CC2E ((uint16_t)0x0010) /* Capture/Compare 2 output enable */ -#define TIM_CC2P ((uint16_t)0x0020) /* Capture/Compare 2 output Polarity */ -#define TIM_CC2NE ((uint16_t)0x0040) /* Capture/Compare 2 Complementary output enable */ -#define TIM_CC2NP ((uint16_t)0x0080) /* Capture/Compare 2 Complementary output Polarity */ -#define TIM_CC3E ((uint16_t)0x0100) /* Capture/Compare 3 output enable */ -#define TIM_CC3P ((uint16_t)0x0200) /* Capture/Compare 3 output Polarity */ -#define TIM_CC3NE ((uint16_t)0x0400) /* Capture/Compare 3 Complementary output enable */ -#define TIM_CC3NP ((uint16_t)0x0800) /* Capture/Compare 3 Complementary output Polarity */ -#define TIM_CC4E ((uint16_t)0x1000) /* Capture/Compare 4 output enable */ -#define TIM_CC4P ((uint16_t)0x2000) /* Capture/Compare 4 output Polarity */ -#define TIM_CC4NP ((uint16_t)0x8000) /* Capture/Compare 4 Complementary output Polarity */ - -/******************* Bit definition for TIM_CNT register ********************/ -#define TIM_CNT ((uint16_t)0xFFFF) /* Counter Value */ - -/******************* Bit definition for TIM_PSC register ********************/ -#define TIM_PSC ((uint16_t)0xFFFF) /* Prescaler Value */ - -/******************* Bit definition for TIM_ATRLR register ********************/ -#define TIM_ARR ((uint16_t)0xFFFF) /* actual auto-reload Value */ - -/******************* Bit definition for TIM_RPTCR register ********************/ -#define TIM_REP ((uint8_t)0xFF) /* Repetition Counter Value */ - -/******************* Bit definition for TIM_CH1CVR register *******************/ -#define TIM_CCR1 ((uint16_t)0xFFFF) /* Capture/Compare 1 Value */ - -/******************* Bit definition for TIM_CH2CVR register *******************/ -#define TIM_CCR2 ((uint16_t)0xFFFF) /* Capture/Compare 2 Value */ - -/******************* Bit definition for TIM_CH3CVR register *******************/ -#define TIM_CCR3 ((uint16_t)0xFFFF) /* Capture/Compare 3 Value */ - -/******************* Bit definition for TIM_CH4CVR register *******************/ -#define TIM_CCR4 ((uint16_t)0xFFFF) /* Capture/Compare 4 Value */ - -/******************* Bit definition for TIM_BDTR register *******************/ -#define TIM_DTG ((uint16_t)0x00FF) /* DTG[0:7] bits (Dead-Time Generator set-up) */ -#define TIM_DTG_0 ((uint16_t)0x0001) /* Bit 0 */ -#define TIM_DTG_1 ((uint16_t)0x0002) /* Bit 1 */ -#define TIM_DTG_2 ((uint16_t)0x0004) /* Bit 2 */ -#define TIM_DTG_3 ((uint16_t)0x0008) /* Bit 3 */ -#define TIM_DTG_4 ((uint16_t)0x0010) /* Bit 4 */ -#define TIM_DTG_5 ((uint16_t)0x0020) /* Bit 5 */ -#define TIM_DTG_6 ((uint16_t)0x0040) /* Bit 6 */ -#define TIM_DTG_7 ((uint16_t)0x0080) /* Bit 7 */ - -#define TIM_LOCK ((uint16_t)0x0300) /* LOCK[1:0] bits (Lock Configuration) */ -#define TIM_LOCK_0 ((uint16_t)0x0100) /* Bit 0 */ -#define TIM_LOCK_1 ((uint16_t)0x0200) /* Bit 1 */ - -#define TIM_OSSI ((uint16_t)0x0400) /* Off-State Selection for Idle mode */ -#define TIM_OSSR ((uint16_t)0x0800) /* Off-State Selection for Run mode */ -#define TIM_BKE ((uint16_t)0x1000) /* Break enable */ -#define TIM_BKP ((uint16_t)0x2000) /* Break Polarity */ -#define TIM_AOE ((uint16_t)0x4000) /* Automatic Output enable */ -#define TIM_MOE ((uint16_t)0x8000) /* Main Output enable */ - -/******************* Bit definition for TIM_DMACFGR register ********************/ -#define TIM_DBA ((uint16_t)0x001F) /* DBA[4:0] bits (DMA Base Address) */ -#define TIM_DBA_0 ((uint16_t)0x0001) /* Bit 0 */ -#define TIM_DBA_1 ((uint16_t)0x0002) /* Bit 1 */ -#define TIM_DBA_2 ((uint16_t)0x0004) /* Bit 2 */ -#define TIM_DBA_3 ((uint16_t)0x0008) /* Bit 3 */ -#define TIM_DBA_4 ((uint16_t)0x0010) /* Bit 4 */ - -#define TIM_DBL ((uint16_t)0x1F00) /* DBL[4:0] bits (DMA Burst Length) */ -#define TIM_DBL_0 ((uint16_t)0x0100) /* Bit 0 */ -#define TIM_DBL_1 ((uint16_t)0x0200) /* Bit 1 */ -#define TIM_DBL_2 ((uint16_t)0x0400) /* Bit 2 */ -#define TIM_DBL_3 ((uint16_t)0x0800) /* Bit 3 */ -#define TIM_DBL_4 ((uint16_t)0x1000) /* Bit 4 */ - -/******************* Bit definition for TIM_DMAADR register *******************/ -#define TIM_DMAR_DMAB ((uint16_t)0xFFFF) /* DMA register for burst accesses */ - -/******************************************************************************/ -/* Universal Synchronous Asynchronous Receiver Transmitter */ -/******************************************************************************/ - -/******************* Bit definition for USART_STATR register *******************/ -#define USART_STATR_PE ((uint16_t)0x0001) /* Parity Error */ -#define USART_STATR_FE ((uint16_t)0x0002) /* Framing Error */ -#define USART_STATR_NE ((uint16_t)0x0004) /* Noise Error Flag */ -#define USART_STATR_ORE ((uint16_t)0x0008) /* OverRun Error */ -#define USART_STATR_IDLE ((uint16_t)0x0010) /* IDLE line detected */ -#define USART_STATR_RXNE ((uint16_t)0x0020) /* Read Data Register Not Empty */ -#define USART_STATR_TC ((uint16_t)0x0040) /* Transmission Complete */ -#define USART_STATR_TXE ((uint16_t)0x0080) /* Transmit Data Register Empty */ -#define USART_STATR_LBD ((uint16_t)0x0100) /* LIN Break Detection Flag */ -#define USART_STATR_CTS ((uint16_t)0x0200) /* CTS Flag */ - -/******************* Bit definition for USART_DATAR register *******************/ -#define USART_DATAR_DR ((uint16_t)0x01FF) /* Data value */ - -/****************** Bit definition for USART_BRR register *******************/ -#define USART_BRR_DIV_Fraction ((uint16_t)0x000F) /* Fraction of USARTDIV */ -#define USART_BRR_DIV_Mantissa ((uint16_t)0xFFF0) /* Mantissa of USARTDIV */ - -/****************** Bit definition for USART_CTLR1 register *******************/ -#define USART_CTLR1_SBK ((uint16_t)0x0001) /* Send Break */ -#define USART_CTLR1_RWU ((uint16_t)0x0002) /* Receiver wakeup */ -#define USART_CTLR1_RE ((uint16_t)0x0004) /* Receiver Enable */ -#define USART_CTLR1_TE ((uint16_t)0x0008) /* Transmitter Enable */ -#define USART_CTLR1_IDLEIE ((uint16_t)0x0010) /* IDLE Interrupt Enable */ -#define USART_CTLR1_RXNEIE ((uint16_t)0x0020) /* RXNE Interrupt Enable */ -#define USART_CTLR1_TCIE ((uint16_t)0x0040) /* Transmission Complete Interrupt Enable */ -#define USART_CTLR1_TXEIE ((uint16_t)0x0080) /* PE Interrupt Enable */ -#define USART_CTLR1_PEIE ((uint16_t)0x0100) /* PE Interrupt Enable */ -#define USART_CTLR1_PS ((uint16_t)0x0200) /* Parity Selection */ -#define USART_CTLR1_PCE ((uint16_t)0x0400) /* Parity Control Enable */ -#define USART_CTLR1_WAKE ((uint16_t)0x0800) /* Wakeup method */ -#define USART_CTLR1_M ((uint16_t)0x1000) /* Word length */ -#define USART_CTLR1_UE ((uint16_t)0x2000) /* USART Enable */ -#define USART_CTLR1_OVER8 ((uint16_t)0x8000) /* USART Oversmapling 8-bits */ - -/****************** Bit definition for USART_CTLR2 register *******************/ -#define USART_CTLR2_ADD ((uint16_t)0x000F) /* Address of the USART node */ -#define USART_CTLR2_LBDL ((uint16_t)0x0020) /* LIN Break Detection Length */ -#define USART_CTLR2_LBDIE ((uint16_t)0x0040) /* LIN Break Detection Interrupt Enable */ -#define USART_CTLR2_LBCL ((uint16_t)0x0100) /* Last Bit Clock pulse */ -#define USART_CTLR2_CPHA ((uint16_t)0x0200) /* Clock Phase */ -#define USART_CTLR2_CPOL ((uint16_t)0x0400) /* Clock Polarity */ -#define USART_CTLR2_CLKEN ((uint16_t)0x0800) /* Clock Enable */ - -#define USART_CTLR2_STOP ((uint16_t)0x3000) /* STOP[1:0] bits (STOP bits) */ -#define USART_CTLR2_STOP_0 ((uint16_t)0x1000) /* Bit 0 */ -#define USART_CTLR2_STOP_1 ((uint16_t)0x2000) /* Bit 1 */ - -#define USART_CTLR2_LINEN ((uint16_t)0x4000) /* LIN mode enable */ - -/****************** Bit definition for USART_CTLR3 register *******************/ -#define USART_CTLR3_EIE ((uint16_t)0x0001) /* Error Interrupt Enable */ -#define USART_CTLR3_IREN ((uint16_t)0x0002) /* IrDA mode Enable */ -#define USART_CTLR3_IRLP ((uint16_t)0x0004) /* IrDA Low-Power */ -#define USART_CTLR3_HDSEL ((uint16_t)0x0008) /* Half-Duplex Selection */ -#define USART_CTLR3_NACK ((uint16_t)0x0010) /* Smartcard NACK enable */ -#define USART_CTLR3_SCEN ((uint16_t)0x0020) /* Smartcard mode enable */ -#define USART_CTLR3_DMAR ((uint16_t)0x0040) /* DMA Enable Receiver */ -#define USART_CTLR3_DMAT ((uint16_t)0x0080) /* DMA Enable Transmitter */ -#define USART_CTLR3_RTSE ((uint16_t)0x0100) /* RTS Enable */ -#define USART_CTLR3_CTSE ((uint16_t)0x0200) /* CTS Enable */ -#define USART_CTLR3_CTSIE ((uint16_t)0x0400) /* CTS Interrupt Enable */ -#define USART_CTLR3_ONEBIT ((uint16_t)0x0800) /* One Bit method */ - -/****************** Bit definition for USART_GPR register ******************/ -#define USART_GPR_PSC ((uint16_t)0x00FF) /* PSC[7:0] bits (Prescaler value) */ -#define USART_GPR_PSC_0 ((uint16_t)0x0001) /* Bit 0 */ -#define USART_GPR_PSC_1 ((uint16_t)0x0002) /* Bit 1 */ -#define USART_GPR_PSC_2 ((uint16_t)0x0004) /* Bit 2 */ -#define USART_GPR_PSC_3 ((uint16_t)0x0008) /* Bit 3 */ -#define USART_GPR_PSC_4 ((uint16_t)0x0010) /* Bit 4 */ -#define USART_GPR_PSC_5 ((uint16_t)0x0020) /* Bit 5 */ -#define USART_GPR_PSC_6 ((uint16_t)0x0040) /* Bit 6 */ -#define USART_GPR_PSC_7 ((uint16_t)0x0080) /* Bit 7 */ - -#define USART_GPR_GT ((uint16_t)0xFF00) /* Guard time value */ - -/******************************************************************************/ -/* Window WATCHDOG */ -/******************************************************************************/ - -/******************* Bit definition for WWDG_CTLR register ********************/ -#define WWDG_CTLR_T ((uint8_t)0x7F) /* T[6:0] bits (7-Bit counter (MSB to LSB)) */ -#define WWDG_CTLR_T0 ((uint8_t)0x01) /* Bit 0 */ -#define WWDG_CTLR_T1 ((uint8_t)0x02) /* Bit 1 */ -#define WWDG_CTLR_T2 ((uint8_t)0x04) /* Bit 2 */ -#define WWDG_CTLR_T3 ((uint8_t)0x08) /* Bit 3 */ -#define WWDG_CTLR_T4 ((uint8_t)0x10) /* Bit 4 */ -#define WWDG_CTLR_T5 ((uint8_t)0x20) /* Bit 5 */ -#define WWDG_CTLR_T6 ((uint8_t)0x40) /* Bit 6 */ - -#define WWDG_CTLR_WDGA ((uint8_t)0x80) /* Activation bit */ - -/******************* Bit definition for WWDG_CFGR register *******************/ -#define WWDG_CFGR_W ((uint16_t)0x007F) /* W[6:0] bits (7-bit window value) */ -#define WWDG_CFGR_W0 ((uint16_t)0x0001) /* Bit 0 */ -#define WWDG_CFGR_W1 ((uint16_t)0x0002) /* Bit 1 */ -#define WWDG_CFGR_W2 ((uint16_t)0x0004) /* Bit 2 */ -#define WWDG_CFGR_W3 ((uint16_t)0x0008) /* Bit 3 */ -#define WWDG_CFGR_W4 ((uint16_t)0x0010) /* Bit 4 */ -#define WWDG_CFGR_W5 ((uint16_t)0x0020) /* Bit 5 */ -#define WWDG_CFGR_W6 ((uint16_t)0x0040) /* Bit 6 */ - -#define WWDG_CFGR_WDGTB ((uint16_t)0x0180) /* WDGTB[1:0] bits (Timer Base) */ -#define WWDG_CFGR_WDGTB0 ((uint16_t)0x0080) /* Bit 0 */ -#define WWDG_CFGR_WDGTB1 ((uint16_t)0x0100) /* Bit 1 */ - -#define WWDG_CFGR_EWI ((uint16_t)0x0200) /* Early Wakeup Interrupt */ - -/******************* Bit definition for WWDG_STATR register ********************/ -#define WWDG_STATR_EWIF ((uint8_t)0x01) /* Early Wakeup Interrupt Flag */ - -/******************************************************************************/ -/* ENHANCED FUNNCTION */ -/******************************************************************************/ - -/**************************** Enhanced register *****************************/ -#define EXTEN_LOCKUP_EN ((uint32_t)0x00000040) /* Bit 6 */ -#define EXTEN_LOCKUP_RSTF ((uint32_t)0x00000080) /* Bit 7 */ - -#define EXTEN_LDO_TRIM ((uint32_t)0x00000400) /* Bit 10 */ - -#define EXTEN_OPA_EN ((uint32_t)0x00010000) -#define EXTEN_OPA_NSEL ((uint32_t)0x00020000) -#define EXTEN_OPA_PSEL ((uint32_t)0x00040000) - -#ifdef __cplusplus -} -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* ch32v00x_gpio.c -----------------------------------------------------------*/ -/* MASK */ -#define LSB_MASK ((uint16_t)0xFFFF) -#define DBGAFR_POSITION_MASK ((uint32_t)0x000F0000) -#define DBGAFR_SDI_MASK ((uint32_t)0xF8FFFFFF) -#define DBGAFR_LOCATION_MASK ((uint32_t)0x00200000) -#define DBGAFR_NUMBITS_MASK ((uint32_t)0x00100000) - -/* ch32v00x_adc.c ------------------------------------------------------------*/ - -/* ADC DISCNUM mask */ -#define CTLR1_DISCNUM_Reset ((uint32_t)0xFFFF1FFF) - -/* ADC DISCEN mask */ -#define CTLR1_DISCEN_Set ((uint32_t)0x00000800) -#define CTLR1_DISCEN_Reset ((uint32_t)0xFFFFF7FF) - -/* ADC JAUTO mask */ -#define CTLR1_JAUTO_Set ((uint32_t)0x00000400) -#define CTLR1_JAUTO_Reset ((uint32_t)0xFFFFFBFF) - -/* ADC JDISCEN mask */ -#define CTLR1_JDISCEN_Set ((uint32_t)0x00001000) -#define CTLR1_JDISCEN_Reset ((uint32_t)0xFFFFEFFF) - -/* ADC AWDCH mask */ -#define CTLR1_AWDCH_Reset ((uint32_t)0xFFFFFFE0) - -/* ADC Analog watchdog enable mode mask */ -#define CTLR1_AWDMode_Reset ((uint32_t)0xFF3FFDFF) - -///* CTLR1 register Mask */ -// Editor's Note: Overloaded Definition -#define ADC_CTLR1_CLEAR_Mask ((uint32_t)0xFFF0FEFF) - -/* ADC ADON mask */ -#define CTLR2_ADON_Set ((uint32_t)0x00000001) -#define CTLR2_ADON_Reset ((uint32_t)0xFFFFFFFE) - -/* ADC DMA mask */ -#define CTLR2_DMA_Set ((uint32_t)0x00000100) -#define CTLR2_DMA_Reset ((uint32_t)0xFFFFFEFF) - -/* ADC RSTCAL mask */ -#define CTLR2_RSTCAL_Set ((uint32_t)0x00000008) - -/* ADC CAL mask */ -#define CTLR2_CAL_Set ((uint32_t)0x00000004) - -/* ADC SWSTART mask */ -#define CTLR2_SWSTART_Set ((uint32_t)0x00400000) - -/* ADC EXTTRIG mask */ -#define CTLR2_EXTTRIG_Set ((uint32_t)0x00100000) -#define CTLR2_EXTTRIG_Reset ((uint32_t)0xFFEFFFFF) - -/* ADC Software start mask */ -#define CTLR2_EXTTRIG_SWSTART_Set ((uint32_t)0x00500000) -#define CTLR2_EXTTRIG_SWSTART_Reset ((uint32_t)0xFFAFFFFF) - -/* ADC JEXTSEL mask */ -#define CTLR2_JEXTSEL_Reset ((uint32_t)0xFFFF8FFF) - -/* ADC JEXTTRIG mask */ -#define CTLR2_JEXTTRIG_Set ((uint32_t)0x00008000) -#define CTLR2_JEXTTRIG_Reset ((uint32_t)0xFFFF7FFF) - -/* ADC JSWSTART mask */ -#define CTLR2_JSWSTART_Set ((uint32_t)0x00200000) - -/* ADC injected software start mask */ -#define CTLR2_JEXTTRIG_JSWSTART_Set ((uint32_t)0x00208000) -#define CTLR2_JEXTTRIG_JSWSTART_Reset ((uint32_t)0xFFDF7FFF) - -/* ADC TSPD mask */ -#define CTLR2_TSVREFE_Set ((uint32_t)0x00800000) -#define CTLR2_TSVREFE_Reset ((uint32_t)0xFF7FFFFF) - -/* CTLR2 register Mask */ -#define CTLR2_CLEAR_Mask ((uint32_t)0xFFF1F7FD) - -/* ADC SQx mask */ -#define RSQR3_SQ_Set ((uint32_t)0x0000001F) -#define RSQR2_SQ_Set ((uint32_t)0x0000001F) -#define RSQR1_SQ_Set ((uint32_t)0x0000001F) - -/* RSQR1 register Mask */ -#define RSQR1_CLEAR_Mask ((uint32_t)0xFF0FFFFF) - -/* ADC JSQx mask */ -#define ISQR_JSQ_Set ((uint32_t)0x0000001F) - -/* ADC JL mask */ -#define ISQR_JL_Set ((uint32_t)0x00300000) -#define ISQR_JL_Reset ((uint32_t)0xFFCFFFFF) - -/* ADC SMPx mask */ -#define SAMPTR1_SMP_Set ((uint32_t)0x00000007) -#define SAMPTR2_SMP_Set ((uint32_t)0x00000007) - -/* ADC IDATARx registers offset */ -#define IDATAR_Offset ((uint8_t)0x28) - -/* ch32v00x_dbgmcu.c ---------------------------------------------------------*/ -#define IDCODE_DEVID_MASK ((uint32_t)0x0000FFFF) - -/* ch32v00x_dma.c ------------------------------------------------------------*/ - -/* DMA1 Channelx interrupt pending bit masks */ -#define DMA1_Channel1_IT_Mask ((uint32_t)(DMA_GIF1 | DMA_TCIF1 | DMA_HTIF1 | DMA_TEIF1)) -#define DMA1_Channel2_IT_Mask ((uint32_t)(DMA_GIF2 | DMA_TCIF2 | DMA_HTIF2 | DMA_TEIF2)) -#define DMA1_Channel3_IT_Mask ((uint32_t)(DMA_GIF3 | DMA_TCIF3 | DMA_HTIF3 | DMA_TEIF3)) -#define DMA1_Channel4_IT_Mask ((uint32_t)(DMA_GIF4 | DMA_TCIF4 | DMA_HTIF4 | DMA_TEIF4)) -#define DMA1_Channel5_IT_Mask ((uint32_t)(DMA_GIF5 | DMA_TCIF5 | DMA_HTIF5 | DMA_TEIF5)) -#define DMA1_Channel6_IT_Mask ((uint32_t)(DMA_GIF6 | DMA_TCIF6 | DMA_HTIF6 | DMA_TEIF6)) -#define DMA1_Channel7_IT_Mask ((uint32_t)(DMA_GIF7 | DMA_TCIF7 | DMA_HTIF7 | DMA_TEIF7)) - -/* DMA2 FLAG mask */ -// Editor's note: Overloaded Definition. -#define DMA2_FLAG_Mask ((uint32_t)0x10000000) - -/* DMA registers Masks */ -#define CFGR_CLEAR_Mask ((uint32_t)0xFFFF800F) - -/* ch32v00x_exti.c -----------------------------------------------------------*/ - -/* No interrupt selected */ -#define EXTI_LINENONE ((uint32_t)0x00000) - -/* ch32v00x_flash.c ----------------------------------------------------------*/ - -/* Flash Access Control Register bits */ -#define ACR_LATENCY_Mask ((uint32_t)0x00000038) - -/* Flash Control Register bits */ -#define CR_PG_Set ((uint32_t)0x00000001) -#define CR_PG_Reset ((uint32_t)0xFFFFFFFE) -#define CR_PER_Set ((uint32_t)0x00000002) -#define CR_PER_Reset ((uint32_t)0xFFFFFFFD) -#define CR_MER_Set ((uint32_t)0x00000004) -#define CR_MER_Reset ((uint32_t)0xFFFFFFFB) -#define CR_OPTPG_Set ((uint32_t)0x00000010) -#define CR_OPTPG_Reset ((uint32_t)0xFFFFFFEF) -#define CR_OPTER_Set ((uint32_t)0x00000020) -#define CR_OPTER_Reset ((uint32_t)0xFFFFFFDF) -#define CR_STRT_Set ((uint32_t)0x00000040) -#define CR_LOCK_Set ((uint32_t)0x00000080) -#define CR_PAGE_PG ((uint32_t)0x00010000) -#define CR_PAGE_ER ((uint32_t)0x00020000) -#define CR_BUF_LOAD ((uint32_t)0x00040000) -#define CR_BUF_RST ((uint32_t)0x00080000) - -/* FLASH Status Register bits */ -#define SR_BSY ((uint32_t)0x00000001) -#define SR_WRPRTERR ((uint32_t)0x00000010) -#define SR_EOP ((uint32_t)0x00000020) - -/* FLASH Mask */ -#define RDPRT_Mask ((uint32_t)0x00000002) -#define WRP0_Mask ((uint32_t)0x000000FF) -#define WRP1_Mask ((uint32_t)0x0000FF00) -#define WRP2_Mask ((uint32_t)0x00FF0000) -#define WRP3_Mask ((uint32_t)0xFF000000) - -/* FLASH Keys */ -#define RDP_Key ((uint16_t)0x00A5) -#define FLASH_KEY1 ((uint32_t)0x45670123) -#define FLASH_KEY2 ((uint32_t)0xCDEF89AB) - -/* FLASH BANK address */ -#define FLASH_BANK1_END_ADDRESS ((uint32_t)0x807FFFF) - -/* Delay definition */ -#define EraseTimeout ((uint32_t)0x000B0000) -#define ProgramTimeout ((uint32_t)0x00002000) - -/* Flash Program Valid Address */ -#define ValidAddrStart (FLASH_BASE) -#define ValidAddrEnd (FLASH_BASE + 0x4000) - -/* ch32v00x_i2c.c ------------------------------------------------------------*/ - -/* I2C SPE mask */ -#define CTLR1_PE_Set ((uint16_t)0x0001) -#define CTLR1_PE_Reset ((uint16_t)0xFFFE) - -/* I2C START mask */ -#define CTLR1_START_Set ((uint16_t)0x0100) -#define CTLR1_START_Reset ((uint16_t)0xFEFF) - -/* I2C STOP mask */ -#define CTLR1_STOP_Set ((uint16_t)0x0200) -#define CTLR1_STOP_Reset ((uint16_t)0xFDFF) - -/* I2C ACK mask */ -#define CTLR1_ACK_Set ((uint16_t)0x0400) -#define CTLR1_ACK_Reset ((uint16_t)0xFBFF) - -/* I2C ENGC mask */ -#define CTLR1_ENGC_Set ((uint16_t)0x0040) -#define CTLR1_ENGC_Reset ((uint16_t)0xFFBF) - -/* I2C SWRST mask */ -#define CTLR1_SWRST_Set ((uint16_t)0x8000) -#define CTLR1_SWRST_Reset ((uint16_t)0x7FFF) - -/* I2C PEC mask */ -#define CTLR1_PEC_Set ((uint16_t)0x1000) -#define CTLR1_PEC_Reset ((uint16_t)0xEFFF) - -/* I2C ENPEC mask */ -#define CTLR1_ENPEC_Set ((uint16_t)0x0020) -#define CTLR1_ENPEC_Reset ((uint16_t)0xFFDF) - -/* I2C ENARP mask */ -#define CTLR1_ENARP_Set ((uint16_t)0x0010) -#define CTLR1_ENARP_Reset ((uint16_t)0xFFEF) - -/* I2C NOSTRETCH mask */ -#define CTLR1_NOSTRETCH_Set ((uint16_t)0x0080) -#define CTLR1_NOSTRETCH_Reset ((uint16_t)0xFF7F) - -////* I2C registers Masks */ -// Editor's note: Overloaded Definition. -#define I2C_CTLR1_CLEAR_Mask ((uint16_t)0xFBF5) - -/* I2C DMAEN mask */ -#define CTLR2_DMAEN_Set ((uint16_t)0x0800) -#define CTLR2_DMAEN_Reset ((uint16_t)0xF7FF) - -/* I2C LAST mask */ -#define CTLR2_LAST_Set ((uint16_t)0x1000) -#define CTLR2_LAST_Reset ((uint16_t)0xEFFF) - -/* I2C FREQ mask */ -#define CTLR2_FREQ_Reset ((uint16_t)0xFFC0) - -/* I2C ADD0 mask */ -#define OADDR1_ADD0_Set ((uint16_t)0x0001) -#define OADDR1_ADD0_Reset ((uint16_t)0xFFFE) - -/* I2C ENDUAL mask */ -#define OADDR2_ENDUAL_Set ((uint16_t)0x0001) -#define OADDR2_ENDUAL_Reset ((uint16_t)0xFFFE) - -/* I2C ADD2 mask */ -#define OADDR2_ADD2_Reset ((uint16_t)0xFF01) - -/* I2C F/S mask */ -#define CKCFGR_FS_Set ((uint16_t)0x8000) - -/* I2C CCR mask */ -#define CKCFGR_CCR_Set ((uint16_t)0x0FFF) - -/* I2C FLAG mask */ -// Editor's Note: Overloaded Definition -#define I2c_FLAG_Mask ((uint32_t)0x00FFFFFF) - -/* I2C Interrupt Enable mask */ -#define ITEN_Mask ((uint32_t)0x07000000) - -/* ch32v00x_iwdg.c -----------------------------------------------------------*/ - -/* CTLR register bit mask */ -#define CTLR_KEY_Reload ((uint16_t)0xAAAA) -#define CTLR_KEY_Enable ((uint16_t)0xCCCC) - -/* ch32v00x_pwr.c ------------------------------------------------------------*/ - -/* PWR registers bit mask */ -/* CTLR register bit mask */ -#define CTLR_DS_MASK ((uint32_t)0xFFFFFFFD) -#define CTLR_PLS_MASK ((uint32_t)0xFFFFFF1F) -#define AWUPSC_MASK ((uint32_t)0xFFFFFFF0) -#define AWUWR_MASK ((uint32_t)0xFFFFFFC0) - -/* ch32v00x_rcc.c ------------------------------------------------------------*/ - -/* RCC registers bit address in the alias region */ -#define RCC_OFFSET (RCC_BASE - PERIPH_BASE) - -/* BDCTLR Register */ -#define BDCTLR_OFFSET (RCC_OFFSET + 0x20) - -/* RCC registers bit mask */ - -/* CTLR register bit mask */ -#define CTLR_HSEBYP_Reset ((uint32_t)0xFFFBFFFF) -#define CTLR_HSEBYP_Set ((uint32_t)0x00040000) -#define CTLR_HSEON_Reset ((uint32_t)0xFFFEFFFF) -#define CTLR_HSEON_Set ((uint32_t)0x00010000) -#define CTLR_HSITRIM_Mask ((uint32_t)0xFFFFFF07) - -#define CFGR0_PLL_Mask ((uint32_t)0xFFC0FFFF) -#define CFGR0_PLLMull_Mask ((uint32_t)0x003C0000) -#define CFGR0_PLLSRC_Mask ((uint32_t)0x00010000) -#define CFGR0_PLLXTPRE_Mask ((uint32_t)0x00020000) -#define CFGR0_SWS_Mask ((uint32_t)0x0000000C) -#define CFGR0_SW_Mask ((uint32_t)0xFFFFFFFC) -#define CFGR0_HPRE_Reset_Mask ((uint32_t)0xFFFFFF0F) -#define CFGR0_HPRE_Set_Mask ((uint32_t)0x000000F0) -#define CFGR0_PPRE1_Reset_Mask ((uint32_t)0xFFFFF8FF) -#define CFGR0_PPRE1_Set_Mask ((uint32_t)0x00000700) -#define CFGR0_PPRE2_Reset_Mask ((uint32_t)0xFFFFC7FF) -#define CFGR0_PPRE2_Set_Mask ((uint32_t)0x00003800) -#define CFGR0_ADCPRE_Reset_Mask ((uint32_t)0xFFFF07FF) -#define CFGR0_ADCPRE_Set_Mask ((uint32_t)0x0000F800) - -/* RSTSCKR register bit mask */ -#define RSTSCKR_RMVF_Set ((uint32_t)0x01000000) - -/* RCC Flag Mask */ -// Editor's Note: Overloaded Definition -#define RCC_FLAG_Mask ((uint8_t)0x1F) - -/* INTR register byte 2 (Bits[15:8]) base address */ -#define INTR_BYTE2_ADDRESS ((uint32_t)0x40021009) - -/* INTR register byte 3 (Bits[23:16]) base address */ -#define INTR_BYTE3_ADDRESS ((uint32_t)0x4002100A) - -/* CFGR0 register byte 4 (Bits[31:24]) base address */ -#define CFGR0_BYTE4_ADDRESS ((uint32_t)0x40021007) - -/* BDCTLR register base address */ -#define BDCTLR_ADDRESS (PERIPH_BASE + BDCTLR_OFFSET) - -#ifndef __ASSEMBLER__ - static __I uint8_t APBAHBPrescTable[16] = {1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8}; - static __I uint8_t ADCPrescTable[20] = {2, 4, 6, 8, 4, 8, 12, 16, 8, 16, 24, 32, 16, 32, 48, 64, 32, 64, 96, 128}; -#endif - -/* ch32v00x_spi.c ------------------------------------------------------------*/ - -/* SPI SPE mask */ -#define CTLR1_SPE_Set ((uint16_t)0x0040) -#define CTLR1_SPE_Reset ((uint16_t)0xFFBF) - -/* SPI CRCNext mask */ -#define CTLR1_CRCNext_Set ((uint16_t)0x1000) - -/* SPI CRCEN mask */ -#define CTLR1_CRCEN_Set ((uint16_t)0x2000) -#define CTLR1_CRCEN_Reset ((uint16_t)0xDFFF) - -/* SPI SSOE mask */ -#define CTLR2_SSOE_Set ((uint16_t)0x0004) -#define CTLR2_SSOE_Reset ((uint16_t)0xFFFB) - -/* SPI registers Masks */ -// Editor's Note: Overloaded Definition -#define SPI_CTLR1_CLEAR_Mask ((uint16_t)0x3040) -#define I2SCFGR_CLEAR_Mask ((uint16_t)0xF040) - -/* ch32v00x_tim.c ------------------------------------------------------------*/ - -/* TIM registers bit mask */ -#define SMCFGR_ETR_Mask ((uint16_t)0x00FF) -#define CHCTLR_Offset ((uint16_t)0x0018) -#define CCER_CCE_Set ((uint16_t)0x0001) -#define CCER_CCNE_Set ((uint16_t)0x0004) - -/* ch32v00x_usart.c ----------------------------------------------------------*/ - -/* USART_Private_Defines */ -#define CTLR1_UE_Set ((uint16_t)0x2000) /* USART Enable Mask */ -#define CTLR1_UE_Reset ((uint16_t)0xDFFF) /* USART Disable Mask */ - -#define CTLR1_WAKE_Mask ((uint16_t)0xF7FF) /* USART WakeUp Method Mask */ - -#define CTLR1_RWU_Set ((uint16_t)0x0002) /* USART mute mode Enable Mask */ -#define CTLR1_RWU_Reset ((uint16_t)0xFFFD) /* USART mute mode Enable Mask */ -#define CTLR1_SBK_Set ((uint16_t)0x0001) /* USART Break Character send Mask */ -// Editor's Note: Overloaded Definition -#define USART_CTLR1_CLEAR_Mask ((uint16_t)0xE9F3) /* USART CR1 Mask */ -#define CTLR2_Address_Mask ((uint16_t)0xFFF0) /* USART address Mask */ - -#define CTLR2_LINEN_Set ((uint16_t)0x4000) /* USART LIN Enable Mask */ -#define CTLR2_LINEN_Reset ((uint16_t)0xBFFF) /* USART LIN Disable Mask */ - -#define CTLR2_LBDL_Mask ((uint16_t)0xFFDF) /* USART LIN Break detection Mask */ -#define CTLR2_STOP_CLEAR_Mask ((uint16_t)0xCFFF) /* USART CR2 STOP Bits Mask */ -#define CTLR2_CLOCK_CLEAR_Mask ((uint16_t)0xF0FF) /* USART CR2 Clock Mask */ - -#define CTLR3_SCEN_Set ((uint16_t)0x0020) /* USART SC Enable Mask */ -#define CTLR3_SCEN_Reset ((uint16_t)0xFFDF) /* USART SC Disable Mask */ - -#define CTLR3_NACK_Set ((uint16_t)0x0010) /* USART SC NACK Enable Mask */ -#define CTLR3_NACK_Reset ((uint16_t)0xFFEF) /* USART SC NACK Disable Mask */ - -#define CTLR3_HDSEL_Set ((uint16_t)0x0008) /* USART Half-Duplex Enable Mask */ -#define CTLR3_HDSEL_Reset ((uint16_t)0xFFF7) /* USART Half-Duplex Disable Mask */ - -#define CTLR3_IRLP_Mask ((uint16_t)0xFFFB) /* USART IrDA LowPower mode Mask */ -#define CTLR3_CLEAR_Mask ((uint16_t)0xFCFF) /* USART CR3 Mask */ - -#define CTLR3_IREN_Set ((uint16_t)0x0002) /* USART IrDA Enable Mask */ -#define CTLR3_IREN_Reset ((uint16_t)0xFFFD) /* USART IrDA Disable Mask */ -#define GPR_LSB_Mask ((uint16_t)0x00FF) /* Guard Time Register LSB Mask */ -#define GPR_MSB_Mask ((uint16_t)0xFF00) /* Guard Time Register MSB Mask */ -#define IT_Mask ((uint16_t)0x001F) /* USART Interrupt Mask */ - -/* USART OverSampling-8 Mask */ -#define CTLR1_OVER8_Set ((uint16_t)0x8000) /* USART OVER8 mode Enable Mask */ -#define CTLR1_OVER8_Reset ((uint16_t)0x7FFF) /* USART OVER8 mode Disable Mask */ - -/* USART One Bit Sampling Mask */ -#define CTLR3_ONEBITE_Set ((uint16_t)0x0800) /* USART ONEBITE mode Enable Mask */ -#define CTLR3_ONEBITE_Reset ((uint16_t)0xF7FF) /* USART ONEBITE mode Disable Mask */ - -/* ch32v00x_wwdg.c ------------------------------------------------------------*/ - -/* CTLR register bit mask */ -#define CTLR_WDGA_Set ((uint32_t)0x00000080) - -/* CFGR register bit mask */ -#define CFGR_WDGTB_Mask ((uint32_t)0xFFFFFE7F) -#define CFGR_W_Mask ((uint32_t)0xFFFFFF80) -#define BIT_Mask ((uint8_t)0x7F) - -/* ch32v00x_adc.h ------------------------------------------------------------*/ - -/* ADC_mode */ -#define ADC_Mode_Independent ((uint32_t)0x00000000) - - /* ADC_external_trigger_sources_for_regular_channels_conversion */ - -#define ADC_ExternalTrigConv_T1_TRGO ((uint32_t)0x00000000) -#define ADC_ExternalTrigConv_T1_CC1 ((uint32_t)0x00020000) -#define ADC_ExternalTrigConv_T1_CC2 ((uint32_t)0x00040000) -#define ADC_ExternalTrigConv_T2_TRGO ((uint32_t)0x00060000) -#define ADC_ExternalTrigConv_T2_CC1 ((uint32_t)0x00080000) -#define ADC_ExternalTrigConv_T2_CC2 ((uint32_t)0x000A0000) -#define ADC_ExternalTrigConv_Ext_PD3_PC2 ((uint32_t)0x000C0000) -#define ADC_ExternalTrigConv_None ((uint32_t)0x000E0000) - -/* ADC_data_align */ -#define ADC_DataAlign_Right ((uint32_t)0x00000000) -#define ADC_DataAlign_Left ((uint32_t)0x00000800) - -/* ADC_channels */ -#define ADC_Channel_0 ((uint8_t)0x00) -#define ADC_Channel_1 ((uint8_t)0x01) -#define ADC_Channel_2 ((uint8_t)0x02) -#define ADC_Channel_3 ((uint8_t)0x03) -#define ADC_Channel_4 ((uint8_t)0x04) -#define ADC_Channel_5 ((uint8_t)0x05) -#define ADC_Channel_6 ((uint8_t)0x06) -#define ADC_Channel_7 ((uint8_t)0x07) -#define ADC_Channel_8 ((uint8_t)0x08) -#define ADC_Channel_9 ((uint8_t)0x09) - -#define ADC_Channel_Vrefint ((uint8_t)ADC_Channel_8) -#define ADC_Channel_Vcalint ((uint8_t)ADC_Channel_9) - -/* ADC_sampling_time */ -#define ADC_SampleTime_3Cycles ((uint8_t)0x00) -#define ADC_SampleTime_9Cycles ((uint8_t)0x01) -#define ADC_SampleTime_15Cycles ((uint8_t)0x02) -#define ADC_SampleTime_30Cycles ((uint8_t)0x03) -#define ADC_SampleTime_43Cycles ((uint8_t)0x04) -#define ADC_SampleTime_57Cycles ((uint8_t)0x05) -#define ADC_SampleTime_73Cycles ((uint8_t)0x06) -#define ADC_SampleTime_241Cycles ((uint8_t)0x07) - -/* ADC_external_trigger_sources_for_injected_channels_conversion */ -#define ADC_ExternalTrigInjecConv_T1_CC3 ((uint32_t)0x00000000) -#define ADC_ExternalTrigInjecConv_T1_CC4 ((uint32_t)0x00001000) -#define ADC_ExternalTrigInjecConv_T2_CC3 ((uint32_t)0x00002000) -#define ADC_ExternalTrigInjecConv_T2_CC4 ((uint32_t)0x00003000) -#define ADC_ExternalTrigInjecConv_Ext_PD1_PA2 ((uint32_t)0x00006000) -#define ADC_ExternalTrigInjecConv_None ((uint32_t)0x00007000) - -/* ADC_injected_channel_selection */ -#define ADC_InjectedChannel_1 ((uint8_t)0x14) -#define ADC_InjectedChannel_2 ((uint8_t)0x18) -#define ADC_InjectedChannel_3 ((uint8_t)0x1C) -#define ADC_InjectedChannel_4 ((uint8_t)0x20) - -/* ADC_analog_watchdog_selection */ -#define ADC_AnalogWatchdog_SingleRegEnable ((uint32_t)0x00800200) -#define ADC_AnalogWatchdog_SingleInjecEnable ((uint32_t)0x00400200) -#define ADC_AnalogWatchdog_SingleRegOrInjecEnable ((uint32_t)0x00C00200) -#define ADC_AnalogWatchdog_AllRegEnable ((uint32_t)0x00800000) -#define ADC_AnalogWatchdog_AllInjecEnable ((uint32_t)0x00400000) -#define ADC_AnalogWatchdog_AllRegAllInjecEnable ((uint32_t)0x00C00000) -#define ADC_AnalogWatchdog_None ((uint32_t)0x00000000) - -/* ADC_interrupts_definition */ -#define ADC_IT_EOC ((uint16_t)0x0220) -#define ADC_IT_AWD ((uint16_t)0x0140) -#define ADC_IT_JEOC ((uint16_t)0x0480) - -/* ADC_flags_definition */ -#define ADC_FLAG_AWD ((uint8_t)0x01) -#define ADC_FLAG_EOC ((uint8_t)0x02) -#define ADC_FLAG_JEOC ((uint8_t)0x04) -#define ADC_FLAG_JSTRT ((uint8_t)0x08) -#define ADC_FLAG_STRT ((uint8_t)0x10) - -/* ADC_calibration_voltage_definition */ -#define ADC_CALVOL_50PERCENT ((uint32_t)0x02000000) -#define ADC_CALVOL_75PERCENT ((uint32_t)0x04000000) - -/* ADC_external_trigger_sources_delay_channels_definition */ -#define ADC_ExternalTrigRegul_DLY ((uint32_t)0x00000000) -#define ADC_ExternalTrigInjec_DLY ((uint32_t)0x00000200) - -/* ch32v00x_dbgmcu.h ---------------------------------------------------------*/ - -/* DBGMCU_CR Register */ -#define DBGMCU_SLEEP ((uint32_t)0x00000001) -#define DBGMCU_STOP ((uint32_t)0x00000002) -#define DBGMCU_STANDBY ((uint32_t)0x00000004) -#define DBGMCU_IWDG_STOP ((uint32_t)0x00000100) -#define DBGMCU_WWDG_STOP ((uint32_t)0x00000200) -#define DBGMCU_TIM1_STOP ((uint32_t)0x00001000) -#define DBGMCU_TIM2_STOP ((uint32_t)0x00002000) - -/* ch32v00x_dma.h ------------------------------------------------------------*/ - -/* DMA_data_transfer_direction */ -#define DMA_DIR_PeripheralDST ((uint32_t)0x00000010) -#define DMA_DIR_PeripheralSRC ((uint32_t)0x00000000) - -/* DMA_peripheral_incremented_mode */ -#define DMA_PeripheralInc_Enable ((uint32_t)0x00000040) -#define DMA_PeripheralInc_Disable ((uint32_t)0x00000000) - -/* DMA_memory_incremented_mode */ -#define DMA_MemoryInc_Enable ((uint32_t)0x00000080) -#define DMA_MemoryInc_Disable ((uint32_t)0x00000000) - -/* DMA_peripheral_data_size */ -#define DMA_PeripheralDataSize_Byte ((uint32_t)0x00000000) -#define DMA_PeripheralDataSize_HalfWord ((uint32_t)0x00000100) -#define DMA_PeripheralDataSize_Word ((uint32_t)0x00000200) - -/* DMA_memory_data_size */ -#define DMA_MemoryDataSize_Byte ((uint32_t)0x00000000) -#define DMA_MemoryDataSize_HalfWord ((uint32_t)0x00000400) -#define DMA_MemoryDataSize_Word ((uint32_t)0x00000800) - -/* DMA_circular_normal_mode */ -#define DMA_Mode_Circular ((uint32_t)0x00000020) -#define DMA_Mode_Normal ((uint32_t)0x00000000) - -/* DMA_priority_level */ -#define DMA_Priority_VeryHigh ((uint32_t)0x00003000) -#define DMA_Priority_High ((uint32_t)0x00002000) -#define DMA_Priority_Medium ((uint32_t)0x00001000) -#define DMA_Priority_Low ((uint32_t)0x00000000) - -/* DMA_memory_to_memory */ -#define DMA_M2M_Enable ((uint32_t)0x00004000) -#define DMA_M2M_Disable ((uint32_t)0x00000000) - -/* DMA_interrupts_definition */ -#define DMA_IT_TC ((uint32_t)0x00000002) -#define DMA_IT_HT ((uint32_t)0x00000004) -#define DMA_IT_TE ((uint32_t)0x00000008) - -#define DMA1_IT_GL1 ((uint32_t)0x00000001) -#define DMA1_IT_TC1 ((uint32_t)0x00000002) -#define DMA1_IT_HT1 ((uint32_t)0x00000004) -#define DMA1_IT_TE1 ((uint32_t)0x00000008) -#define DMA1_IT_GL2 ((uint32_t)0x00000010) -#define DMA1_IT_TC2 ((uint32_t)0x00000020) -#define DMA1_IT_HT2 ((uint32_t)0x00000040) -#define DMA1_IT_TE2 ((uint32_t)0x00000080) -#define DMA1_IT_GL3 ((uint32_t)0x00000100) -#define DMA1_IT_TC3 ((uint32_t)0x00000200) -#define DMA1_IT_HT3 ((uint32_t)0x00000400) -#define DMA1_IT_TE3 ((uint32_t)0x00000800) -#define DMA1_IT_GL4 ((uint32_t)0x00001000) -#define DMA1_IT_TC4 ((uint32_t)0x00002000) -#define DMA1_IT_HT4 ((uint32_t)0x00004000) -#define DMA1_IT_TE4 ((uint32_t)0x00008000) -#define DMA1_IT_GL5 ((uint32_t)0x00010000) -#define DMA1_IT_TC5 ((uint32_t)0x00020000) -#define DMA1_IT_HT5 ((uint32_t)0x00040000) -#define DMA1_IT_TE5 ((uint32_t)0x00080000) -#define DMA1_IT_GL6 ((uint32_t)0x00100000) -#define DMA1_IT_TC6 ((uint32_t)0x00200000) -#define DMA1_IT_HT6 ((uint32_t)0x00400000) -#define DMA1_IT_TE6 ((uint32_t)0x00800000) -#define DMA1_IT_GL7 ((uint32_t)0x01000000) -#define DMA1_IT_TC7 ((uint32_t)0x02000000) -#define DMA1_IT_HT7 ((uint32_t)0x04000000) -#define DMA1_IT_TE7 ((uint32_t)0x08000000) - -/* DMA_flags_definition */ -#define DMA1_FLAG_GL1 ((uint32_t)0x00000001) -#define DMA1_FLAG_TC1 ((uint32_t)0x00000002) -#define DMA1_FLAG_HT1 ((uint32_t)0x00000004) -#define DMA1_FLAG_TE1 ((uint32_t)0x00000008) -#define DMA1_FLAG_GL2 ((uint32_t)0x00000010) -#define DMA1_FLAG_TC2 ((uint32_t)0x00000020) -#define DMA1_FLAG_HT2 ((uint32_t)0x00000040) -#define DMA1_FLAG_TE2 ((uint32_t)0x00000080) -#define DMA1_FLAG_GL3 ((uint32_t)0x00000100) -#define DMA1_FLAG_TC3 ((uint32_t)0x00000200) -#define DMA1_FLAG_HT3 ((uint32_t)0x00000400) -#define DMA1_FLAG_TE3 ((uint32_t)0x00000800) -#define DMA1_FLAG_GL4 ((uint32_t)0x00001000) -#define DMA1_FLAG_TC4 ((uint32_t)0x00002000) -#define DMA1_FLAG_HT4 ((uint32_t)0x00004000) -#define DMA1_FLAG_TE4 ((uint32_t)0x00008000) -#define DMA1_FLAG_GL5 ((uint32_t)0x00010000) -#define DMA1_FLAG_TC5 ((uint32_t)0x00020000) -#define DMA1_FLAG_HT5 ((uint32_t)0x00040000) -#define DMA1_FLAG_TE5 ((uint32_t)0x00080000) -#define DMA1_FLAG_GL6 ((uint32_t)0x00100000) -#define DMA1_FLAG_TC6 ((uint32_t)0x00200000) -#define DMA1_FLAG_HT6 ((uint32_t)0x00400000) -#define DMA1_FLAG_TE6 ((uint32_t)0x00800000) -#define DMA1_FLAG_GL7 ((uint32_t)0x01000000) -#define DMA1_FLAG_TC7 ((uint32_t)0x02000000) -#define DMA1_FLAG_HT7 ((uint32_t)0x04000000) -#define DMA1_FLAG_TE7 ((uint32_t)0x08000000) - - /* ch32v00x_exti.h -----------------------------------------------------------*/ - -#ifndef __ASSEMBLER__ - - /* EXTI mode enumeration */ - typedef enum - { - EXTI_Mode_Interrupt = 0x00, - EXTI_Mode_Event = 0x04 - } EXTIMode_TypeDef; - - /* EXTI Trigger enumeration */ - typedef enum - { - EXTI_Trigger_Rising = 0x08, - EXTI_Trigger_Falling = 0x0C, - EXTI_Trigger_Rising_Falling = 0x10 - } EXTITrigger_TypeDef; - -#endif - -/* EXTI_Lines */ -#define EXTI_Line0 ((uint32_t)0x00001) /* External interrupt line 0 */ -#define EXTI_Line1 ((uint32_t)0x00002) /* External interrupt line 1 */ -#define EXTI_Line2 ((uint32_t)0x00004) /* External interrupt line 2 */ -#define EXTI_Line3 ((uint32_t)0x00008) /* External interrupt line 3 */ -#define EXTI_Line4 ((uint32_t)0x00010) /* External interrupt line 4 */ -#define EXTI_Line5 ((uint32_t)0x00020) /* External interrupt line 5 */ -#define EXTI_Line6 ((uint32_t)0x00040) /* External interrupt line 6 */ -#define EXTI_Line7 ((uint32_t)0x00080) /* External interrupt line 7 */ -#define EXTI_Line8 ((uint32_t)0x00100) /* External interrupt line 8 Connected to the PVD Output */ -#define EXTI_Line9 ((uint32_t)0x00200) /* External interrupt line 9 Connected to the PWR Auto Wake-up event*/ - - /* ch32v00x_flash.h ----------------------------------------------------------*/ - -#ifndef __ASSEMBLER__ - /* FLASH Status */ - typedef enum - { - FLASH_BUSY = 1, - FLASH_ERROR_PG, - FLASH_ERROR_WRP, - FLASH_COMPLETE, - FLASH_TIMEOUT, - FLASH_OP_RANGE_ERROR = 0xFD, - FLASH_ALIGN_ERROR = 0xFE, - FLASH_ADR_RANGE_ERROR = 0xFF, - } FLASH_Status; -#endif - -/* Flash_Latency */ -#define FLASH_Latency_0 ((uint32_t)0x00000000) /* FLASH Zero Latency cycle */ -#define FLASH_Latency_1 ((uint32_t)0x00000001) /* FLASH One Latency cycle */ -#define FLASH_Latency_2 ((uint32_t)0x00000002) /* FLASH Two Latency cycles */ - -/* Values to be used with CH32V00x devices (1page = 64Byte) */ -#define FLASH_WRProt_Pages0to15 ((uint32_t)0x00000001) /* CH32 Low and Medium density devices: Write protection of page 0 to 15 */ -#define FLASH_WRProt_Pages16to31 ((uint32_t)0x00000002) /* CH32 Low and Medium density devices: Write protection of page 16 to 31 */ -#define FLASH_WRProt_Pages32to47 ((uint32_t)0x00000004) /* CH32 Low and Medium density devices: Write protection of page 32 to 47 */ -#define FLASH_WRProt_Pages48to63 ((uint32_t)0x00000008) /* CH32 Low and Medium density devices: Write protection of page 48 to 63 */ -#define FLASH_WRProt_Pages64to79 ((uint32_t)0x00000010) /* CH32 Low and Medium density devices: Write protection of page 64 to 79 */ -#define FLASH_WRProt_Pages80to95 ((uint32_t)0x00000020) /* CH32 Low and Medium density devices: Write protection of page 80 to 95 */ -#define FLASH_WRProt_Pages96to111 ((uint32_t)0x00000040) /* CH32 Low and Medium density devices: Write protection of page 96 to 111 */ -#define FLASH_WRProt_Pages112to127 ((uint32_t)0x00000080) /* CH32 Low and Medium density devices: Write protection of page 112 to 127 */ -#define FLASH_WRProt_Pages128to143 ((uint32_t)0x00000100) /* CH32 Medium-density devices: Write protection of page 128 to 143 */ -#define FLASH_WRProt_Pages144to159 ((uint32_t)0x00000200) /* CH32 Medium-density devices: Write protection of page 144 to 159 */ -#define FLASH_WRProt_Pages160to175 ((uint32_t)0x00000400) /* CH32 Medium-density devices: Write protection of page 160 to 175 */ -#define FLASH_WRProt_Pages176to191 ((uint32_t)0x00000800) /* CH32 Medium-density devices: Write protection of page 176 to 191 */ -#define FLASH_WRProt_Pages192to207 ((uint32_t)0x00001000) /* CH32 Medium-density devices: Write protection of page 192 to 207 */ -#define FLASH_WRProt_Pages208to223 ((uint32_t)0x00002000) /* CH32 Medium-density devices: Write protection of page 208 to 223 */ -#define FLASH_WRProt_Pages224to239 ((uint32_t)0x00004000) /* CH32 Medium-density devices: Write protection of page 224 to 239 */ -#define FLASH_WRProt_Pages240to255 ((uint32_t)0x00008000) /* CH32 Medium-density devices: Write protection of page 240 to 255 */ - -#define FLASH_WRProt_AllPages ((uint32_t)0x0000FFFF) /* Write protection of all Pages */ - -/* Option_Bytes_IWatchdog */ -#define OB_IWDG_SW ((uint16_t)0x0001) /* Software IWDG selected */ -#define OB_IWDG_HW ((uint16_t)0x0000) /* Hardware IWDG selected */ - -/* Option_Bytes_nRST_STOP */ -#define OB_STOP_NoRST ((uint16_t)0x0002) /* No reset generated when entering in STOP */ -#define OB_STOP_RST ((uint16_t)0x0000) /* Reset generated when entering in STOP */ - -/* Option_Bytes_nRST_STDBY */ -#define OB_STDBY_NoRST ((uint16_t)0x0004) /* No reset generated when entering in STANDBY */ -#define OB_STDBY_RST ((uint16_t)0x0000) /* Reset generated when entering in STANDBY */ - -/* Option_Bytes_RST_ENandDT */ -#define OB_RST_NoEN ((uint16_t)0x0018) /* Reset IO disable (PD7)*/ -#define OB_RST_EN_DT12ms ((uint16_t)0x0010) /* Reset IO enable (PD7) and Ignore delay time 12ms */ -#define OB_RST_EN_DT1ms ((uint16_t)0x0008) /* Reset IO enable (PD7) and Ignore delay time 1ms */ -#define OB_RST_EN_DT128ms ((uint16_t)0x0000) /* Reset IO enable (PD7) and Ignore delay time 128ms */ - -/* Option_Bytes_Power_ON_Start_Mode */ -#define OB_PowerON_Start_Mode_BOOT ((uint16_t)0x0020) /* from Boot after power on */ -#define OB_PowerON_Start_Mode_USER ((uint16_t)0x0000) /* from User after power on */ - -#define OB_STARTMODE_BOOT ((uint16_t)0x0020) /* Start in BOOT area */ -#define OB_STARTMODE_USER ((uint16_t)0x0000) /* Start in user area */ - -/* FLASH_Interrupts */ -#define FLASH_IT_ERROR ((uint32_t)0x00000400) /* FPEC error interrupt source */ -#define FLASH_IT_EOP ((uint32_t)0x00001000) /* End of FLASH Operation Interrupt source */ -#define FLASH_IT_BANK1_ERROR FLASH_IT_ERROR /* FPEC BANK1 error interrupt source */ -#define FLASH_IT_BANK1_EOP FLASH_IT_EOP /* End of FLASH BANK1 Operation Interrupt source */ - -/* FLASH_Flags */ -#define FLASH_FLAG_BSY ((uint32_t)0x00000001) /* FLASH Busy flag */ -#define FLASH_FLAG_EOP ((uint32_t)0x00000020) /* FLASH End of Operation flag */ -#define FLASH_FLAG_WRPRTERR ((uint32_t)0x00000010) /* FLASH Write protected error flag */ -#define FLASH_FLAG_OPTERR ((uint32_t)0x00000001) /* FLASH Option Byte error flag */ - -#define FLASH_FLAG_BANK1_BSY FLASH_FLAG_BSY /* FLASH BANK1 Busy flag*/ -#define FLASH_FLAG_BANK1_EOP FLASH_FLAG_EOP /* FLASH BANK1 End of Operation flag */ -#define FLASH_FLAG_BANK1_WRPRTERR FLASH_FLAG_WRPRTERR /* FLASH BANK1 Write protected error flag */ - -/* System_Reset_Start_Mode */ -#define Start_Mode_USER ((uint32_t)0x00000000) -#define Start_Mode_BOOT ((uint32_t)0x00004000) - - /* ch32v00x_gpio.h ------------------------------------------------------------*/ - -#ifndef __ASSEMBLER__ - - /* Output Maximum frequency selection */ - typedef enum - { - GPIO_Speed_In = 0, - GPIO_Speed_10MHz, - GPIO_Speed_2MHz, - GPIO_Speed_50MHz - } GPIOSpeed_TypeDef; - -#endif - -#define GPIO_CNF_IN_ANALOG 0 -#define GPIO_CNF_IN_FLOATING 4 -#define GPIO_CNF_IN_PUPD 8 -#define GPIO_CNF_OUT_PP 0 -#define GPIO_CNF_OUT_OD 4 -#define GPIO_CNF_OUT_PP_AF 8 -#define GPIO_CNF_OUT_OD_AF 12 - - /* Configuration Mode enumeration */ - /* - typedef enum - { - GPIO_Mode_AIN = 0x0, - GPIO_Mode_IN_FLOATING = 0x04, - GPIO_Mode_IPD = 0x28, - GPIO_Mode_IPU = 0x48, - GPIO_Mode_Out_OD = 0x14, - GPIO_Mode_Out_PP = 0x10, - GPIO_Mode_AF_OD = 0x1C, - GPIO_Mode_AF_PP = 0x18 - } GPIOMode_TypeDef; - */ - -#ifndef __ASSEMBLER__ - - /* Bit_SET and Bit_RESET enumeration */ - typedef enum - { - Bit_RESET = 0, - Bit_SET - } BitAction; - -#endif - -/* GPIO_pins_define */ -#define GPIO_Pin_0 ((uint16_t)0x0001) /* Pin 0 selected */ -#define GPIO_Pin_1 ((uint16_t)0x0002) /* Pin 1 selected */ -#define GPIO_Pin_2 ((uint16_t)0x0004) /* Pin 2 selected */ -#define GPIO_Pin_3 ((uint16_t)0x0008) /* Pin 3 selected */ -#define GPIO_Pin_4 ((uint16_t)0x0010) /* Pin 4 selected */ -#define GPIO_Pin_5 ((uint16_t)0x0020) /* Pin 5 selected */ -#define GPIO_Pin_6 ((uint16_t)0x0040) /* Pin 6 selected */ -#define GPIO_Pin_7 ((uint16_t)0x0080) /* Pin 7 selected */ -#define GPIO_Pin_All ((uint16_t)0xFFFF) /* All pins selected */ - - /* GPIO_Remap_define */ - -#define GPIO_Remap_SPI1 ((uint32_t)0x00000001) /* SPI1 Alternate Function mapping */ -#define GPIO_PartialRemap_I2C1 ((uint32_t)0x10000002) /* I2C1 Partial Alternate Function mapping */ -#define GPIO_FullRemap_I2C1 ((uint32_t)0x10400002) /* I2C1 Full Alternate Function mapping */ -#define GPIO_PartialRemap1_USART1 ((uint32_t)0x80000004) /* USART1 Partial1 Alternate Function mapping */ -#define GPIO_PartialRemap2_USART1 ((uint32_t)0x80200000) /* USART1 Partial2 Alternate Function mapping */ -#define GPIO_FullRemap_USART1 ((uint32_t)0x80200004) /* USART1 Full Alternate Function mapping */ -#define GPIO_PartialRemap1_TIM1 ((uint32_t)0x00160040) /* TIM1 Partial1 Alternate Function mapping */ -#define GPIO_PartialRemap2_TIM1 ((uint32_t)0x00160080) /* TIM1 Partial2 Alternate Function mapping */ -#define GPIO_FullRemap_TIM1 ((uint32_t)0x001600C0) /* TIM1 Full Alternate Function mapping */ -#define GPIO_PartialRemap1_TIM2 ((uint32_t)0x00180100) /* TIM2 Partial1 Alternate Function mapping */ -#define GPIO_PartialRemap2_TIM2 ((uint32_t)0x00180200) /* TIM2 Partial2 Alternate Function mapping */ -#define GPIO_FullRemap_TIM2 ((uint32_t)0x00180300) /* TIM2 Full Alternate Function mapping */ -#define GPIO_Remap_PA1_2 ((uint32_t)0x00008000) /* PA1 and PA2 Alternate Function mapping */ -#define GPIO_Remap_ADC1_ETRGINJ ((uint32_t)0x00200002) /* ADC1 External Trigger Injected Conversion remapping */ -#define GPIO_Remap_ADC1_ETRGREG ((uint32_t)0x00200004) /* ADC1 External Trigger Regular Conversion remapping */ -#define GPIO_Remap_LSI_CAL ((uint32_t)0x00200080) /* LSI calibration Alternate Function mapping */ -#define GPIO_Remap_SDI_Disable ((uint32_t)0x00300400) /* SDI Disabled */ - -/* GPIO_Port_Sources */ -#define GPIO_PortSourceGPIOA ((uint8_t)0x00) -#define GPIO_PortSourceGPIOC ((uint8_t)0x02) -#define GPIO_PortSourceGPIOD ((uint8_t)0x03) - -/* GPIO_Pin_sources */ -#define GPIO_PinSource0 ((uint8_t)0x00) -#define GPIO_PinSource1 ((uint8_t)0x01) -#define GPIO_PinSource2 ((uint8_t)0x02) -#define GPIO_PinSource3 ((uint8_t)0x03) -#define GPIO_PinSource4 ((uint8_t)0x04) -#define GPIO_PinSource5 ((uint8_t)0x05) -#define GPIO_PinSource6 ((uint8_t)0x06) -#define GPIO_PinSource7 ((uint8_t)0x07) - -/* ch32v00x_i2c.h ------------------------------------------------------------*/ - -/* I2C_mode */ -#define I2C_Mode_I2C ((uint16_t)0x0000) - -/* I2C_duty_cycle_in_fast_mode */ -#define I2C_DutyCycle_16_9 ((uint16_t)0x4000) /* I2C fast mode Tlow/Thigh = 16/9 */ -#define I2C_DutyCycle_2 ((uint16_t)0xBFFF) /* I2C fast mode Tlow/Thigh = 2 */ - -/* I2C_acknowledgement */ -#define I2C_Ack_Enable ((uint16_t)0x0400) -#define I2C_Ack_Disable ((uint16_t)0x0000) - -/* I2C_transfer_direction */ -#define I2C_Direction_Transmitter ((uint8_t)0x00) -#define I2C_Direction_Receiver ((uint8_t)0x01) - -/* I2C_acknowledged_address */ -#define I2C_AcknowledgedAddress_7bit ((uint16_t)0x4000) -#define I2C_AcknowledgedAddress_10bit ((uint16_t)0xC000) - -/* I2C_registers */ -#define I2C_Register_CTLR1 ((uint8_t)0x00) -#define I2C_Register_CTLR2 ((uint8_t)0x04) -#define I2C_Register_OADDR1 ((uint8_t)0x08) -#define I2C_Register_OADDR2 ((uint8_t)0x0C) -#define I2C_Register_DATAR ((uint8_t)0x10) -#define I2C_Register_STAR1 ((uint8_t)0x14) -#define I2C_Register_STAR2 ((uint8_t)0x18) -#define I2C_Register_CKCFGR ((uint8_t)0x1C) - -/* I2C_PEC_position */ -#define I2C_PECPosition_Next ((uint16_t)0x0800) -#define I2C_PECPosition_Current ((uint16_t)0xF7FF) - -/* I2C_NACK_position */ -#define I2C_NACKPosition_Next ((uint16_t)0x0800) -#define I2C_NACKPosition_Current ((uint16_t)0xF7FF) - -/* I2C_interrupts_definition */ -#define I2C_IT_BUF ((uint16_t)0x0400) -#define I2C_IT_EVT ((uint16_t)0x0200) -#define I2C_IT_ERR ((uint16_t)0x0100) - -/* I2C_interrupts_definition */ -#define I2C_IT_PECERR ((uint32_t)0x01001000) -#define I2C_IT_OVR ((uint32_t)0x01000800) -#define I2C_IT_AF ((uint32_t)0x01000400) -#define I2C_IT_ARLO ((uint32_t)0x01000200) -#define I2C_IT_BERR ((uint32_t)0x01000100) -#define I2C_IT_TXE ((uint32_t)0x06000080) -#define I2C_IT_RXNE ((uint32_t)0x06000040) -#define I2C_IT_STOPF ((uint32_t)0x02000010) -#define I2C_IT_ADD10 ((uint32_t)0x02000008) -#define I2C_IT_BTF ((uint32_t)0x02000004) -#define I2C_IT_ADDR ((uint32_t)0x02000002) -#define I2C_IT_SB ((uint32_t)0x02000001) - -/* SR2 register flags */ -#define I2C_FLAG_DUALF ((uint32_t)0x00800000) -#define I2C_FLAG_GENCALL ((uint32_t)0x00100000) -#define I2C_FLAG_TRA ((uint32_t)0x00040000) -#define I2C_FLAG_BUSY ((uint32_t)0x00020000) -#define I2C_FLAG_MSL ((uint32_t)0x00010000) - -/* SR1 register flags */ -#define I2C_FLAG_PECERR ((uint32_t)0x10001000) -#define I2C_FLAG_OVR ((uint32_t)0x10000800) -#define I2C_FLAG_AF ((uint32_t)0x10000400) -#define I2C_FLAG_ARLO ((uint32_t)0x10000200) -#define I2C_FLAG_BERR ((uint32_t)0x10000100) -#define I2C_FLAG_TXE ((uint32_t)0x10000080) -#define I2C_FLAG_RXNE ((uint32_t)0x10000040) -#define I2C_FLAG_STOPF ((uint32_t)0x10000010) -#define I2C_FLAG_ADD10 ((uint32_t)0x10000008) -#define I2C_FLAG_BTF ((uint32_t)0x10000004) -#define I2C_FLAG_ADDR ((uint32_t)0x10000002) -#define I2C_FLAG_SB ((uint32_t)0x10000001) - -/****************I2C Master Events (Events grouped in order of communication)********************/ - -/******************************************************************************************************************** - * @brief Start communicate - * - * After master use I2C_GenerateSTART() function sending the START condition,the master - * has to wait for event 5(the Start condition has been correctly - * released on the I2C bus ). - * - */ -/* EVT5 */ -#define I2C_EVENT_MASTER_MODE_SELECT ((uint32_t)0x00030001) /* BUSY, MSL and SB flag */ - -/******************************************************************************************************************** - * @brief Address Acknowledge - * - * When start condition correctly released on the bus(check EVT5), the - * master use I2C_Send7bitAddress() function sends the address of the slave(s) with which it will communicate - * it also determines master as transmitter or Receiver. Then the master has to wait that a slave acknowledges - * his address. If an acknowledge is sent on the bus, one of the following events will be set: - * - * - * - * 1) In case of Master Receiver (7-bit addressing): the I2C_EVENT_MASTER_RECEIVER_MODE_SELECTED - * event is set. - * - * 2) In case of Master Transmitter (7-bit addressing): the I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED - * is set - * - * 3) In case of 10-Bit addressing mode, the master (after generating the START - * and checking on EVT5) use I2C_SendData() function send the header of 10-bit addressing mode. - * Then master wait EVT9. EVT9 means that the 10-bit addressing header has been correctly sent - * on the bus. Then master should use the function I2C_Send7bitAddress() to send the second part - * of the 10-bit address (LSB) . Then master should wait for event 6. - * - * - */ - -/* EVT6 */ -#define I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED ((uint32_t)0x00070082) /* BUSY, MSL, ADDR, TXE and TRA flags */ -#define I2C_EVENT_MASTER_RECEIVER_MODE_SELECTED ((uint32_t)0x00030002) /* BUSY, MSL and ADDR flags */ -/*EVT9 */ -#define I2C_EVENT_MASTER_MODE_ADDRESS10 ((uint32_t)0x00030008) /* BUSY, MSL and ADD10 flags */ - -/******************************************************************************************************************** - * @brief Communication events - * - * If START condition has generated and slave address - * been acknowledged. then the master has to check one of the following events for - * communication procedures: - * - * 1) Master Receiver mode: The master has to wait on the event EVT7 then use - * I2C_ReceiveData() function to read the data received from the slave . - * - * 2) Master Transmitter mode: The master use I2C_SendData() function to send data - * then to wait on event EVT8 or EVT8_2. - * These two events are similar: - * - EVT8 means that the data has been written in the data register and is - * being shifted out. - * - EVT8_2 means that the data has been physically shifted out and output - * on the bus. - * In most cases, using EVT8 is sufficient for the application. - * Using EVT8_2 will leads to a slower communication speed but will more reliable . - * EVT8_2 is also more suitable than EVT8 for testing on the last data transmission - * - * - * Note: - * In case the user software does not guarantee that this event EVT7 is managed before - * the current byte end of transfer, then user may check on I2C_EVENT_MASTER_BYTE_RECEIVED - * and I2C_FLAG_BTF flag at the same time .But in this case the communication may be slower. - * - * - */ - -/* Master Receive mode */ -/* EVT7 */ -#define I2C_EVENT_MASTER_BYTE_RECEIVED ((uint32_t)0x00030040) /* BUSY, MSL and RXNE flags */ - -/* Master Transmitter mode*/ -/* EVT8 */ -#define I2C_EVENT_MASTER_BYTE_TRANSMITTING ((uint32_t)0x00070080) /* TRA, BUSY, MSL, TXE flags */ -/* EVT8_2 */ -#define I2C_EVENT_MASTER_BYTE_TRANSMITTED ((uint32_t)0x00070084) /* TRA, BUSY, MSL, TXE and BTF flags */ - -/******************I2C Slave Events (Events grouped in order of communication)******************/ - -/******************************************************************************************************************** - * @brief Start Communicate events - * - * Wait on one of these events at the start of the communication. It means that - * the I2C peripheral detected a start condition of master device generate on the bus. - * If the acknowledge feature is enabled through function I2C_AcknowledgeConfig()),The peripheral generates an ACK condition on the bus. - * - * - * - * a) In normal case (only one address managed by the slave), when the address - * sent by the master matches the own address of the peripheral (configured by - * I2C_OwnAddress1 field) the I2C_EVENT_SLAVE_XXX_ADDRESS_MATCHED event is set - * (where XXX could be TRANSMITTER or RECEIVER). - * - * b) In case the address sent by the master matches the second address of the - * peripheral (configured by the function I2C_OwnAddress2Config() and enabled - * by the function I2C_DualAddressCmd()) the events I2C_EVENT_SLAVE_XXX_SECONDADDRESS_MATCHED - * (where XXX could be TRANSMITTER or RECEIVER) are set. - * - * c) In case the address sent by the master is General Call (address 0x00) and - * if the General Call is enabled for the peripheral (using function I2C_GeneralCallCmd()) - * the following event is set I2C_EVENT_SLAVE_GENERALCALLADDRESS_MATCHED. - * - */ - -/* EVT1 */ -/* a) Case of One Single Address managed by the slave */ -#define I2C_EVENT_SLAVE_RECEIVER_ADDRESS_MATCHED ((uint32_t)0x00020002) /* BUSY and ADDR flags */ -#define I2C_EVENT_SLAVE_TRANSMITTER_ADDRESS_MATCHED ((uint32_t)0x00060082) /* TRA, BUSY, TXE and ADDR flags */ - -/* b) Case of Dual address managed by the slave */ -#define I2C_EVENT_SLAVE_RECEIVER_SECONDADDRESS_MATCHED ((uint32_t)0x00820000) /* DUALF and BUSY flags */ -#define I2C_EVENT_SLAVE_TRANSMITTER_SECONDADDRESS_MATCHED ((uint32_t)0x00860080) /* DUALF, TRA, BUSY and TXE flags */ - -/* c) Case of General Call enabled for the slave */ -#define I2C_EVENT_SLAVE_GENERALCALLADDRESS_MATCHED ((uint32_t)0x00120000) /* GENCALL and BUSY flags */ - -/******************************************************************************************************************** - * @brief Communication events - * - * Wait on one of these events when EVT1 has already been checked : - * - * - Slave Receiver mode: - * - EVT2--The device is expecting to receive a data byte . - * - EVT4--The device is expecting the end of the communication: master - * sends a stop condition and data transmission is stopped. - * - * - Slave Transmitter mode: - * - EVT3--When a byte has been transmitted by the slave and the Master is expecting - * the end of the byte transmission. The two events I2C_EVENT_SLAVE_BYTE_TRANSMITTED and - * I2C_EVENT_SLAVE_BYTE_TRANSMITTING are similar. If the user software doesn't guarantee - * the EVT3 is managed before the current byte end of transfer The second one can optionally - * be used. - * - EVT3_2--When the master sends a NACK to tell slave device that data transmission - * shall end . The slave device has to stop sending - * data bytes and wait a Stop condition from bus. - * - * Note: - * If the user software does not guarantee that the event 2 is - * managed before the current byte end of transfer, User may check on I2C_EVENT_SLAVE_BYTE_RECEIVED - * and I2C_FLAG_BTF flag at the same time . - * In this case the communication will be slower. - * - */ - -/* Slave Receiver mode*/ -/* EVT2 */ -#define I2C_EVENT_SLAVE_BYTE_RECEIVED ((uint32_t)0x00020040) /* BUSY and RXNE flags */ -/* EVT4 */ -#define I2C_EVENT_SLAVE_STOP_DETECTED ((uint32_t)0x00000010) /* STOPF flag */ - -/* Slave Transmitter mode -----------------------*/ -/* EVT3 */ -#define I2C_EVENT_SLAVE_BYTE_TRANSMITTED ((uint32_t)0x00060084) /* TRA, BUSY, TXE and BTF flags */ -#define I2C_EVENT_SLAVE_BYTE_TRANSMITTING ((uint32_t)0x00060080) /* TRA, BUSY and TXE flags */ -/*EVT3_2 */ -#define I2C_EVENT_SLAVE_ACK_FAILURE ((uint32_t)0x00000400) /* AF flag */ - -/* ch32v00x_iwdg.h -----------------------------------------------------------*/ - -/* IWDG_WriteAccess */ -#define IWDG_WriteAccess_Enable ((uint16_t)0x5555) -#define IWDG_WriteAccess_Disable ((uint16_t)0x0000) - -/* IWDG_prescaler */ -#define IWDG_Prescaler_4 ((uint8_t)0x00) -#define IWDG_Prescaler_8 ((uint8_t)0x01) -#define IWDG_Prescaler_16 ((uint8_t)0x02) -#define IWDG_Prescaler_32 ((uint8_t)0x03) -#define IWDG_Prescaler_64 ((uint8_t)0x04) -#define IWDG_Prescaler_128 ((uint8_t)0x05) -#define IWDG_Prescaler_256 ((uint8_t)0x06) - -/* IWDG_Flag */ -#define IWDG_FLAG_PVU ((uint16_t)0x0001) -#define IWDG_FLAG_RVU ((uint16_t)0x0002) - -/* ch32v00x_misc.h -----------------------------------------------------------*/ - -/* Preemption_Priority_Group */ -#define NVIC_PriorityGroup_0 ((uint32_t)0x00) -#define NVIC_PriorityGroup_1 ((uint32_t)0x01) -#define NVIC_PriorityGroup_2 ((uint32_t)0x02) -#define NVIC_PriorityGroup_3 ((uint32_t)0x03) -#define NVIC_PriorityGroup_4 ((uint32_t)0x04) - -/* ch32v00x_opa.h ------------------------------------------------------------*/ - -/* Editor's note: I don't know if this is actually useful */ -#ifndef __ASSEMBLER__ - - /* OPA PSEL enumeration */ - typedef enum - { - CHP0 = 0, - CHP1 - } OPA_PSEL_TypeDef; - - /* OPA NSEL enumeration */ - typedef enum - { - CHN0 = 0, - CHN1 - } OPA_NSEL_TypeDef; - - /* OPA Init Structure definition */ - typedef struct - { - OPA_PSEL_TypeDef PSEL; /* Specifies the positive channel of OPA */ - OPA_NSEL_TypeDef NSEL; /* Specifies the negative channel of OPA */ - } OPA_InitTypeDef; - - /* memory mapped structure for Program Fast Interrupt Controller (PFIC) */ - typedef struct - { - __I uint32_t ISR[8]; - __I uint32_t IPR[8]; - __IO uint32_t ITHRESDR; - __IO uint32_t RESERVED; - __IO uint32_t CFGR; - __I uint32_t GISR; - __IO uint8_t VTFIDR[4]; - uint8_t RESERVED0[12]; - __IO uint32_t VTFADDR[4]; - uint8_t RESERVED1[0x90]; - __O uint32_t IENR[8]; - uint8_t RESERVED2[0x60]; - __O uint32_t IRER[8]; - uint8_t RESERVED3[0x60]; - __O uint32_t IPSR[8]; - uint8_t RESERVED4[0x60]; - __O uint32_t IPRR[8]; - uint8_t RESERVED5[0x60]; - __IO uint32_t IACTR[8]; - uint8_t RESERVED6[0xE0]; - __IO uint8_t IPRIOR[256]; - uint8_t RESERVED7[0x810]; - __IO uint32_t SCTLR; - } PFIC_Type; - -#endif - - /* ch32v00x_pwr.h ------------------------------------------------------------*/ - - /* PVD_detection_level */ - -#define PWR_PVDLevel_2V9 ((uint32_t)0x00000000) -#define PWR_PVDLevel_3V1 ((uint32_t)0x00000020) -#define PWR_PVDLevel_3V3 ((uint32_t)0x00000040) -#define PWR_PVDLevel_3V5 ((uint32_t)0x00000060) -#define PWR_PVDLevel_3V7 ((uint32_t)0x00000080) -#define PWR_PVDLevel_3V9 ((uint32_t)0x000000A0) -#define PWR_PVDLevel_4V1 ((uint32_t)0x000000C0) -#define PWR_PVDLevel_4V4 ((uint32_t)0x000000E0) - -/* PWR_AWU_Prescaler */ -#define PWR_AWU_Prescaler_1 ((uint32_t)0x00000000) -#define PWR_AWU_Prescaler_2 ((uint32_t)0x00000002) -#define PWR_AWU_Prescaler_4 ((uint32_t)0x00000003) -#define PWR_AWU_Prescaler_8 ((uint32_t)0x00000004) -#define PWR_AWU_Prescaler_16 ((uint32_t)0x00000005) -#define PWR_AWU_Prescaler_32 ((uint32_t)0x00000006) -#define PWR_AWU_Prescaler_64 ((uint32_t)0x00000007) -#define PWR_AWU_Prescaler_128 ((uint32_t)0x00000008) -#define PWR_AWU_Prescaler_256 ((uint32_t)0x00000009) -#define PWR_AWU_Prescaler_512 ((uint32_t)0x0000000A) -#define PWR_AWU_Prescaler_1024 ((uint32_t)0x0000000B) -#define PWR_AWU_Prescaler_2048 ((uint32_t)0x0000000C) -#define PWR_AWU_Prescaler_4096 ((uint32_t)0x0000000D) -#define PWR_AWU_Prescaler_10240 ((uint32_t)0x0000000E) -#define PWR_AWU_Prescaler_61440 ((uint32_t)0x0000000F) - -/* STOP_mode_entry */ -#define PWR_STANDBYEntry_WFI ((uint8_t)0x01) -#define PWR_STANDBYEntry_WFE ((uint8_t)0x02) - -/* PWR_Flag */ -#define PWR_FLAG_PVDO ((uint32_t)0x00000004) - -/* ch32v00x_rcc.h ------------------------------------------------------------*/ - -/* HSE_configuration */ -#define RCC_HSE_OFF ((uint32_t)0x00000000) -#define RCC_HSE_ON ((uint32_t)0x00010000) -#define RCC_HSE_Bypass ((uint32_t)0x00040000) - -/* PLL_entry_clock_source */ -#define RCC_PLLSource_HSI_MUL2 ((uint32_t)0x00000000) -#define RCC_PLLSource_HSE_MUL2 ((uint32_t)0x00030000) - -/* System_clock_source */ -#define RCC_SYSCLKSource_HSI ((uint32_t)0x00000000) -#define RCC_SYSCLKSource_HSE ((uint32_t)0x00000001) -#define RCC_SYSCLKSource_PLLCLK ((uint32_t)0x00000002) - -/* AHB_clock_source */ -#define RCC_SYSCLK_Div1 ((uint32_t)0x00000000) -#define RCC_SYSCLK_Div2 ((uint32_t)0x00000010) -#define RCC_SYSCLK_Div3 ((uint32_t)0x00000020) -#define RCC_SYSCLK_Div4 ((uint32_t)0x00000030) -#define RCC_SYSCLK_Div5 ((uint32_t)0x00000040) -#define RCC_SYSCLK_Div6 ((uint32_t)0x00000050) -#define RCC_SYSCLK_Div7 ((uint32_t)0x00000060) -#define RCC_SYSCLK_Div8 ((uint32_t)0x00000070) -#define RCC_SYSCLK_Div16 ((uint32_t)0x000000B0) -#define RCC_SYSCLK_Div32 ((uint32_t)0x000000C0) -#define RCC_SYSCLK_Div64 ((uint32_t)0x000000D0) -#define RCC_SYSCLK_Div128 ((uint32_t)0x000000E0) -#define RCC_SYSCLK_Div256 ((uint32_t)0x000000F0) - -/* RCC_Interrupt_source */ -#define RCC_IT_LSIRDY ((uint8_t)0x01) -#define RCC_IT_HSIRDY ((uint8_t)0x04) -#define RCC_IT_HSERDY ((uint8_t)0x08) -#define RCC_IT_PLLRDY ((uint8_t)0x10) -#define RCC_IT_CSS ((uint8_t)0x80) - -/* ADC_clock_source */ -#define RCC_PCLK2_Div2 ((uint32_t)0x00000000) -#define RCC_PCLK2_Div4 ((uint32_t)0x00004000) -#define RCC_PCLK2_Div6 ((uint32_t)0x00008000) -#define RCC_PCLK2_Div8 ((uint32_t)0x0000C000) -#define RCC_PCLK2_Div12 ((uint32_t)0x0000A000) -#define RCC_PCLK2_Div16 ((uint32_t)0x0000E000) -#define RCC_PCLK2_Div24 ((uint32_t)0x0000A800) -#define RCC_PCLK2_Div32 ((uint32_t)0x0000E800) -#define RCC_PCLK2_Div48 ((uint32_t)0x0000B000) -#define RCC_PCLK2_Div64 ((uint32_t)0x0000F000) -#define RCC_PCLK2_Div96 ((uint32_t)0x0000B800) -#define RCC_PCLK2_Div128 ((uint32_t)0x0000F800) - -/* AHB_peripheral */ -#define RCC_AHBPeriph_DMA1 ((uint32_t)0x00000001) -#define RCC_AHBPeriph_SRAM ((uint32_t)0x00000004) - -/* APB2_peripheral */ -#define RCC_APB2Periph_AFIO ((uint32_t)0x00000001) -#define RCC_APB2Periph_GPIOA ((uint32_t)0x00000004) -#define RCC_APB2Periph_GPIOC ((uint32_t)0x00000010) -#define RCC_APB2Periph_GPIOD ((uint32_t)0x00000020) -#define RCC_APB2Periph_ADC1 ((uint32_t)0x00000200) -#define RCC_APB2Periph_TIM1 ((uint32_t)0x00000800) -#define RCC_APB2Periph_SPI1 ((uint32_t)0x00001000) -#define RCC_APB2Periph_USART1 ((uint32_t)0x00004000) - -/* APB1_peripheral */ -#define RCC_APB1Periph_TIM2 ((uint32_t)0x00000001) -#define RCC_APB1Periph_WWDG ((uint32_t)0x00000800) -#define RCC_APB1Periph_I2C1 ((uint32_t)0x00200000) -#define RCC_APB1Periph_PWR ((uint32_t)0x10000000) - -/* Clock_source_to_output_on_MCO_pin */ -#define RCC_MCO_NoClock ((uint8_t)0x00) -#define RCC_MCO_SYSCLK ((uint8_t)0x04) -#define RCC_MCO_HSI ((uint8_t)0x05) -#define RCC_MCO_HSE ((uint8_t)0x06) -#define RCC_MCO_PLLCLK ((uint8_t)0x07) - -/* RCC_Flag */ -#define RCC_FLAG_HSIRDY ((uint8_t)0x21) -#define RCC_FLAG_HSERDY ((uint8_t)0x31) -#define RCC_FLAG_PLLRDY ((uint8_t)0x39) -#define RCC_FLAG_LSIRDY ((uint8_t)0x61) -#define RCC_FLAG_PINRST ((uint8_t)0x7A) -#define RCC_FLAG_PORRST ((uint8_t)0x7B) -#define RCC_FLAG_SFTRST ((uint8_t)0x7C) -#define RCC_FLAG_IWDGRST ((uint8_t)0x7D) -#define RCC_FLAG_WWDGRST ((uint8_t)0x7E) -#define RCC_FLAG_LPWRRST ((uint8_t)0x7F) - -/* SysTick_clock_source */ -#define SysTick_CLKSource_HCLK_Div8 ((uint32_t)0xFFFFFFFB) -#define SysTick_CLKSource_HCLK ((uint32_t)0x00000004) - -/* ch32v00x_spi.h ------------------------------------------------------------*/ - -/* SPI_data_direction */ -#define SPI_Direction_2Lines_FullDuplex ((uint16_t)0x0000) -#define SPI_Direction_2Lines_RxOnly ((uint16_t)0x0400) -#define SPI_Direction_1Line_Rx ((uint16_t)0x8000) -#define SPI_Direction_1Line_Tx ((uint16_t)0xC000) - -/* SPI_mode */ -#define SPI_Mode_Master ((uint16_t)0x0104) /* Sets MSTR, as well as SSI, which is required for Master Mode */ -#define SPI_Mode_Slave ((uint16_t)0x0000) - -/* SPI_data_size */ -#define SPI_DataSize_16b ((uint16_t)0x0800) -#define SPI_DataSize_8b ((uint16_t)0x0000) - -/* SPI_Clock_Polarity */ -#define SPI_CPOL_Low ((uint16_t)0x0000) -#define SPI_CPOL_High ((uint16_t)0x0002) - -/* SPI_Clock_Phase */ -#define SPI_CPHA_1Edge ((uint16_t)0x0000) -#define SPI_CPHA_2Edge ((uint16_t)0x0001) - -/* SPI_Slave_Select_management */ -#define SPI_NSS_Soft ((uint16_t)0x0200) -#define SPI_NSS_Hard ((uint16_t)0x0000) - -/* SPI_BaudRate_Prescaler */ -#define SPI_BaudRatePrescaler_2 ((uint16_t)0x0000) -#define SPI_BaudRatePrescaler_4 ((uint16_t)0x0008) -#define SPI_BaudRatePrescaler_8 ((uint16_t)0x0010) -#define SPI_BaudRatePrescaler_16 ((uint16_t)0x0018) -#define SPI_BaudRatePrescaler_32 ((uint16_t)0x0020) -#define SPI_BaudRatePrescaler_64 ((uint16_t)0x0028) -#define SPI_BaudRatePrescaler_128 ((uint16_t)0x0030) -#define SPI_BaudRatePrescaler_256 ((uint16_t)0x0038) - -/* SPI_MSB transmission */ -#define SPI_FirstBit_MSB ((uint16_t)0x0000) - -/* SPI_I2S_DMA_transfer_requests */ -#define SPI_I2S_DMAReq_Tx ((uint16_t)0x0002) -#define SPI_I2S_DMAReq_Rx ((uint16_t)0x0001) - -/* SPI_NSS_internal_software_management */ -#define SPI_NSSInternalSoft_Set ((uint16_t)0x0100) -#define SPI_NSSInternalSoft_Reset ((uint16_t)0xFEFF) - -/* SPI_CRC_Transmit_Receive */ -#define SPI_CRC_Tx ((uint8_t)0x00) -#define SPI_CRC_Rx ((uint8_t)0x01) - -/* SPI_direction_transmit_receive */ -#define SPI_Direction_Rx ((uint16_t)0xBFFF) -#define SPI_Direction_Tx ((uint16_t)0x4000) - -/* SPI_I2S_interrupts_definition */ -#define SPI_I2S_IT_TXE ((uint8_t)0x71) -#define SPI_I2S_IT_RXNE ((uint8_t)0x60) -#define SPI_I2S_IT_ERR ((uint8_t)0x50) -#define SPI_I2S_IT_OVR ((uint8_t)0x56) -#define SPI_IT_MODF ((uint8_t)0x55) -#define SPI_IT_CRCERR ((uint8_t)0x54) -#define I2S_IT_UDR ((uint8_t)0x53) - -/* SPI_I2S_flags_definition */ -#define SPI_I2S_FLAG_RXNE ((uint16_t)0x0001) -#define SPI_I2S_FLAG_TXE ((uint16_t)0x0002) -#define I2S_FLAG_CHSIDE ((uint16_t)0x0004) -#define I2S_FLAG_UDR ((uint16_t)0x0008) -#define SPI_FLAG_CRCERR ((uint16_t)0x0010) -#define SPI_FLAG_MODF ((uint16_t)0x0020) -#define SPI_I2S_FLAG_OVR ((uint16_t)0x0040) -#define SPI_I2S_FLAG_BSY ((uint16_t)0x0080) - -/* ch32v00x_tim.h ------------------------------------------------------------*/ - -/* TIM_Output_Compare_and_PWM_modes */ -#define TIM_OCMode_Timing ((uint16_t)0x0000) -#define TIM_OCMode_Active ((uint16_t)0x0010) -#define TIM_OCMode_Inactive ((uint16_t)0x0020) -#define TIM_OCMode_Toggle ((uint16_t)0x0030) -#define TIM_OCMode_PWM1 ((uint16_t)0x0060) -#define TIM_OCMode_PWM2 ((uint16_t)0x0070) - -/* TIM_One_Pulse_Mode */ -#define TIM_OPMode_Single ((uint16_t)0x0008) -#define TIM_OPMode_Repetitive ((uint16_t)0x0000) - -/* TIM_Channel */ -#define TIM_Channel_1 ((uint16_t)0x0000) -#define TIM_Channel_2 ((uint16_t)0x0004) -#define TIM_Channel_3 ((uint16_t)0x0008) -#define TIM_Channel_4 ((uint16_t)0x000C) - -/* TIM_Clock_Division_CKD */ -#define TIM_CKD_DIV1 ((uint16_t)0x0000) -#define TIM_CKD_DIV2 ((uint16_t)0x0100) -#define TIM_CKD_DIV4 ((uint16_t)0x0200) - -/* TIM_Counter_Mode */ -#define TIM_CounterMode_Up ((uint16_t)0x0000) -#define TIM_CounterMode_Down ((uint16_t)0x0010) -#define TIM_CounterMode_CenterAligned1 ((uint16_t)0x0020) -#define TIM_CounterMode_CenterAligned2 ((uint16_t)0x0040) -#define TIM_CounterMode_CenterAligned3 ((uint16_t)0x0060) - -/* TIM_Output_Compare_Polarity */ -#define TIM_OCPolarity_High ((uint16_t)0x0000) -#define TIM_OCPolarity_Low ((uint16_t)0x0002) - -/* TIM_Output_Compare_N_Polarity */ -#define TIM_OCNPolarity_High ((uint16_t)0x0000) -#define TIM_OCNPolarity_Low ((uint16_t)0x0008) - -/* TIM_Output_Compare_state */ -#define TIM_OutputState_Disable ((uint16_t)0x0000) -#define TIM_OutputState_Enable ((uint16_t)0x0001) - -/* TIM_Output_Compare_N_state */ -#define TIM_OutputNState_Disable ((uint16_t)0x0000) -#define TIM_OutputNState_Enable ((uint16_t)0x0004) - -/* TIM_Capture_Compare_state */ -#define TIM_CCx_Enable ((uint16_t)0x0001) -#define TIM_CCx_Disable ((uint16_t)0x0000) - -/* TIM_Capture_Compare_N_state */ -#define TIM_CCxN_Enable ((uint16_t)0x0004) -#define TIM_CCxN_Disable ((uint16_t)0x0000) - -/* Break_Input_enable_disable */ -#define TIM_Break_Enable ((uint16_t)0x1000) -#define TIM_Break_Disable ((uint16_t)0x0000) - -/* Break_Polarity */ -#define TIM_BreakPolarity_Low ((uint16_t)0x0000) -#define TIM_BreakPolarity_High ((uint16_t)0x2000) - -/* TIM_AOE_Bit_Set_Reset */ -#define TIM_AutomaticOutput_Enable ((uint16_t)0x4000) -#define TIM_AutomaticOutput_Disable ((uint16_t)0x0000) - -/* Lock_level */ -#define TIM_LOCKLevel_OFF ((uint16_t)0x0000) -#define TIM_LOCKLevel_1 ((uint16_t)0x0100) -#define TIM_LOCKLevel_2 ((uint16_t)0x0200) -#define TIM_LOCKLevel_3 ((uint16_t)0x0300) - -/* OSSI_Off_State_Selection_for_Idle_mode_state */ -#define TIM_OSSIState_Enable ((uint16_t)0x0400) -#define TIM_OSSIState_Disable ((uint16_t)0x0000) - -/* OSSR_Off_State_Selection_for_Run_mode_state */ -#define TIM_OSSRState_Enable ((uint16_t)0x0800) -#define TIM_OSSRState_Disable ((uint16_t)0x0000) - -/* TIM_Output_Compare_Idle_State */ -#define TIM_OCIdleState_Set ((uint16_t)0x0100) -#define TIM_OCIdleState_Reset ((uint16_t)0x0000) - -/* TIM_Output_Compare_N_Idle_State */ -#define TIM_OCNIdleState_Set ((uint16_t)0x0200) -#define TIM_OCNIdleState_Reset ((uint16_t)0x0000) - -/* TIM_Input_Capture_Polarity */ -#define TIM_ICPolarity_Rising ((uint16_t)0x0000) -#define TIM_ICPolarity_Falling ((uint16_t)0x0002) -#define TIM_ICPolarity_BothEdge ((uint16_t)0x000A) - -/* TIM_Input_Capture_Selection */ -#define TIM_ICSelection_DirectTI ((uint16_t)0x0001) /* TIM Input 1, 2, 3 or 4 is selected to be \ - connected to IC1, IC2, IC3 or IC4, respectively */ -#define TIM_ICSelection_IndirectTI ((uint16_t)0x0002) /* TIM Input 1, 2, 3 or 4 is selected to be \ - connected to IC2, IC1, IC4 or IC3, respectively. */ -#define TIM_ICSelection_TRC ((uint16_t)0x0003) /* TIM Input 1, 2, 3 or 4 is selected to be connected to TRC. */ - -/* TIM_Input_Capture_Prescaler */ -#define TIM_ICPSC_DIV1 ((uint16_t)0x0000) /* Capture performed each time an edge is detected on the capture input. */ -#define TIM_ICPSC_DIV2 ((uint16_t)0x0004) /* Capture performed once every 2 events. */ -#define TIM_ICPSC_DIV4 ((uint16_t)0x0008) /* Capture performed once every 4 events. */ -#define TIM_ICPSC_DIV8 ((uint16_t)0x000C) /* Capture performed once every 8 events. */ - -/* TIM_interrupt_sources */ -#define TIM_IT_Update ((uint16_t)0x0001) -#define TIM_IT_CC1 ((uint16_t)0x0002) -#define TIM_IT_CC2 ((uint16_t)0x0004) -#define TIM_IT_CC3 ((uint16_t)0x0008) -#define TIM_IT_CC4 ((uint16_t)0x0010) -#define TIM_IT_COM ((uint16_t)0x0020) -#define TIM_IT_Trigger ((uint16_t)0x0040) -#define TIM_IT_Break ((uint16_t)0x0080) - -/* TIM_DMA_Base_address */ -#define TIM_DMABase_CR1 ((uint16_t)0x0000) -#define TIM_DMABase_CR2 ((uint16_t)0x0001) -#define TIM_DMABase_SMCR ((uint16_t)0x0002) -#define TIM_DMABase_DIER ((uint16_t)0x0003) -#define TIM_DMABase_SR ((uint16_t)0x0004) -#define TIM_DMABase_EGR ((uint16_t)0x0005) -#define TIM_DMABase_CCMR1 ((uint16_t)0x0006) -#define TIM_DMABase_CCMR2 ((uint16_t)0x0007) -#define TIM_DMABase_CCER ((uint16_t)0x0008) -#define TIM_DMABase_CNT ((uint16_t)0x0009) -#define TIM_DMABase_PSC ((uint16_t)0x000A) -#define TIM_DMABase_ARR ((uint16_t)0x000B) -#define TIM_DMABase_RCR ((uint16_t)0x000C) -#define TIM_DMABase_CCR1 ((uint16_t)0x000D) -#define TIM_DMABase_CCR2 ((uint16_t)0x000E) -#define TIM_DMABase_CCR3 ((uint16_t)0x000F) -#define TIM_DMABase_CCR4 ((uint16_t)0x0010) -#define TIM_DMABase_BDTR ((uint16_t)0x0011) -#define TIM_DMABase_DCR ((uint16_t)0x0012) - -/* TIM_DMA_Burst_Length */ -#define TIM_DMABurstLength_1Transfer ((uint16_t)0x0000) -#define TIM_DMABurstLength_2Transfers ((uint16_t)0x0100) -#define TIM_DMABurstLength_3Transfers ((uint16_t)0x0200) -#define TIM_DMABurstLength_4Transfers ((uint16_t)0x0300) -#define TIM_DMABurstLength_5Transfers ((uint16_t)0x0400) -#define TIM_DMABurstLength_6Transfers ((uint16_t)0x0500) -#define TIM_DMABurstLength_7Transfers ((uint16_t)0x0600) -#define TIM_DMABurstLength_8Transfers ((uint16_t)0x0700) -#define TIM_DMABurstLength_9Transfers ((uint16_t)0x0800) -#define TIM_DMABurstLength_10Transfers ((uint16_t)0x0900) -#define TIM_DMABurstLength_11Transfers ((uint16_t)0x0A00) -#define TIM_DMABurstLength_12Transfers ((uint16_t)0x0B00) -#define TIM_DMABurstLength_13Transfers ((uint16_t)0x0C00) -#define TIM_DMABurstLength_14Transfers ((uint16_t)0x0D00) -#define TIM_DMABurstLength_15Transfers ((uint16_t)0x0E00) -#define TIM_DMABurstLength_16Transfers ((uint16_t)0x0F00) -#define TIM_DMABurstLength_17Transfers ((uint16_t)0x1000) -#define TIM_DMABurstLength_18Transfers ((uint16_t)0x1100) - -/* TIM_DMA_sources */ -#define TIM_DMA_Update ((uint16_t)0x0100) -#define TIM_DMA_CC1 ((uint16_t)0x0200) -#define TIM_DMA_CC2 ((uint16_t)0x0400) -#define TIM_DMA_CC3 ((uint16_t)0x0800) -#define TIM_DMA_CC4 ((uint16_t)0x1000) -#define TIM_DMA_COM ((uint16_t)0x2000) -#define TIM_DMA_Trigger ((uint16_t)0x4000) - -/* TIM_External_Trigger_Prescaler */ -#define TIM_ExtTRGPSC_OFF ((uint16_t)0x0000) -#define TIM_ExtTRGPSC_DIV2 ((uint16_t)0x1000) -#define TIM_ExtTRGPSC_DIV4 ((uint16_t)0x2000) -#define TIM_ExtTRGPSC_DIV8 ((uint16_t)0x3000) - -/* TIM_Internal_Trigger_Selection */ -#define TIM_TS_ITR0 ((uint16_t)0x0000) -#define TIM_TS_ITR1 ((uint16_t)0x0010) -#define TIM_TS_ITR2 ((uint16_t)0x0020) -#define TIM_TS_ITR3 ((uint16_t)0x0030) -#define TIM_TS_TI1F_ED ((uint16_t)0x0040) -#define TIM_TS_TI1FP1 ((uint16_t)0x0050) -#define TIM_TS_TI2FP2 ((uint16_t)0x0060) -#define TIM_TS_ETRF ((uint16_t)0x0070) - -/* TIM_TIx_External_Clock_Source */ -#define TIM_TIxExternalCLK1Source_TI1 ((uint16_t)0x0050) -#define TIM_TIxExternalCLK1Source_TI2 ((uint16_t)0x0060) -#define TIM_TIxExternalCLK1Source_TI1ED ((uint16_t)0x0040) - -/* TIM_External_Trigger_Polarity */ -#define TIM_ExtTRGPolarity_Inverted ((uint16_t)0x8000) -#define TIM_ExtTRGPolarity_NonInverted ((uint16_t)0x0000) - -/* TIM_Prescaler_Reload_Mode */ -#define TIM_PSCReloadMode_Update ((uint16_t)0x0000) -#define TIM_PSCReloadMode_Immediate ((uint16_t)0x0001) - -/* TIM_Forced_Action */ -#define TIM_ForcedAction_Active ((uint16_t)0x0050) -#define TIM_ForcedAction_InActive ((uint16_t)0x0040) - -/* TIM_Encoder_Mode */ -#define TIM_EncoderMode_TI1 ((uint16_t)0x0001) -#define TIM_EncoderMode_TI2 ((uint16_t)0x0002) -#define TIM_EncoderMode_TI12 ((uint16_t)0x0003) - -/* TIM_Event_Source */ -#define TIM_EventSource_Update ((uint16_t)0x0001) -#define TIM_EventSource_CC1 ((uint16_t)0x0002) -#define TIM_EventSource_CC2 ((uint16_t)0x0004) -#define TIM_EventSource_CC3 ((uint16_t)0x0008) -#define TIM_EventSource_CC4 ((uint16_t)0x0010) -#define TIM_EventSource_COM ((uint16_t)0x0020) -#define TIM_EventSource_Trigger ((uint16_t)0x0040) -#define TIM_EventSource_Break ((uint16_t)0x0080) - -/* TIM_Update_Source */ -#define TIM_UpdateSource_Global ((uint16_t)0x0000) /* Source of update is the counter overflow/underflow \ - or the setting of UG bit, or an update generation \ - through the slave mode controller. */ -#define TIM_UpdateSource_Regular ((uint16_t)0x0001) /* Source of update is counter overflow/underflow. */ - -/* TIM_Output_Compare_Preload_State */ -#define TIM_OCPreload_Enable ((uint16_t)0x0008) -#define TIM_OCPreload_Disable ((uint16_t)0x0000) - -/* TIM_Output_Compare_Fast_State */ -#define TIM_OCFast_Enable ((uint16_t)0x0004) -#define TIM_OCFast_Disable ((uint16_t)0x0000) - -/* TIM_Output_Compare_Clear_State */ -#define TIM_OCClear_Enable ((uint16_t)0x0080) -#define TIM_OCClear_Disable ((uint16_t)0x0000) - -/* TIM_Trigger_Output_Source */ -#define TIM_TRGOSource_Reset ((uint16_t)0x0000) -#define TIM_TRGOSource_Enable ((uint16_t)0x0010) -#define TIM_TRGOSource_Update ((uint16_t)0x0020) -#define TIM_TRGOSource_OC1 ((uint16_t)0x0030) -#define TIM_TRGOSource_OC1Ref ((uint16_t)0x0040) -#define TIM_TRGOSource_OC2Ref ((uint16_t)0x0050) -#define TIM_TRGOSource_OC3Ref ((uint16_t)0x0060) -#define TIM_TRGOSource_OC4Ref ((uint16_t)0x0070) - -/* TIM_Slave_Mode */ -#define TIM_SlaveMode_Reset ((uint16_t)0x0004) -#define TIM_SlaveMode_Gated ((uint16_t)0x0005) -#define TIM_SlaveMode_Trigger ((uint16_t)0x0006) -#define TIM_SlaveMode_External1 ((uint16_t)0x0007) - -/* TIM_Master_Slave_Mode */ -#define TIM_MasterSlaveMode_Enable ((uint16_t)0x0080) -#define TIM_MasterSlaveMode_Disable ((uint16_t)0x0000) - -/* TIM_Flags */ -#define TIM_FLAG_Update ((uint16_t)0x0001) -#define TIM_FLAG_CC1 ((uint16_t)0x0002) -#define TIM_FLAG_CC2 ((uint16_t)0x0004) -#define TIM_FLAG_CC3 ((uint16_t)0x0008) -#define TIM_FLAG_CC4 ((uint16_t)0x0010) -#define TIM_FLAG_COM ((uint16_t)0x0020) -#define TIM_FLAG_Trigger ((uint16_t)0x0040) -#define TIM_FLAG_Break ((uint16_t)0x0080) -#define TIM_FLAG_CC1OF ((uint16_t)0x0200) -#define TIM_FLAG_CC2OF ((uint16_t)0x0400) -#define TIM_FLAG_CC3OF ((uint16_t)0x0800) -#define TIM_FLAG_CC4OF ((uint16_t)0x1000) - -/* TIM_Legacy */ -#define TIM_DMABurstLength_1Byte TIM_DMABurstLength_1Transfer -#define TIM_DMABurstLength_2Bytes TIM_DMABurstLength_2Transfers -#define TIM_DMABurstLength_3Bytes TIM_DMABurstLength_3Transfers -#define TIM_DMABurstLength_4Bytes TIM_DMABurstLength_4Transfers -#define TIM_DMABurstLength_5Bytes TIM_DMABurstLength_5Transfers -#define TIM_DMABurstLength_6Bytes TIM_DMABurstLength_6Transfers -#define TIM_DMABurstLength_7Bytes TIM_DMABurstLength_7Transfers -#define TIM_DMABurstLength_8Bytes TIM_DMABurstLength_8Transfers -#define TIM_DMABurstLength_9Bytes TIM_DMABurstLength_9Transfers -#define TIM_DMABurstLength_10Bytes TIM_DMABurstLength_10Transfers -#define TIM_DMABurstLength_11Bytes TIM_DMABurstLength_11Transfers -#define TIM_DMABurstLength_12Bytes TIM_DMABurstLength_12Transfers -#define TIM_DMABurstLength_13Bytes TIM_DMABurstLength_13Transfers -#define TIM_DMABurstLength_14Bytes TIM_DMABurstLength_14Transfers -#define TIM_DMABurstLength_15Bytes TIM_DMABurstLength_15Transfers -#define TIM_DMABurstLength_16Bytes TIM_DMABurstLength_16Transfers -#define TIM_DMABurstLength_17Bytes TIM_DMABurstLength_17Transfers -#define TIM_DMABurstLength_18Bytes TIM_DMABurstLength_18Transfers - -/* ch32v00x_usart.h ----------------------------------------------------------*/ - -/* USART_Word_Length */ -#define USART_WordLength_8b ((uint16_t)0x0000) -#define USART_WordLength_9b ((uint16_t)0x1000) - -/* USART_Stop_Bits */ -#define USART_StopBits_1 ((uint16_t)0x0000) -#define USART_StopBits_0_5 ((uint16_t)0x1000) -#define USART_StopBits_2 ((uint16_t)0x2000) -#define USART_StopBits_1_5 ((uint16_t)0x3000) - -/* USART_Parity */ -#define USART_Parity_No ((uint16_t)0x0000) -#define USART_Parity_Even ((uint16_t)0x0400) -#define USART_Parity_Odd ((uint16_t)0x0600) - -/* USART_Mode */ -#define USART_Mode_Rx ((uint16_t)0x0004) -#define USART_Mode_Tx ((uint16_t)0x0008) - -/* USART_Hardware_Flow_Control */ -#define USART_HardwareFlowControl_None ((uint16_t)0x0000) -#define USART_HardwareFlowControl_RTS ((uint16_t)0x0100) -#define USART_HardwareFlowControl_CTS ((uint16_t)0x0200) -#define USART_HardwareFlowControl_RTS_CTS ((uint16_t)0x0300) - -/* USART_Clock */ -#define USART_Clock_Disable ((uint16_t)0x0000) -#define USART_Clock_Enable ((uint16_t)0x0800) - -/* USART_Clock_Polarity */ -#define USART_CPOL_Low ((uint16_t)0x0000) -#define USART_CPOL_High ((uint16_t)0x0400) - -/* USART_Clock_Phase */ -#define USART_CPHA_1Edge ((uint16_t)0x0000) -#define USART_CPHA_2Edge ((uint16_t)0x0200) - -/* USART_Last_Bit */ -#define USART_LastBit_Disable ((uint16_t)0x0000) -#define USART_LastBit_Enable ((uint16_t)0x0100) - -/* USART_Interrupt_definition */ -#define USART_IT_PE ((uint16_t)0x0028) -#define USART_IT_TXE ((uint16_t)0x0727) -#define USART_IT_TC ((uint16_t)0x0626) -#define USART_IT_RXNE ((uint16_t)0x0525) -#define USART_IT_ORE_RX ((uint16_t)0x0325) -#define USART_IT_IDLE ((uint16_t)0x0424) -#define USART_IT_LBD ((uint16_t)0x0846) -#define USART_IT_CTS ((uint16_t)0x096A) -#define USART_IT_ERR ((uint16_t)0x0060) -#define USART_IT_ORE_ER ((uint16_t)0x0360) -#define USART_IT_NE ((uint16_t)0x0260) -#define USART_IT_FE ((uint16_t)0x0160) - -#define USART_IT_ORE USART_IT_ORE_ER - -/* USART_DMA_Requests */ -#define USART_DMAReq_Tx ((uint16_t)0x0080) -#define USART_DMAReq_Rx ((uint16_t)0x0040) - -/* USART_WakeUp_methods */ -#define USART_WakeUp_IdleLine ((uint16_t)0x0000) -#define USART_WakeUp_AddressMark ((uint16_t)0x0800) - -/* USART_LIN_Break_Detection_Length */ -#define USART_LINBreakDetectLength_10b ((uint16_t)0x0000) -#define USART_LINBreakDetectLength_11b ((uint16_t)0x0020) - -/* USART_IrDA_Low_Power */ -#define USART_IrDAMode_LowPower ((uint16_t)0x0004) -#define USART_IrDAMode_Normal ((uint16_t)0x0000) - -/* USART_Flags */ -#define USART_FLAG_CTS ((uint16_t)0x0200) -#define USART_FLAG_LBD ((uint16_t)0x0100) -#define USART_FLAG_TXE ((uint16_t)0x0080) -#define USART_FLAG_TC ((uint16_t)0x0040) -#define USART_FLAG_RXNE ((uint16_t)0x0020) -#define USART_FLAG_IDLE ((uint16_t)0x0010) -#define USART_FLAG_ORE ((uint16_t)0x0008) -#define USART_FLAG_NE ((uint16_t)0x0004) -#define USART_FLAG_FE ((uint16_t)0x0002) -#define USART_FLAG_PE ((uint16_t)0x0001) - -// While not truly CH32X035, we can re-use some of the USB register defs. - -/* ch32v30x_usb.h ------------------------------------------------------------*/ - -/* ch32v00x_wwdg.h -----------------------------------------------------------*/ - -/* WWDG_Prescaler */ -#define WWDG_Prescaler_1 ((uint32_t)0x00000000) -#define WWDG_Prescaler_2 ((uint32_t)0x00000080) -#define WWDG_Prescaler_4 ((uint32_t)0x00000100) -#define WWDG_Prescaler_8 ((uint32_t)0x00000180) - -#ifdef __cplusplus -}; -#endif - -// For debug writing to the debug interface. -#ifndef MINICHLINK -#define DMDATA0 ((volatile uint32_t *)0xe00000f4) -#define DMDATA1 ((volatile uint32_t *)0xe00000f8) -#define DMSTATUS_SENTINEL ((volatile uint32_t *)0xe00000fc) // Reads as 0x00000000 if debugger is attached. -#endif - -// Determination of PLL multiplication factor for non-V003 chips - -// xw_ext.inc, thanks to @macyler, @jnk0le, @duk for this reverse engineering. - -/* -Encoder for some of the proprietary 'XW' RISC-V instructions present on the QingKe RV32 processor. -Examples: - XW_C_LBU(a3, a1, 27); // c.xw.lbu a3, 27(a1) - XW_C_SB(a0, s0, 13); // c.xw.sb a0, 13(s0) - - XW_C_LHU(a5, a5, 38); // c.xw.lhu a5, 38(a5) - XW_C_SH(a2, s1, 14); // c.xw.sh a2, 14(s1) -*/ - -// Let us do some compile-time error checking. -#define ASM_ASSERT(COND) \ - .if (!(COND)); \ - .err; \ - .endif - -// Integer encodings of the possible compressed registers. -#define C_s0 0 -#define C_s1 1 -#define C_a0 2 -#define C_a1 3 -#define C_a2 4 -#define C_a3 5 -#define C_a4 6 -#define C_a5 7 - -// register to encoding -#define REG2I(X) (C_##X) - -// XW opcodes -#define XW_OP_LBUSP 0b1000000000000000 -#define XW_OP_STSP 0b1000000001000000 - -#define XW_OP_LHUSP 0b1000000000100000 -#define XW_OP_SHSP 0b1000000001100000 - -#define XW_OP_LBU 0b0010000000000000 -#define XW_OP_SB 0b1010000000000000 - -#define XW_OP_LHU 0b0010000000000010 -#define XW_OP_SH 0b1010000000000010 - -// The two different XW encodings supported at the moment. -#define XW_ENCODE1(OP, R1, R2, IMM) \ - ASM_ASSERT((IMM) >= 0 && (IMM) < 32); \ - .2byte((OP) | (REG2I(R1) << 2) | (REG2I(R2) << 7) | \ - (((IMM) & 0b1) << 12) | (((IMM) & 0b110) << (5 - 1)) | (((IMM) & 0b11000) << (10 - 3))) - -#define XW_ENCODE2(OP, R1, R2, IMM) \ - ASM_ASSERT((IMM) >= 0 && (IMM) < 32); .2byte ((OP) | (REG2I(R1) << 2) | (REG2I(R2) << 7) | \ - (((IMM) & 0b11) << 5) | (((IMM) & 0b11100) << (10 - 2)) - -// Compressed load byte, zero-extend result -#define XW_C_LBU(RD, RS, IMM) XW_ENCODE1(XW_OP_LBU, RD, RS, IMM) - -// Compressed store byte -#define XW_C_SB(RS1, RS2, IMM) XW_ENCODE1(XW_OP_SB, RS1, RS2, IMM) - -// Compressed load half, zero-extend result -#define XW_C_LHU(RD, RS, IMM) \ - ASM_ASSERT(((IMM) & 1) == 0); XW_ENCODE2(XW_OP_LHU, RD, RS, ((IMM) >> 1))) - -// Compressed store half -#define XW_C_SH(RS1, RS2, IMM) \ - ASM_ASSERT(((IMM) & 1) == 0); XW_ENCODE2(XW_OP_SH, RS1, RS2, ((IMM) >> 1))) - -// Applies to all processors - -/* some bit definitions for systick regs */ -#define SYSTICK_SR_CNTIF (1 << 0) -#define SYSTICK_CTLR_STE (1 << 0) -#define SYSTICK_CTLR_STIE (1 << 1) -#define SYSTICK_CTLR_STCLK (1 << 2) -#define SYSTICK_CTLR_STRE (1 << 3) -#define SYSTICK_CTLR_SWIE (1 << 31) - -#define PFIC ((PFIC_Type *)PFIC_BASE) -#define NVIC PFIC -#define NVIC_KEY1 ((uint32_t)0xFA050000) -#define NVIC_KEY2 ((uint32_t)0xBCAF0000) -#define NVIC_KEY3 ((uint32_t)0xBEEF0000) - -#define SysTick ((SysTick_Type *)SysTick_BASE) - -#define PA1 1 -#define PA2 2 -#define PC0 32 -#define PC1 33 -#define PC2 34 -#define PC3 35 -#define PC4 36 -#define PC5 37 -#define PC6 38 -#define PC7 39 -#define PD0 48 -#define PD1 49 -#define PD2 50 -#define PD3 51 -#define PD4 52 -#define PD5 53 -#define PD6 54 -#define PD7 55 - -/* - * This file contains various parts of the official WCH EVT Headers which - * were originally under a restrictive license. - * - * The collection of this file was generated by - * cnlohr, 2023-02-18 and - * AlexanderMandera, 2023-06-23 - * It was significantly reworked into several files cnlohr, 2025-01-29 - * - * While originally under a restrictive copyright, WCH has approved use - * under MIT-licensed use, because of inclusion in Zephyr, as well as other - * open-source licensed projects. - * - * These copies of the headers from WCH are available now under: - * - * Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the “Softwareâ€), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED “AS ISâ€, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ - -#endif // Header guard diff --git a/inc/funconfig.h b/inc/funconfig.h deleted file mode 100644 index 998cf76..0000000 --- a/inc/funconfig.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _FUNCONFIG_H -#define _FUNCONFIG_H - -#define CH32V003 1 - -#endif - diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dd1c4e9..71bbe40 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,28 +1,19 @@ add_executable(${PROJECT_NAME} - main.c + main.c + ch32fun.c ) target_include_directories(${PROJECT_NAME} PUBLIC + ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/extralibs - ${CMAKE_SOURCE_DIR}/ch32fun ) target_link_libraries(${PROJECT_NAME} - ch32fun - #libgcc - #${CMAKE_SOURCE_DIR}/libgcc.a + #ch32fun ) -target_link_options(${PROJECT_NAME} PRIVATE - -Wl,--print-memory-usage - -Wl,-Map=${PROJECT_NAME}.map - -lgcc - -Wl,--gc-sections - -T ${CMAKE_SOURCE_DIR}/src/linker_script.ld - ) - -target_compile_options(${PROJECT_NAME} PRIVATE +target_compile_options(${PROJECT_NAME} PUBLIC -g -Os -flto @@ -35,7 +26,31 @@ target_compile_options(${PROJECT_NAME} PRIVATE -DCH32V003=1 -static-libgcc -nostdlib - -Wall + -Wl,--print-memory-usage + -Wl,-Map=${PROJECT_NAME}.map + -lgcc + -Wl,--gc-sections + -T${CMAKE_SOURCE_DIR}/src/linker_script.ld +) + +target_link_options(${PROJECT_NAME} PUBLIC + -g + -Os + -flto + -ffunction-sections + -fdata-sections + -fmessage-length=0 + -msmall-data-limit=8 + -march=rv32ec + -mabi=ilp32e + -DCH32V003=1 + -static-libgcc + -nostdlib + -Wl,--print-memory-usage + -Wl,-Map=${PROJECT_NAME}.map + -lgcc + -Wl,--gc-sections + -T${CMAKE_SOURCE_DIR}/src/linker_script.ld ) @@ -57,11 +72,4 @@ set_target_properties(${PROJECT_NAME} PROPERTIES SUFFIX ".elf") -#add_library(libgcc STATIC IMPORTED) -#set_target_properties(libgcc PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/libgcc.a) - - - -add_subdirectory(ch32fun) -#add_subdirectory(extralibs) add_subdirectory(attic) diff --git a/src/ch32fun/CMakeLists.txt b/src/ch32fun/CMakeLists.txt deleted file mode 100644 index 40c604c..0000000 --- a/src/ch32fun/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ - -add_library(ch32fun OBJECT - ch32fun.c -) - -target_include_directories(ch32fun PUBLIC - ${CMAKE_CURRENT_LIST_DIR} - ${CMAKE_SOURCE_DIR}/inc - ${CMAKE_SOURCE_DIR}/src/extralibs - ${CMAKE_SOURCE_DIR}/src/ch32fun -) - -target_compile_options(ch32fun PRIVATE - -g - -Os - -flto - -ffunction-sections - -fdata-sections - -fmessage-length=0 - -msmall-data-limit=8 - -march=rv32ec - -mabi=ilp32e - -DCH32V003=1 - -static-libgcc - -nostdlib - -Wall -) - -#target_link_libraries(ch32fun PRIVATE -# ${CMAKE_SOURCE_DIR}/libgcc.a -#) - diff --git a/src/ch32fun/README.md b/src/ch32fun/README.md deleted file mode 100644 index d80619a..0000000 --- a/src/ch32fun/README.md +++ /dev/null @@ -1,44 +0,0 @@ -## Update Status Overview -|PERIPHERAL |V003|V00x|V10x|V20x|V30x|X035|L103|M030| -|:-------------|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:| -|DPAL Header\* |2.0 | x |2.7 | x | x | √ | × | × | -|ADC |1.9 | x |2.1 | x | x |1.3 | × | × | -|AWU |N/A |N/A |N/A |N/A |N/A | √ |N/A |N/A | -|BKP |N/A |N/A |2.1 | x | x |N/A | × |N/A | -|CAN |N/A |N/A |N/A | x | x |N/A | × |N/A | -|CRC |N/A |N/A |2.1 | x | x |N/A | × |N/A | -|DAC |N/A |N/A |N/A |N/A | x |N/A |N/A |N/A | -|DBGMCU |1.5 | x |2.1 | x | x | √ | × | × | -|DMA | √ | x | √ | x | x | √ | × | × | -|DVP |N/A |N/A |N/A |N/A | x |N/A |N/A |N/A | -|ETH |N/A |N/A |N/A |N/A | x |N/A |N/A |N/A | -|EXIT | √ | x |2.4 | x | x | √ | × | × | -|FLASH | √ | x |2.7 | x | x |1.4 | × | × | -|FSMC |N/A |N/A |N/A |N/A | x |N/A |N/A |N/A | -|GPIO |2.0 | x |2.7 | x | x |1.6 | × | × | -|I2C | √ | x | √ | x | x |1.7 | × | × | -|IWDG | √ | x | √ | x | x | √ | × |N/A | -|LPTIM |N/A |N/A |N/A |N/A |N/A |N/A | × |N/A | -|MISC | √ | x |2.4 | x | x |1.6 | × |N/A | -|OPA | √ | x |N/A | x | x |1.3 | × | × | -|PWR |1.9 | x |2.6 | x | x |1.7 | × | × | -|RCC |1.8 | x |2.7 | x | x | √ | × | × | -|RNG |N/A |N/A |N/A |N/A | x |N/A |N/A |N/A | -|RTC |N/A |N/A | √ | x | x |N/A | × |N/A | -|SPI |1.9 | x |2.7 | x | x |1.7 | × | × | -|TIM |1.6 | x | √ | x | x | √ | × | × | -|USART | √ | x |2.4 | x | x | √ | × | × | -|USB |N/A |N/A | √ | x | x |1.8 | × | × | -|USB_HOST |N/A |N/A | √ |N/A |N/A |N/A |N/A |N/A | -|USBPD |N/A |N/A |N/A |N/A |N/A | x | × | × | -|WWWDG | √ | x | √ | x | x | √ | × | × | -|**chxxxhw.h** | √ | x | √ | √ | √ | √ | x | x | -|**minichlink**| √ | x | √ | √ | √ | √ | x | x | - -* n.m: Last commit message of the header file in ch32xxx/EVT/EXAM/SRC/Peripheral/inc -* √: Merged in , version unspecified -* ×: Not merged / Unchecked -* +: Work in progress -* N/A: No header file with this suffix in EVT, does not mean that the feature is not supported - -\* DPAL Header: Device Peripheral Access Layer Header File, normally named as ch32xxx.h diff --git a/src/ch32fun/ch32fun.c b/src/ch32fun/ch32fun.c deleted file mode 100755 index b628086..0000000 --- a/src/ch32fun/ch32fun.c +++ /dev/null @@ -1,1684 +0,0 @@ -// Mixture of embedlibc, and ch32v00x_startup.c -// Use with newlib headers. -// Mixture of weblibc, mini-printf and ??? -/* This file contains the following functions: - -// libc (via musl) mixture and miniprintf - -int printf( const char* format, ... ) -int vprintf(const char* format, va_list args) -int snprintf( char * buffer, unsigned int buffer_len, const char* format, ... ) -int sprintf( char * buffer, const char * format, ... ) -size_t wcrtomb(char *restrict s, wchar_t wc, mbstate_t *restrict st) -int wctomb(char *s, wchar_t wc) -size_t strlen(const char *s) -size_t strnlen(const char *s, size_t n) -void *memset(void *dest, int c, size_t n) -char *strcpy(char *d, const char *s) -char *strncpy(char *d, const char *s, size_t n) -int strcmp(const char *l, const char *r) -int strncmp(const char *_l, const char *_r, size_t n) -static char *twobyte_strstr(const unsigned char *h, const unsigned char *n) -static char *threebyte_strstr(const unsigned char *h, const unsigned char *n) -static char *fourbyte_strstr(const unsigned char *h, const unsigned char *n) -static char *twoway_strstr(const unsigned char *h, const unsigned char *n) -char *strstr(const char *h, const char *n) -char *strchr(const char *s, int c) -void *__memrchr(const void *m, int c, size_t n) -char *strrchr(const char *s, int c) -void *memcpy(void *dest, const void *src, size_t n) -int memcmp(const void *vl, const void *vr, size_t n) -void *memmove(void *dest, const void *src, size_t n) -void *memchr(const void *src, int c, size_t n) -int puts(const char *s) -int mini_itoa(long value, unsigned int radix, int uppercase, int unsig, - char *buffer) -int mini_vsnprintf(char *buffer, unsigned int buffer_len, const char *fmt, va_list va) -int mini_vpprintf(int (*puts)(char* s, int len, void* buf), void* buf, const char *fmt, va_list va) -int mini_snprintf(char* buffer, unsigned int buffer_len, const char *fmt, ...) -int mini_pprintf(int (*puts)(char*s, int len, void* buf), void* buf, const char *fmt, ...) - -// IRQ Handling Code -void DefaultIRQHandler( void ) -void NMI_RCC_CSS_IRQHandler( void ) - -// Startup Code -void InterruptVectorDefault( void ) -void handle_reset( void ) - -// Configuration-specific I/O - -#if defined( FUNCONF_USE_UARTPRINTF ) && FUNCONF_USE_UARTPRINTF -void SetupUART( int uartBRR ) -int _write(int fd, const char *buf, int size) -int putchar(int c) -#endif - -#if defined( FUNCONF_USE_DEBUGPRINTF ) && FUNCONF_USE_DEBUGPRINTF -void handle_debug_input( int numbytes, uint8_t * data ) // You can override this! -void poll_input( void ) -int _write(int fd, const char *buf, int size) -int putchar(int c) -void SetupDebugPrintf( void ) -void WaitForDebuggerToAttach() -#endif - -#if (defined( FUNCONF_USE_DEBUGPRINTF ) && !FUNCONF_USE_DEBUGPRINTF) && \ - (defined( FUNCONF_USE_UARTPRINTF ) && !FUNCONF_USE_UARTPRINTF) && \ - (defined( FUNCONF_NULL_PRINTF ) && FUNCONF_NULL_PRINTF) - -int _write(int fd, const char *buf, int size) -int putchar(int c) -#endif - -void DelaySysTick( uint32_t n ) -void SystemInit( void ) - -#ifdef CPLUSPLUS -extern void __cxa_pure_virtual() -void __libc_init_array(void) -#endif - -*/ - -// We pre-define these, because if the user is (for some awful reason) using gcc-riscv64-linux-gnu with newlib, it will fail to compile if it janks up the stdio/string functions. -#define _SSP_STRING_H_ -#define _SSP_STDIO_H_ - -#include -#include -#include -#include -#include -#include - -#define WEAK __attribute__((weak)) - -WEAK int errno; - -static int __puts_uart( char *s, int len, void *buf ) -{ - (void)buf; - - _write( 0, s, len ); - return len; -} - -WEAK int printf( const char* format, ... ) -{ - va_list args; - va_start( args, format ); - int ret_status = mini_vpprintf(__puts_uart, 0, format, args); - va_end( args ); - return ret_status; -} - -WEAK int vprintf(const char* format, va_list args) -{ - return mini_vpprintf(__puts_uart, 0, format, args); -} - -WEAK int snprintf( char * buffer, unsigned int buffer_len, const char* format, ... ) -{ - va_list args; - va_start( args, format ); - int ret = mini_vsnprintf( buffer, buffer_len, format, args ); - va_end( args ); - return ret; -} - -WEAK int sprintf( char * buffer, const char * format, ... ) -{ - va_list args; - va_start( args, format ); - int ret = mini_vsnprintf( buffer, INT_MAX, format, args ); - va_end( args ); - return ret; -} - -/* Some stuff from MUSL - - ----------------------------------------------------------------------- -Copyright © 2005-2020 Rich Felker, et al. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- - -*/ - -/* - * mbstate_t is an opaque object to keep conversion state, during multibyte - * stream conversions. The content must not be referenced by user programs. - */ - -#define CURRENT_UTF8 0 -#define IS_CODEUNIT(c) ((unsigned)(c)-0xdf80 < 0x80) -#define MB_CUR_MAX (CURRENT_UTF8 ? 4 : 1) - -typedef void * mbstate_t; - -#ifdef UNICODE -WEAK size_t wcrtomb(char *restrict s, wchar_t wc, mbstate_t *restrict st) -{ - if (!s) return 1; - if ((unsigned)wc < 0x80) { - *s = wc; - return 1; - } else if (MB_CUR_MAX == 1) { - if (!IS_CODEUNIT(wc)) { - errno = 0x02; // EILSEQ - return -1; - } - *s = wc; - return 1; - } else if ((unsigned)wc < 0x800) { - *s++ = 0xc0 | (wc>>6); - *s = 0x80 | (wc&0x3f); - return 2; - } else if ((unsigned)wc < 0xd800 || (unsigned)wc-0xe000 < 0x2000) { - *s++ = 0xe0 | (wc>>12); - *s++ = 0x80 | ((wc>>6)&0x3f); - *s = 0x80 | (wc&0x3f); - return 3; - } else if ((unsigned)wc-0x10000 < 0x100000) { - *s++ = 0xf0 | (wc>>18); - *s++ = 0x80 | ((wc>>12)&0x3f); - *s++ = 0x80 | ((wc>>6)&0x3f); - *s = 0x80 | (wc&0x3f); - return 4; - } - errno = 0x02;//EILSEQ; - return -1; -} -WEAK int wctomb(char *s, wchar_t wc) -{ - if (!s) return 0; - return wcrtomb(s, wc, 0); -} -#endif -WEAK size_t strlen(const char *s) -{ - const char *a = s; - for (; *s; s++); - return s-a; -} -WEAK size_t strnlen(const char *s, size_t n) { const char *p = memchr(s, 0, n); return p ? (size_t)(p-s) : n;} -WEAK void *memset(void *dest, int c, size_t n) { unsigned char *s = dest; for (; n; n--, s++) *s = c; return dest; } -WEAK char *strcpy(char *d, const char *s) -{ - char *d0=d; - for (; (*d=*s); s++, d++); - return d0; -} -WEAK char *strncpy(char *d, const char *s, size_t n) -{ - char *d0=d; - for (; n && (*d=*s); n--, s++, d++); - return d0; -} -WEAK int strcmp(const char *l, const char *r) -{ - for (; *l==*r && *l; l++, r++); - return *(unsigned char *)l - *(unsigned char *)r; -} -WEAK int strncmp(const char *_l, const char *_r, size_t n) -{ - const unsigned char *l=(void *)_l, *r=(void *)_r; - if (!n--) return 0; - for (; *l && *r && n && *l == *r ; l++, r++, n--); - return *l - *r; -} - -static char *twobyte_strstr(const unsigned char *h, const unsigned char *n) -{ - uint16_t nw = n[0]<<8 | n[1], hw = h[0]<<8 | h[1]; - for (h++; *h && hw != nw; hw = hw<<8 | *++h); - return *h ? (char *)h-1 : 0; -} - -static char *threebyte_strstr(const unsigned char *h, const unsigned char *n) -{ - uint32_t nw = (uint32_t)n[0]<<24 | n[1]<<16 | n[2]<<8; - uint32_t hw = (uint32_t)h[0]<<24 | h[1]<<16 | h[2]<<8; - for (h+=2; *h && hw != nw; hw = (hw|*++h)<<8); - return *h ? (char *)h-2 : 0; -} - -static char *fourbyte_strstr(const unsigned char *h, const unsigned char *n) -{ - uint32_t nw = (uint32_t)n[0]<<24 | n[1]<<16 | n[2]<<8 | n[3]; - uint32_t hw = (uint32_t)h[0]<<24 | h[1]<<16 | h[2]<<8 | h[3]; - for (h+=3; *h && hw != nw; hw = hw<<8 | *++h); - return *h ? (char *)h-3 : 0; -} - -#define MAX(a,b) ((a)>(b)?(a):(b)) -#define MIN(a,b) ((a)<(b)?(a):(b)) - -#define BITOP(a,b,op) \ - ((a)[(size_t)(b)/(8*sizeof *(a))] op (size_t)1<<((size_t)(b)%(8*sizeof *(a)))) - -static char *twoway_strstr(const unsigned char *h, const unsigned char *n) -{ - const unsigned char *z; - size_t l, ip, jp, k, p, ms, p0, mem, mem0; - size_t byteset[32 / sizeof(size_t)] = { 0 }; - size_t shift[256]; - - /* Computing length of needle and fill shift table */ - for (l=0; n[l] && h[l]; l++) - BITOP(byteset, n[l], |=), shift[n[l]] = l+1; - if (n[l]) return 0; /* hit the end of h */ - - /* Compute maximal suffix */ - ip = -1; jp = 0; k = p = 1; - while (jp+k n[jp+k]) { - jp += k; - k = 1; - p = jp - ip; - } else { - ip = jp++; - k = p = 1; - } - } - ms = ip; - p0 = p; - - /* And with the opposite comparison */ - ip = -1; jp = 0; k = p = 1; - while (jp+k ms+1) ms = ip; - else p = p0; - - /* Periodic needle? */ - if (memcmp(n, n+p, ms+1)) { - mem0 = 0; - p = MAX(ms, l-ms-1) + 1; - } else mem0 = l-p; - mem = 0; - - /* Initialize incremental end-of-haystack pointer */ - z = h; - - /* Search loop */ - for (;;) { - /* Update incremental end-of-haystack pointer */ - if ((size_t)(z-h) < l) { - /* Fast estimate for MAX(l,63) */ - size_t grow = l | 63; - const unsigned char *z2 = memchr(z, 0, grow); - if (z2) { - z = z2; - if ((size_t)(z-h) < l) return 0; - } else z += grow; - } - - /* Check last byte first; advance by shift on mismatch */ - if (BITOP(byteset, h[l-1], &)) { - k = l-shift[h[l-1]]; - if (k) { - if (k < mem) k = mem; - h += k; - mem = 0; - continue; - } - } else { - h += l; - mem = 0; - continue; - } - - /* Compare right half */ - for (k=MAX(ms+1,mem); n[k] && n[k] == h[k]; k++); - if (n[k]) { - h += k-ms; - mem = 0; - continue; - } - /* Compare left half */ - for (k=ms+1; k>mem && n[k-1] == h[k-1]; k--); - if (k <= mem) return (char *)h; - h += p; - mem = mem0; - } -} - -WEAK char *strchr(const char *s, int c) -{ - c = (unsigned char)c; - if (!c) return (char *)s + strlen(s); - for (; *s && *(unsigned char *)s != c; s++); - return (char *)s; -} - -WEAK char *strstr(const char *h, const char *n) -{ - /* Return immediately on empty needle */ - if (!n[0]) return (char *)h; - - /* Use faster algorithms for short needles */ - h = strchr(h, *n); - if (!h || !n[1]) return (char *)h; - if (!h[1]) return 0; - if (!n[2]) return twobyte_strstr((void *)h, (void *)n); - if (!h[2]) return 0; - if (!n[3]) return threebyte_strstr((void *)h, (void *)n); - if (!h[3]) return 0; - if (!n[4]) return fourbyte_strstr((void *)h, (void *)n); - - return twoway_strstr((void *)h, (void *)n); -} - - -WEAK void *__memrchr(const void *m, int c, size_t n) -{ - const unsigned char *s = m; - c = (unsigned char)c; - while (n--) if (s[n]==c) return (void *)(s+n); - return 0; -} - -WEAK char *strrchr(const char *s, int c) -{ - return __memrchr(s, c, strlen(s) + 1); -} - -WEAK void *memcpy(void *dest, const void *src, size_t n) -{ - unsigned char *d = dest; - const unsigned char *s = src; - for (; n; n--) *d++ = *s++; - return dest; -} - -WEAK int memcmp(const void *vl, const void *vr, size_t n) -{ - const unsigned char *l=vl, *r=vr; - for (; n && *l == *r; n--, l++, r++); - return n ? *l-*r : 0; -} - - -WEAK void *memmove(void *dest, const void *src, size_t n) -{ - char *d = dest; - const char *s = src; - - if (d==s) return d; - if ((uintptr_t)s-(uintptr_t)d-n <= -2*n) return memcpy(d, s, n); - - if (d - * - * Permission granted on 2024-07-13 for optional relicense under MIT license. - * https://github.com/mludvig/mini-printf/issues/16 - * - * ---- - * - * This is a minimal snprintf() implementation optimised - * for embedded systems with a very limited program memory. - * mini_snprintf() doesn't support _all_ the formatting - * the glibc does but on the other hand is a lot smaller. - * Here are some numbers from my STM32 project (.bin file size): - * no snprintf(): 10768 bytes - * mini snprintf(): 11420 bytes (+ 652 bytes) - * glibc snprintf(): 34860 bytes (+24092 bytes) - * Wasting nearly 24kB of memory just for snprintf() on - * a chip with 32kB flash is crazy. Use mini_snprintf() instead. - * - */ - -#define mini_strlen strlen - -static int -mini_itoa(long value, unsigned int radix, int uppercase, int unsig, - char *buffer) -{ - char *pbuffer = buffer; - int negative = 0; - int i, len; - - /* No support for unusual radixes. */ - if (radix > 16) - return 0; - - if (value < 0 && !unsig) { - negative = 1; - value = -value; - } - - /* This builds the string back to front ... */ - do { - int digit = value % radix; - *(pbuffer++) = (digit < 10 ? '0' + digit : (uppercase ? 'A' : 'a') + digit - 10); - value /= radix; - } while (value > 0); - - if (negative) - *(pbuffer++) = '-'; - - *(pbuffer) = '\0'; - - /* ... now we reverse it (could do it recursively but will - * conserve the stack space) */ - len = (pbuffer - buffer); - for (i = 0; i < len / 2; i++) { - char j = buffer[i]; - buffer[i] = buffer[len-i-1]; - buffer[len-i-1] = j; - } - - return len; -} - -static int -mini_pad(char* ptr, int len, char pad_char, int pad_to, char *buffer) -{ - int i; - int overflow = 0; - char * pbuffer = buffer; - if(pad_to == 0) pad_to = len; - if(len > pad_to) { - len = pad_to; - overflow = 1; - } - for(i = pad_to - len; i > 0; i --) { - *(pbuffer++) = pad_char; - } - for(i = len; i > 0; i --) { - *(pbuffer++) = *(ptr++); - } - len = pbuffer - buffer; - if(overflow) { - for (i = 0; i < 3 && pbuffer > buffer; i ++) { - *(pbuffer-- - 1) = '*'; - } - } - return len; -} - -struct mini_buff { - char *buffer, *pbuffer; - unsigned int buffer_len; -}; - -static int -_puts(char *s, int len, void *buf) -{ - if(!buf) return len; - struct mini_buff *b = buf; - char * p0 = b->buffer; - int i; - /* Copy to buffer */ - for (i = 0; i < len; i++) { - if(b->pbuffer == b->buffer + b->buffer_len - 1) { - break; - } - *(b->pbuffer ++) = s[i]; - } - *(b->pbuffer) = 0; - return b->pbuffer - p0; -} - -#ifdef MINI_PRINTF_ENABLE_OBJECTS -static int (*mini_handler) (void* data, void* obj, int ch, int lhint, char** bf) = 0; -static void (*mini_handler_freeor)(void* data, void*) = 0; -static void * mini_handler_data = 0; - -void mini_printf_set_handler( - void* data, - int (*handler)(void* data, void* obj, int ch, int len_hint, char** buf), - void (*freeor)(void* data, void* buf)) -{ - mini_handler = handler; - mini_handler_freeor = freeor; - mini_handler_data = data; -} -#endif - -int -mini_vsnprintf(char *buffer, unsigned int buffer_len, const char *fmt, va_list va) -{ - struct mini_buff b; - b.buffer = buffer; - b.pbuffer = buffer; - b.buffer_len = buffer_len; - if(buffer_len == 0) buffer = (void*) 0; - int n = mini_vpprintf(_puts, (buffer != (void*)0)?&b:(void*)0, fmt, va); - if(buffer == (void*) 0) { - return n; - } - return b.pbuffer - b.buffer; -} - -int -mini_vpprintf(int (*puts)(char* s, int len, void* buf), void* buf, const char *fmt, va_list va) -{ - char bf[24]; - char bf2[24]; - char ch; -#ifdef MINI_PRINTF_ENABLE_OBJECTS - void* obj; -#endif - if(puts == (void*)0) { - /* run puts in counting mode. */ - puts = _puts; buf = (void*)0; - } - int n = 0; - while ((ch=*(fmt++))) { - int len; - if (ch!='%') { - len = 1; - len = puts(&ch, len, buf); - } else { - char pad_char = ' '; - int pad_to = 0; - char l = 0; - char *ptr; - - ch=*(fmt++); - - /* Zero padding requested */ - if (ch == '0') pad_char = '0'; - while (ch >= '0' && ch <= '9') { - pad_to = pad_to * 10 + (ch - '0'); - ch=*(fmt++); - } - if(pad_to > (signed int) sizeof(bf)) { - pad_to = sizeof(bf); - } - if (ch == 'l') { - l = 1; - ch=*(fmt++); - } - - switch (ch) { - case 0: - goto end; - case 'u': - case 'd': - if(l) { - len = mini_itoa(va_arg(va, unsigned long), 10, 0, (ch=='u'), bf2); - } else { - if(ch == 'u') { - len = mini_itoa((unsigned long) va_arg(va, unsigned int), 10, 0, 1, bf2); - } else { - len = mini_itoa((long) va_arg(va, int), 10, 0, 0, bf2); - } - } - len = mini_pad(bf2, len, pad_char, pad_to, bf); - len = puts(bf, len, buf); - break; - - case 'x': - case 'X': - if(l) { - len = mini_itoa(va_arg(va, unsigned long), 16, (ch=='X'), 1, bf2); - } else { - len = mini_itoa((unsigned long) va_arg(va, unsigned int), 16, (ch=='X'), 1, bf2); - } - len = mini_pad(bf2, len, pad_char, pad_to, bf); - len = puts(bf, len, buf); - break; - - case 'c' : - ch = (char)(va_arg(va, int)); - len = mini_pad(&ch, 1, pad_char, pad_to, bf); - len = puts(bf, len, buf); - break; - - case 's' : - ptr = va_arg(va, char*); - len = mini_strlen(ptr); - if (pad_to > 0) { - len = mini_pad(ptr, len, pad_char, pad_to, bf); - len = puts(bf, len, buf); - } else { - len = puts(ptr, len, buf); - } - break; -#ifdef MINI_PRINTF_ENABLE_OBJECTS - case 'O' : /* Object by content (e.g. str) */ - case 'R' : /* Object by representation (e.g. repr)*/ - obj = va_arg(va, void*); - len = mini_handler(mini_handler_data, obj, ch, pad_to, &ptr); - if (pad_to > 0) { - len = mini_pad(ptr, len, pad_char, pad_to, bf); - len = puts(bf, len, buf); - } else { - len = puts(ptr, len, buf); - } - mini_handler_freeor(mini_handler_data, ptr); - break; -#endif - default: - len = 1; - len = puts(&ch, len, buf); - break; - } - } - n = n + len; - } -end: - return n; -} - - -int -mini_snprintf(char* buffer, unsigned int buffer_len, const char *fmt, ...) -{ - int ret; - va_list va; - va_start(va, fmt); - ret = mini_vsnprintf(buffer, buffer_len, fmt, va); - va_end(va); - - return ret; -} - -int -mini_pprintf(int (*puts)(char*s, int len, void* buf), void* buf, const char *fmt, ...) -{ - int ret; - va_list va; - va_start(va, fmt); - ret = mini_vpprintf(puts, buf, fmt, va); - va_end(va); - - return ret; -} - - -/* - C version of CH32V003 Startup .s file from WCH - This file is public domain where possible or the following where not: - Copyright 2023 Charles Lohr, under the MIT-x11 or NewBSD licenses, you choose. -*/ - -#ifdef CPLUSPLUS -// Method to call the C++ constructors -void __libc_init_array(void); -#endif - -int main() __attribute__((used)); -void SystemInit( void ) __attribute__((used)); - -extern uint32_t * _sbss; -extern uint32_t * _ebss; -extern uint32_t * _data_lma; -extern uint32_t * _data_vma; -extern uint32_t * _edata; - -#if FUNCONF_DEBUG_HARDFAULT -#if FUNCONF_USE_DEBUGPRINTF -static void PrintN( uint32_t n ) -{ - while( (*DMDATA0) & 0x80 ); - // Write out character. - *DMDATA0 = 0x78302088; //" 0x" - int shift; - for( shift = 28; shift >= 0; shift -= 4 ) - { - while( (*DMDATA0) & 0x80 ); - int s = (n>>shift) & 0xf; - s += ( s < 10 ) ? '0' : ('a' - 10); - *DMDATA0 = 0x85 | (s<<8); //" 0x" - } -} -#elif FUNCONF_USE_UARTPRINTF -static void PrintN( uint32_t n ) -{ - putchar( ' ' ); - putchar( '0' ); - putchar( 'x' ); - int shift; - for( shift = 28; shift >= 0; shift -= 4 ) - { - int s = (n>>shift) & 0xf; - s += ( s < 10 ) ? '0' : ('a' - 10); - putchar( s ); - } -} -#endif -#endif - -// If you don't override a specific handler, it will just spin forever. -void DefaultIRQHandler( void ) -{ -#if FUNCONF_DEBUG_HARDFAULT && ( FUNCONF_USE_DEBUGPRINTF || FUNCONF_USE_UARTPRINTF ) - //This is kind of like a crash handler. - //printf( "DEAD MSTATUS:%08x MTVAL:%08x MCAUSE:%08x MEPC:%08x\n", (int)__get_MSTATUS(), (int)__get_MTVAL(), (int)__get_MCAUSE(), (int)__get_MEPC() ); - PrintN( __get_MEPC() ); // "addr2line -e debugprintfdemo.elf 0x000007e6" ---> debugprintfdemo.c:45 - PrintN( __get_MSTATUS() ); - PrintN( __get_MTVAL() ); - PrintN( __get_MCAUSE() ); -#if FUNCONF_USE_DEBUGPRINTF - while( (*DMDATA0) & 0x80 ); - *DMDATA0 = 0x0a85; - while( (*DMDATA0) & 0x80 ); - *DMDATA0 = 0xaaaaaa83; -#elif FUNCONF_USE_UARTPRINTF - putchar( '\n' ); -#endif -#endif - //printf( "DEAD MSTATUS:%08x MTVAL:%08x MCAUSE:%08x MEPC:%08x\n", (int)__get_MSTATUS(), (int)__get_MTVAL(), (int)__get_MCAUSE(), (int)__get_MEPC() ); - // Infinite Loop - asm volatile( "1: j 1b" ); -} - -// This makes it so that all of the interrupt handlers just alias to -// DefaultIRQHandler unless they are individually overridden. - -#if defined(FUNCONF_USE_CLK_SEC) && FUNCONF_USE_CLK_SEC -/** - * @brief Non Maskabke Interrupt handler - * Invoked when the Clock Security system - * detects the failure of the HSE oscilator. - * The sys clock is switched to HSI. - * Clears the CSSF flag in RCC->INTR - */ -void NMI_RCC_CSS_IRQHandler( void ) -{ - RCC->INTR |= RCC_CSSC; // clear the clock security int flag -} - -void NMI_Handler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("NMI_RCC_CSS_IRQHandler"))) __attribute__((used)); -#else -void NMI_Handler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -#endif -void HardFault_Handler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void Ecall_M_Mode_Handler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void Ecall_U_Mode_Handler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void Break_Point_Handler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void SysTick_Handler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void SW_Handler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void WWDG_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void PVD_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TAMPER_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void RTC_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void FLASH_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void RCC_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void EXTI7_0_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void AWU_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void EXTI0_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void EXTI1_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void EXTI2_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void EXTI3_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void EXTI4_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void DMA1_Channel1_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void DMA1_Channel2_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void DMA1_Channel3_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void DMA1_Channel4_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void DMA1_Channel5_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void DMA1_Channel6_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void DMA1_Channel7_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void ADC1_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void ADC1_2_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void USBFS_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void USBFSWakeUp_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void USB_HP_CAN1_TX_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void USB_LP_CAN1_RX0_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void CAN1_RX1_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void CAN1_SCE_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void EXTI9_5_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TIM1_BRK_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TIM1_UP_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TIM1_TRG_COM_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TIM1_CC_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TIM2_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TIM3_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TIM4_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void I2C1_EV_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void I2C1_ER_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void SPI1_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void I2C2_EV_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void I2C2_ER_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void SPI2_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void USART1_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void USART2_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void USART3_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void EXTI15_10_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void RTCAlarm_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void USBWakeUp_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void ETH_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void ETHWakeUp_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void OSC32KCal_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void OSCWakeUp_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void DMA1_Channel8_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void BB_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void LLE_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -// This appears to be masked to USBHD -void TIM8_BRK_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TIM8_UP_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TIM8_TRG_COM_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TIM8_CC_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void RNG_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void FSMC_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void SDIO_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TIM5_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void SPI3_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void UART4_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void UART5_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TIM6_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TIM7_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void DMA2_Channel1_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void DMA2_Channel2_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void DMA2_Channel3_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void DMA2_Channel4_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void DMA2_Channel5_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void OTG_FS_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void USBHSWakeUp_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void USBHS_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void DVP_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void UART6_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void UART7_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void UART8_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TIM9_BRK_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TIM9_UP_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TIM9_TRG_COM_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TIM9_CC_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TIM10_BRK_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TIM10_UP_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TIM10_TRG_COM_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TIM10_CC_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void DMA2_Channel6_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void DMA2_Channel7_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void DMA2_Channel8_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void DMA2_Channel9_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void DMA2_Channel10_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void DMA2_Channel11_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void CAN2_TX_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void CAN2_RX0_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void CAN2_RX1_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void CAN2_SCE_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void EXTI15_8_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void EXTI25_16_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void USART4_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void USBFS_WakeUp_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void PIOC_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void OPA_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void USBPD_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void USBPD_WKUP_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TIM2_CC_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TIM2_TRG_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); -void TIM2_BRK_IRQHandler( void ) __attribute__((section(".text.vector_handler"))) __attribute((weak,alias("DefaultIRQHandler"))) __attribute__((used)); - - -void InterruptVector() __attribute__((naked)) __attribute((section(".init"))) __attribute((weak,alias("InterruptVectorDefault"))) __attribute((naked)); -void InterruptVectorDefault() __attribute__((naked)) __attribute((section(".init"))) __attribute((naked)); -void handle_reset( void ) __attribute__((section(".text.handle_reset"))); - -void InterruptVectorDefault( void ) -{ -#if !defined(FUNCONF_TINYVECTOR) || !FUNCONF_TINYVECTOR - asm volatile( DEFAULT_INTERRUPT_VECTOR_CONTENTS ); -#else - asm volatile( "\n\ - .align 2\n\ - .option push;\n\ - .option norvc;\n\ - j handle_reset\n\ - .option pop;\n" ); -#endif -} - -#if defined( CH32V003 ) || defined( CH32X03x ) - -void handle_reset( void ) -{ - asm volatile( "\n\ -.option push\n\ -.option norelax\n\ - la gp, __global_pointer$\n\ -.option pop\n\ - la sp, _eusrstack\n" -#if __GNUC__ > 10 -".option arch, +zicsr\n" -#endif - // Setup the interrupt vector, processor status and INTSYSCR. - -#if FUNCONF_ENABLE_HPE // Enabled nested and hardware (HPE) stack, since it's really good on the x035. -" li t0, 0x88\n\ - csrs mstatus, t0\n" -" li t0, 0x0b\n\ - csrw 0x804, t0\n" -#else -" li a0, 0x80\n\ - csrw mstatus, a0\n" -#endif -" li a3, 0x3\n\ - la a0, InterruptVector\n\ - or a0, a0, a3\n\ - csrw mtvec, a0\n" - : : : "a0", "a3", "memory"); - - // Careful: Use registers to prevent overwriting of self-data. - // This clears out BSS. -asm volatile( -" la a0, _sbss\n\ - la a1, _ebss\n\ - li a2, 0\n\ - bge a0, a1, 2f\n\ -1: sw a2, 0(a0)\n\ - addi a0, a0, 4\n\ - blt a0, a1, 1b\n\ -2:" - // This loads DATA from FLASH to RAM. -" la a0, _data_lma\n\ - la a1, _data_vma\n\ - la a2, _edata\n\ -1: beq a1, a2, 2f\n\ - lw a3, 0(a0)\n\ - sw a3, 0(a1)\n\ - addi a0, a0, 4\n\ - addi a1, a1, 4\n\ - bne a1, a2, 1b\n\ -2:\n" -#ifdef CPLUSPLUS - // Call __libc_init_array function -" call %0 \n\t" -: : "i" (__libc_init_array) -: "a0", "a1", "a2", "a3", "a4", "a5", "t0", "t1", "t2", "memory" -#else -: : : "a0", "a1", "a2", "a3", "memory" -#endif -); - -#if defined( FUNCONF_SYSTICK_USE_HCLK ) && FUNCONF_SYSTICK_USE_HCLK - SysTick->CTLR = 5; -#else - SysTick->CTLR = 1; -#endif - - // set mepc to be main as the root app. -asm volatile( -" csrw mepc, %[main]\n" -" mret\n" : : [main]"r"(main) ); -} - -#elif defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) - -void handle_reset( void ) -{ - asm volatile( "\n\ -.option push\n\ -.option norelax\n\ - la gp, __global_pointer$\n\ -.option pop\n\ - la sp, _eusrstack\n" -#if __GNUC__ > 10 - ".option arch, +zicsr\n" -#endif - ); - - // Careful: Use registers to prevent overwriting of self-data. - // This clears out BSS. - asm volatile( -" la a0, _sbss\n\ - la a1, _ebss\n\ - bgeu a0, a1, 2f\n\ -1: sw zero, 0(a0)\n\ - addi a0, a0, 4\n\ - bltu a0, a1, 1b\n\ -2:" - // This loads DATA from FLASH to RAM. -" la a0, _data_lma\n\ - la a1, _data_vma\n\ - la a2, _edata\n\ - beq a1, a2, 2f\n\ -1: lw t0, 0(a0)\n\ - sw t0, 0(a1)\n\ - addi a0, a0, 4\n\ - addi a1, a1, 4\n\ - bltu a1, a2, 1b\n\ -2:\n" -#ifdef CPLUSPLUS - // Call __libc_init_array function -" call %0 \n\t" -: : "i" (__libc_init_array) -#else -: : -#endif -: "a0", "a1", "a2", "a3", "memory" -); - - // Setup the interrupt vector, processor status and INTSYSCR. - asm volatile( -" li t0, 0x1f\n\ - csrw 0xbc0, t0\n" - -#if defined(CH32V30x) && !defined( DISABLED_FLOAT ) -" li t0, 0x6088\n\ - csrs mstatus, t0\n" -#else -" li t0, 0x88\n\ - csrs mstatus, t0\n" -#endif - -#if FUNCONF_ENABLE_HPE // Enabled nested and hardware (HPE) stack, since it's really good on the x035. -" li t0, 0x0b\n\ - csrw 0x804, t0\n" -#endif -" la t0, InterruptVector\n\ - ori t0, t0, 3\n\ - csrw mtvec, t0\n" - : : [InterruptVector]"r"(InterruptVector) : "t0", "memory" - ); - -#if defined( FUNCONF_SYSTICK_USE_HCLK ) && FUNCONF_SYSTICK_USE_HCLK && !defined(CH32V10x) - SysTick->CTLR = 5; -#else - SysTick->CTLR = 1; -#endif - - // set mepc to be main as the root app. - asm volatile( -" csrw mepc, %[main]\n" -" mret\n" : : [main]"r"(main) ); -} - -#endif - -#if defined( __riscv_float_abi_double ) -#define FLOAD( src, offset, dst ) \ -" fld " #src ", " #offset "*8(" #dst ")\n" -#define FSTORE( dst, offset, src ) \ -" fsd " #dst ", " #offset "*8(" #src ")\n" -#elif defined( __riscv_float_abi_single ) -#define FLOAD( src, offset, dst ) \ -" flw " #src ", " #offset "*4(" #dst ")\n" -#define FSTORE( dst, offset, src ) \ -" fsw " #dst ", " #offset "*4(" #src ")\n" -#else // Soft float -#endif - -__attribute__ ((naked)) int setjmp( jmp_buf env ) -{ - asm volatile( - // Common registers -" sw ra, 0*4(a0)\n" -" sw s0, 1*4(a0)\n" -" sw s1, 2*4(a0)\n" -" sw sp, 3*4(a0)\n" - - // RV32I only registers -#if !defined( __riscv_abi_rve ) -" sw s2, 4*4(a0)\n" -" sw s3, 5*4(a0)\n" -" sw s4, 6*4(a0)\n" -" sw s5, 7*4(a0)\n" -" sw s6, 8*4(a0)\n" -" sw s7, 9*4(a0)\n" -" sw s8, 10*4(a0)\n" -" sw s9, 11*4(a0)\n" -" sw s10, 12*4(a0)\n" -" sw s11, 13*4(a0)\n" -#endif - - // FPU registers -#if defined( FSTORE ) - FSTORE(fs2, 14, a0) - FSTORE(fs3, 15, a0) - FSTORE(fs4, 16, a0) - FSTORE(fs5, 17, a0) - FSTORE(fs6, 18, a0) - FSTORE(fs7, 19, a0) - FSTORE(fs8, 20, a0) - FSTORE(fs9, 21, a0) - FSTORE(fs10, 22, a0) - FSTORE(fs11, 23, a0) -#endif - -" li a0, 0\n" -" ret\n" - ); -} - -__attribute__ ((naked)) void longjmp( jmp_buf env, int val ) -{ - asm volatile( - // Common registers -" lw ra, 0*4(a0)\n" -" lw s0, 1*4(a0)\n" -" lw s1, 2*4(a0)\n" -" lw sp, 3*4(a0)\n" - - // RV32I only registers -#if !defined( __riscv_abi_rve ) -" lw s2, 4*4(a0)\n" -" lw s3, 5*4(a0)\n" -" lw s4, 6*4(a0)\n" -" lw s5, 7*4(a0)\n" -" lw s6, 8*4(a0)\n" -" lw s7, 9*4(a0)\n" -" lw s8, 10*4(a0)\n" -" lw s9, 11*4(a0)\n" -" lw s10, 12*4(a0)\n" -" lw s11, 13*4(a0)\n" -#endif - - // FPU registers -#if defined( FLOAD ) - FLOAD(fs2, 14, a0) - FLOAD(fs3, 15, a0) - FLOAD(fs4, 16, a0) - FLOAD(fs5, 17, a0) - FLOAD(fs6, 18, a0) - FLOAD(fs7, 19, a0) - FLOAD(fs8, 20, a0) - FLOAD(fs9, 21, a0) - FLOAD(fs10, 22, a0) - FLOAD(fs11, 23, a0) -#endif - -" seqz a0, a1\n" // a0 = (a1 == 0) ? 1 : 0 -" add a0, a0, a1\n" -" ret\n" - ); - __builtin_unreachable(); // Disable warning about no return. -} - -#if defined( FUNCONF_USE_UARTPRINTF ) && FUNCONF_USE_UARTPRINTF -void SetupUART( int uartBRR ) -{ -#ifdef CH32V003 - // Enable GPIOD and UART. - RCC->APB2PCENR |= RCC_APB2Periph_GPIOD | RCC_APB2Periph_USART1; - - // Push-Pull, 10MHz Output, GPIO D5, with AutoFunction - GPIOD->CFGLR &= ~(0xf<<(4*5)); - GPIOD->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP_AF)<<(4*5); -#elif defined(CH32X03x) - RCC->APB2PCENR |= RCC_APB2Periph_GPIOB | RCC_APB2Periph_USART1; - - // Push-Pull, 10MHz Output, GPIO A9, with AutoFunction - GPIOB->CFGHR &= ~(0xf<<(4*2)); - GPIOB->CFGHR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP_AF)<<(4*2); -#else - RCC->APB2PCENR |= RCC_APB2Periph_GPIOA | RCC_APB2Periph_USART1; - - // Push-Pull, 10MHz Output, GPIO A9, with AutoFunction - GPIOA->CFGHR &= ~(0xf<<(4*1)); - GPIOA->CFGHR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP_AF)<<(4*1); -#endif - - // 115200, 8n1. Note if you don't specify a mode, UART remains off even when UE_Set. - USART1->CTLR1 = USART_WordLength_8b | USART_Parity_No | USART_Mode_Tx; - USART1->CTLR2 = USART_StopBits_1; - USART1->CTLR3 = USART_HardwareFlowControl_None; - - USART1->BRR = uartBRR; - USART1->CTLR1 |= CTLR1_UE_Set; -} - -// For debug writing to the UART. -WEAK int _write(int fd, const char *buf, int size) -{ - for(int i = 0; i < size; i++){ - while( !(USART1->STATR & USART_FLAG_TC)); - USART1->DATAR = *buf++; - } - return size; -} - -// single char to UART -WEAK int putchar(int c) -{ - while( !(USART1->STATR & USART_FLAG_TC)); - USART1->DATAR = (const char)c; - return 1; -} -#endif - -#if defined( FUNCONF_USE_DEBUGPRINTF ) && FUNCONF_USE_DEBUGPRINTF - - -void handle_debug_input( int numbytes, uint8_t * data ) __attribute__((weak)); -void handle_debug_input( int numbytes, uint8_t * data ) { (void)numbytes; (void)data; } - -static void internal_handle_input( volatile uint32_t * dmdata0 ) -{ - uint32_t dmd0 = *dmdata0; - int bytes = (dmd0 & 0x3f) - 4; - if( bytes > 0 && bytes < 16 ) - { - handle_debug_input( bytes, ((uint8_t*)dmdata0) + 1 ); - } -} - - -void poll_input( void ) -{ - volatile uint32_t * dmdata0 = (volatile uint32_t *)DMDATA0; - if( ((*dmdata0) & 0x80) == 0 ) - { - internal_handle_input( dmdata0 ); - *dmdata0 = 0x84; - } -} - - -// MSB .... LSB -// DMDATA0: char3 char2 char1 [status word] -// where [status word] is: -// bit 7 = is a "printf" waiting? -// bit 6 = printf has timed out. -// bit 0..bit 3 = # of bytes in printf (+4). (5 or higher indicates a print of some kind) -// note: if b7 is 0 in reply, but b0..b3 have >=4 then we received data from host. -// Special sentinel: -// status word = 0x80 = default at start -// status word = 0xcx = timed out. -// declare as weak to allow overriding. -WEAK int _write(int fd, const char *buf, int size) -{ - (void)fd; - if( ( *DMDATA0 & 0xc0 ) == 0xc0 ) return 0; - - char buffer[4] = { 0 }; - int place = 0; - uint32_t lastdmd; - uint32_t timeout = FUNCONF_DEBUGPRINTF_TIMEOUT; // Give up after ~120ms - - if( size == 0 ) - { - lastdmd = (*DMDATA0); - if( lastdmd && !(lastdmd&0x80) ) internal_handle_input( (uint32_t*)DMDATA0 ); - } - while( place < size ) - { - int tosend = size - place; - if( tosend > 7 ) tosend = 7; - - while( ( lastdmd = (*DMDATA0) ) & 0x80 ) - { - if( timeout-- == 0 ) - { - *DMDATA0 |= 0xc0; - return 0; - } - } - - if( lastdmd ) internal_handle_input( (uint32_t*)DMDATA0 ); - - timeout = FUNCONF_DEBUGPRINTF_TIMEOUT; - - int t = 3; - while( t < tosend ) - { - buffer[t-3] = buf[t+place]; - t++; - } - *DMDATA1 = *(uint32_t*)&(buffer[0]); - t = 0; - while( t < tosend && t < 3 ) - { - buffer[t+1] = buf[t+place]; - t++; - } - buffer[0] = 0x80 | (tosend + 4); - *DMDATA0 = *(uint32_t*)&(buffer[0]); - - //buf += tosend; - place += tosend; - } - return size; -} - -// single to debug intf -WEAK int putchar(int c) -{ - if( ( *DMDATA0 & 0xc0 ) == 0xc0 ) return 0; - - int timeout = FUNCONF_DEBUGPRINTF_TIMEOUT; - uint32_t lastdmd = 0; - - while( ( lastdmd = (*DMDATA0) ) & 0x80 ) - { - if( timeout-- == 0 ) - { - *DMDATA0 |= 0xc0; - return 0; - } - } - - // Simply seeking input. - if( lastdmd ) internal_handle_input( (uint32_t*)DMDATA0 ); - - // Write out character. - *DMDATA0 = 0x85 | ((const char)c<<8); - return 1; -} - -void SetupDebugPrintf( void ) -{ - // Clear out the sending flag. - *DMDATA1 = 0x00; - *DMDATA0 = 0x80; -} - -int WaitForDebuggerToAttach( int timeout_ms ) -{ - -#if defined(CH32V20x) || defined(CH32V30x) - #define systickcnt_t uint64_t - #define SYSTICKCNT SysTick->CNT -#elif defined(CH32V10x) || defined(CH32X03x) - #define systickcnt_t uint32_t - #define SYSTICKCNT SysTick->CNTL -#else - #define systickcnt_t uint32_t - #define SYSTICKCNT SysTick->CNT -#endif - - const systickcnt_t start = SYSTICKCNT; - const systickcnt_t ticks_per_ms = (FUNCONF_SYSTEM_CORE_CLOCK / 1000); - const systickcnt_t timeout = timeout_ms * ticks_per_ms; - - // Wait for the sentinel to become zero. - while( !DidDebuggerAttach() ) { - if( timeout_ms && (SYSTICKCNT - start) > timeout ) return 1; - } - - return 0; - -#undef systickcnt_t -#undef SYSTICKCNT -} - -#endif - -#if (defined( FUNCONF_USE_DEBUGPRINTF ) && !FUNCONF_USE_DEBUGPRINTF) && \ - (defined( FUNCONF_USE_UARTPRINTF ) && !FUNCONF_USE_UARTPRINTF) && \ - (defined( FUNCONF_NULL_PRINTF ) && FUNCONF_NULL_PRINTF) - -WEAK int _write(int fd, const char *buf, int size) -{ - return size; -} - -// single to debug intf -WEAK int putchar(int c) -{ - return 1; -} -#endif - -void DelaySysTick( uint32_t n ) -{ -#ifdef CH32V003 - uint32_t targend = SysTick->CNT + n; - while( ((int32_t)( SysTick->CNT - targend )) < 0 ); -#elif defined(CH32V20x) || defined(CH32V30x) - uint64_t targend = SysTick->CNT + n; - while( ((int64_t)( SysTick->CNT - targend )) < 0 ); -#elif defined(CH32V10x) || defined(CH32X03x) - uint32_t targend = SysTick->CNTL + n; - while( ((int32_t)( SysTick->CNTL - targend )) < 0 ); -#else - #error DelaySysTick not defined. -#endif -} - -void SystemInit( void ) -{ -#if defined(CH32V30x) && defined(TARGET_MCU_MEMORY_SPLIT) - FLASH->OBR = TARGET_MCU_MEMORY_SPLIT<<8; -#endif - -#if FUNCONF_HSE_BYPASS - #define HSEBYP (1<<18) -#else - #define HSEBYP 0 -#endif - -#if defined(FUNCONF_USE_CLK_SEC) && FUNCONF_USE_CLK_SEC -#define RCC_CSS RCC_CSSON // Enable clock security system -#else -#define RCC_CSS 0 -#endif - -#if defined(FUNCONF_USE_PLL) && FUNCONF_USE_PLL - #if defined(CH32V003) - #define BASE_CFGR0 RCC_HPRE_DIV1 | RCC_PLLSRC_HSI_Mul2 // HCLK = SYSCLK = APB1 And, enable PLL - #elif defined(CH32V20x_D8W) - #define BASE_CFGR0 RCC_HPRE_DIV1 | RCC_PPRE2_DIV1 | RCC_PPRE1_DIV1 | PLL_MULTIPLICATION - #else - #define BASE_CFGR0 RCC_HPRE_DIV1 | RCC_PPRE2_DIV1 | RCC_PPRE1_DIV2 | PLL_MULTIPLICATION - #endif -#else - #if defined(CH32V003) || defined(CH32X03x) - #define BASE_CFGR0 RCC_HPRE_DIV1 // HCLK = SYSCLK = APB1 And, no pll. - #else - #define BASE_CFGR0 RCC_HPRE_DIV1 | RCC_PPRE2_DIV1 | RCC_PPRE1_DIV1 - #endif -#endif - -// HSI always ON - needed for the Debug subsystem -#define BASE_CTLR (((FUNCONF_HSITRIM) << 3) | RCC_HSION | HSEBYP | RCC_CSS) -//#define BASE_CTLR (((FUNCONF_HSITRIM) << 3) | HSEBYP | RCC_CSS) // disable HSI in HSE modes - - // Flash latency settings. -#if defined(CH32V00x) - // Per TRM - #if FUNCONF_SYSTEM_CORE_CLOCK > 25000000 - FLASH->ACTLR = FLASH_ACTLR_LATENCY_2; - #elif FUNCONF_SYSTEM_CORE_CLOCK > 15000000 - FLASH->ACTLR = FLASH_ACTLR_LATENCY_1; - #else - FLASH->ACTLR = FLASH_ACTLR_LATENCY_0; - #endif -#elif defined(CH32X03x) - FLASH->ACTLR = FLASH_ACTLR_LATENCY_2; // +2 Cycle Latency (Recommended per TRM) -#elif defined(CH32V003) - #if FUNCONF_SYSTEM_CORE_CLOCK > 25000000 - FLASH->ACTLR = FLASH_ACTLR_LATENCY_1; // +1 Cycle Latency - #else - FLASH->ACTLR = FLASH_ACTLR_LATENCY_0; // +0 Cycle Latency - #endif -#endif - -#if defined(FUNCONF_USE_HSI) && FUNCONF_USE_HSI - #if defined(CH32V30x) || defined(CH32V20x) || defined(CH32V10x) - EXTEN->EXTEN_CTR |= EXTEN_PLL_HSI_PRE; - #endif - #if defined(FUNCONF_USE_PLL) && FUNCONF_USE_PLL - RCC->CFGR0 = BASE_CFGR0; - RCC->CTLR = BASE_CTLR | RCC_HSION | RCC_PLLON; // Use HSI, enable PLL. - #else - RCC->CFGR0 = RCC_HPRE_DIV1; // PLLCLK = HCLK = SYSCLK = APB1 - RCC->CTLR = BASE_CTLR | RCC_HSION; // Use HSI, Only. - #endif - -#elif defined(FUNCONF_USE_HSE) && FUNCONF_USE_HSE - - #if defined(CH32V003) - RCC->CTLR = BASE_CTLR | RCC_HSION | RCC_HSEON ; // Keep HSI on while turning on HSE - #else - RCC->CTLR = RCC_HSEON; // Only turn on HSE. - #endif - - // Values lifted from the EVT. There is little to no documentation on what this does. - while(!(RCC->CTLR&RCC_HSERDY)) {}; - - #if defined(CH32V003) - RCC->CFGR0 = RCC_PLLSRC_HSE_Mul2 | RCC_SW_HSE; - #else - RCC->CFGR0 = BASE_CFGR0 | RCC_PLLSRC_HSE | RCC_PLLXTPRE_HSE; - #endif - - #if defined(FUNCONF_USE_PLL) && FUNCONF_USE_PLL - RCC->CTLR = BASE_CTLR | RCC_HSEON | RCC_PLLON; // Turn off HSI. - #else - RCC->CTLR = RCC_HSEON | HSEBYP; // Turn off PLL and HSI. - #endif -#endif - - // CH32V10x flash prefetch buffer -#if defined(CH32V10x) - // Enable Prefetch Buffer - FLASH->ACTLR |= FLASH_ACTLR_PRFTBE; -#endif - - // CH32V10x flash latency -#if defined(CH32V10x) - #if defined(FUNCONF_USE_HSE) && FUNCONF_USE_HSE - #if !defined(FUNCONF_USE_PLL) || !FUNCONF_USE_PLL - FLASH->ACTLR = FLASH_ACTLR_LATENCY_0; // +0 Cycle Latency - #else - #if FUNCONF_SYSTEM_CORE_CLOCK < 56000000 - FLASH->ACTLR = FLASH_ACTLR_LATENCY_1; // +1 Cycle Latency - #else - FLASH->ACTLR = FLASH_ACTLR_LATENCY_2; // +2 Cycle Latency - #endif - #endif - #else - FLASH->ACTLR = FLASH_ACTLR_LATENCY_1; // +1 Cycle Latency - #endif -#endif - - RCC->INTR = 0x009F0000; // Clear PLL, CSSC, HSE, HSI and LSI ready flags. - -#if defined(FUNCONF_USE_PLL) && FUNCONF_USE_PLL - while((RCC->CTLR & RCC_PLLRDY) == 0); // Wait till PLL is ready - uint32_t tmp32 = RCC->CFGR0 & ~(0x03); // clr the SW - RCC->CFGR0 = tmp32 | RCC_SW_PLL; // Select PLL as system clock source - while ((RCC->CFGR0 & (uint32_t)RCC_SWS) != (uint32_t)0x08); // Wait till PLL is used as system clock source -#endif - -#if defined( FUNCONF_USE_UARTPRINTF ) && FUNCONF_USE_UARTPRINTF - SetupUART( UART_BRR ); -#endif -#if defined( FUNCONF_USE_DEBUGPRINTF ) && FUNCONF_USE_DEBUGPRINTF - SetupDebugPrintf(); -#endif -} - -void funAnalogInit( void ) -{ - //RCC->CFGR0 &= ~(0x1F<<11); // Assume ADCPRE = 0 - RCC->APB2PCENR |= RCC_APB2Periph_ADC1; - - // Reset ADC. - RCC->APB2PRSTR |= RCC_APB2Periph_ADC1; - RCC->APB2PRSTR &= ~RCC_APB2Periph_ADC1; - - // set sampling time for all channels to 15 (A good middleground) ADC_SMP0_1. - ADC1->SAMPTR2 = (ADC_SMP0_1<<(3*0)) | (ADC_SMP0_1<<(3*1)) | (ADC_SMP0_1<<(3*2)) | (ADC_SMP0_1<<(3*3)) | (ADC_SMP0_1<<(3*4)) | (ADC_SMP0_1<<(3*5)) | (ADC_SMP0_1<<(3*6)) | (ADC_SMP0_1<<(3*7)) | (ADC_SMP0_1<<(3*8)) | (ADC_SMP0_1<<(3*9)); - ADC1->SAMPTR1 = (ADC_SMP0_1<<(3*0)) | (ADC_SMP0_1<<(3*1)) | (ADC_SMP0_1<<(3*2)) | (ADC_SMP0_1<<(3*3)) | (ADC_SMP0_1<<(3*4)) | (ADC_SMP0_1<<(3*5)); - - ADC1->CTLR2 |= ADC_ADON | ADC_EXTSEL; // turn on ADC and set rule group to sw trig - - // Reset calibration - ADC1->CTLR2 |= ADC_RSTCAL; - while(ADC1->CTLR2 & ADC_RSTCAL); - - // Calibrate - ADC1->CTLR2 |= ADC_CAL; - while(ADC1->CTLR2 & ADC_CAL); - -} - -int funAnalogRead( int nAnalogNumber ) -{ - ADC1->RSQR3 = nAnalogNumber; - - // start sw conversion (auto clears) - ADC1->CTLR2 |= ADC_SWSTART; - - // wait for conversion complete - while(!(ADC1->STATR & ADC_EOC)); - - // get result - return ADC1->RDATAR; -} - -// C++ Support - -#ifdef CPLUSPLUS -// This is required to allow pure virtual functions to be defined. -extern void __cxa_pure_virtual() { while (1); } - -// These magic symbols are provided by the linker. -extern void (*__preinit_array_start[]) (void) __attribute__((weak)); -extern void (*__preinit_array_end[]) (void) __attribute__((weak)); -extern void (*__init_array_start[]) (void) __attribute__((weak)); -extern void (*__init_array_end[]) (void) __attribute__((weak)); - -void __libc_init_array(void) -{ - size_t count; - size_t i; - - count = __preinit_array_end - __preinit_array_start; - for (i = 0; i < count; i++) - __preinit_array_start[i](); - - count = __init_array_end - __init_array_start; - for (i = 0; i < count; i++) - __init_array_start[i](); -} -#endif diff --git a/src/ch32fun/ch32fun.h b/src/ch32fun/ch32fun.h deleted file mode 100644 index e44018d..0000000 --- a/src/ch32fun/ch32fun.h +++ /dev/null @@ -1,1052 +0,0 @@ -/* SPDX-License-Identifier: MIT */ -// This contains a copy of ch32v00x.h and core_riscv.h ch32v00x_conf.h and other misc functions See copyright explanation at the end of the file. - -#ifndef __CH32FUN_H -#define __CH32FUN_H - -#include "funconfig.h" - -/***************************************************************************** - CH32V003 BASICS - - 1. Be sure to see configuration section below! - - 2. Backend Initialization - SystemInit(); - - 3. Arduino-like I/O - funGpioInitAll(); - funPinMode( PA2, GPIO_CFGLR_OUT_10Mhz_PP ); - funDigitalWrite( PA2, FUN_HIGH ); - funDigitalWrite( PA2, FUN_LOW ); - funAnalogRead( 0 ); // Not Pin number, but rather analog number. - - 4. Delays - Delay_Us(n) - Delay_Ms(n) - DelaySysTick( uint32_t n ); - - 5. printf - printf, _write may be semihosted, or printed to UART. - - poll_input, handle_debug_input may be used with semihsoting to accept input from host. - - For UART printf, on: - CH32V003, Port D5, 115200 8n1 - CH32V203, Port A9, 115200 8n1 - - Modifications can be made to SetupUart, or your own version as desired. - - 6. ISR Control Routines - __enable_irq(); // For global interrupt enable - __disable_irq(); // For global interrupt disable - __isenabled_irq(); // For seeing if interrupts are enabled. - NVIC_EnableIRQ(IRQn_Type IRQn) // To enable a specific interrupt - - 7. Hardware MMIO structs, i.e. - SysTick->CNT = current system tick counter (can be Hclk or Hclk/8) - TIM2->CH1CVR = direct control over a PWM output - - 8. Default debug behavior, when semihosting: - a. You get access to DidDebuggerAttach() - so you can see if a debugger has attached. - b. WaitForDebuggerToAttach( int timeout_ms ) - if timeout_ms == 0, will wait for forever. - c. printf will wait 120ms (configurable) to make sure it doesn't drop data. Otherwise, - printf will fast-path to exit after the first timeout. It will still do the string - formatting, but will not wait on output. Timeout is configured with - FUNCONF_DEBUGPRINTF_TIMEOUT. - d. If you hard fault, it will wait indefinitely for a debugger to attach, once attached, - will printf the fault cause, and the memory address of the fault. Space can be saved - by setting FUNCONF_DEBUG_HARDFAULT to 0. -*/ - -/****************************************************************************** - * CH32V003 Fun Configs; please define any non-default options in funconfig.h * - -#define FUNCONF_USE_PLL 1 // Use built-in 2x PLL -#define FUNCONF_USE_HSI 1 // Use HSI Internal Oscillator -#define FUNCONF_USE_HSE 0 // Use External Oscillator -#define FUNCONF_HSITRIM 0x10 // Use factory calibration on HSI Trim. -#define FUNCONF_SYSTEM_CORE_CLOCK 48000000 // Computed Clock in Hz (Default only for 003, other chips have other defaults) -#define FUNCONF_HSE_BYPASS 0 // Use HSE Bypass feature (for oscillator input) -#define FUNCONF_USE_CLK_SEC 1 // Use clock security system, enabled by default -#define FUNCONF_USE_DEBUGPRINTF 1 -#define FUNCONF_USE_UARTPRINTF 0 -#define FUNCONF_NULL_PRINTF 0 // Have printf but direct it "nowhere" -#define FUNCONF_SYSTICK_USE_HCLK 0 // Should systick be at 48 MHz (1) or 6MHz (0) on an '003. Typically set to 0 to divide HCLK by 8. -#define FUNCONF_TINYVECTOR 0 // If enabled, Does not allow normal interrupts. -#define FUNCONF_UART_PRINTF_BAUD 115200 // Only used if FUNCONF_USE_UARTPRINTF is set. -#define FUNCONF_DEBUGPRINTF_TIMEOUT 0x80000 // Arbitrary time units, this is around 120ms. -#define FUNCONF_ENABLE_HPE 1 // Enable hardware interrupt stack. Very good on QingKeV4, i.e. x035, v10x, v20x, v30x, but questionable on 003. - // If you are using that, consider using INTERRUPT_DECORATOR as an attribute to your interrupt handlers. -#define FUNCONF_USE_5V_VDD 0 // Enable this if you plan to use your part at 5V - affects USB and PD configration on the x035. -#define FUNCONF_DEBUG_HARDFAULT 1 // Log fatal errors with "printf" -*/ - -// Sanity check for when porting old code. -#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) || defined(CH32X03x) -#if defined(CH32V003) -#error Cannot define CH32V003 and another arch. -#endif -#endif - -#if !defined(FUNCONF_USE_DEBUGPRINTF) && !defined(FUNCONF_USE_UARTPRINTF) -#define FUNCONF_USE_DEBUGPRINTF 1 -#endif - -#if defined(FUNCONF_USE_UARTPRINTF) && FUNCONF_USE_UARTPRINTF && !defined(FUNCONF_UART_PRINTF_BAUD) -#define FUNCONF_UART_PRINTF_BAUD 115200 -#endif - -#if defined(FUNCONF_USE_DEBUGPRINTF) && FUNCONF_USE_DEBUGPRINTF && !defined(FUNCONF_DEBUGPRINTF_TIMEOUT) -#define FUNCONF_DEBUGPRINTF_TIMEOUT 0x80000 -#endif - -#if defined(FUNCONF_USE_HSI) && defined(FUNCONF_USE_HSE) && FUNCONF_USE_HSI && FUNCONF_USE_HSE -#error FUNCONF_USE_HSI and FUNCONF_USE_HSE cannot both be set -#endif - -#if !defined(FUNCONF_USE_HSI) && !defined(FUNCONF_USE_HSE) -#define FUNCONF_USE_HSI 1 // Default to use HSI -#define FUNCONF_USE_HSE 0 -#endif - -#if defined(CH32X03x) && FUNCONF_USE_HSE -#error No HSE in CH32X03x -#endif - -#if !defined(FUNCONF_USE_PLL) -#if defined(CH32X03x) -#define FUNCONF_USE_PLL 0 // No PLL on X03x -#else -#define FUNCONF_USE_PLL 1 // Default to use PLL -#endif -#endif - -#if !defined(FUNCONF_DEBUG_HARDFAULT) -#define FUNCONF_DEBUG_HARDFAULT 1 -#endif - -#if defined(CH32X03x) && FUNCONF_USE_PLL -#error No PLL on the X03x -#endif - -#ifndef FUNCONF_ENABLE_HPE -#define FUNCONF_ENABLE_HPE 0 -#endif - -#if FUNCONF_ENABLE_HPE == 1 -#define INTERRUPT_DECORATOR __attribute__((interrupt("WCH-Interrupt-fast"))) -#else -#define INTERRUPT_DECORATOR __attribute__((interrupt)) -#endif - -#if !defined(FUNCONF_USE_CLK_SEC) -#define FUNCONF_USE_CLK_SEC 1 // use clock security system by default -#endif - -#ifndef HSE_VALUE -#if defined(CH32V003) -#define HSE_VALUE (24000000) // Value of the External oscillator in Hz, default -#elif defined(CH32V10x) -#define HSE_VALUE (8000000) -#elif defined(CH32V20x) -#if defined(CH32V20x_D8) || defined(CH32V20x_D8W) -#define HSE_VALUE (32000000) -#else -#define HSE_VALUE (8000000) -#endif -#elif defined(CH32V30x) -#define HSE_VALUE (8000000) -#endif -#endif - -#ifndef HSI_VALUE -#if defined(CH32V003) -#define HSI_VALUE (24000000) // Value of the Internal oscillator in Hz, default. -#elif defined(CH32X03x) -#define HSI_VALUE (48000000) -#elif defined(CH32V10x) -#define HSI_VALUE (8000000) -#elif defined(CH32V20x) -#define HSI_VALUE (8000000) -#elif defined(CH32V30x) -#define HSI_VALUE (8000000) -#endif -#endif - -#ifndef FUNCONF_HSITRIM -#define FUNCONF_HSITRIM 0x10 // Default (Chip default) -#endif - -#ifndef FUNCONF_USE_PLL -#define FUNCONF_USE_PLL 1 // Default, Use PLL. -#endif - -#if !defined(FUNCONF_PLL_MULTIPLIER) -#if defined(FUNCONF_USE_PLL) && FUNCONF_USE_PLL -#if defined(CH32V10x) -#define FUNCONF_PLL_MULTIPLIER 10 // Default: 8 * 10 = 80 MHz -#elif defined(CH32V20x) -#define FUNCONF_PLL_MULTIPLIER 18 // Default: 8 * 18 = 144 MHz -#elif defined(CH32V30x) -#define FUNCONF_PLL_MULTIPLIER 18 // Default: 8 * 18 = 144 MHz -#else // CH32V003 -#define FUNCONF_PLL_MULTIPLIER 2 // Default: 24 * 2 = 48 MHz -#endif -#else -#define FUNCONF_PLL_MULTIPLIER 1 -#endif -#endif - -#ifndef FUNCONF_SYSTEM_CORE_CLOCK -#if defined(FUNCONF_USE_HSI) && FUNCONF_USE_HSI -#define FUNCONF_SYSTEM_CORE_CLOCK ((HSI_VALUE) * (FUNCONF_PLL_MULTIPLIER)) -#elif defined(FUNCONF_USE_HSE) && FUNCONF_USE_HSE -#define FUNCONF_SYSTEM_CORE_CLOCK ((HSE_VALUE) * (FUNCONF_PLL_MULTIPLIER)) -#else -#error Must define either FUNCONF_USE_HSI or FUNCONF_USE_HSE to be 1. -#endif -#endif - -#ifndef FUNCONF_USE_5V_VDD -#define FUNCONF_USE_5V_VDD 0 -#endif - -// Default package for CH32V20x -#if defined(CH32V20x) -#if !defined(CH32V20x_D8W) && !defined(CH32V20x_D8) && !defined(CH32V20x_D6) -#define CH32V20x_D6 /* CH32V203F6-CH32V203F8-CH32V203G6-CH32V203G8-CH32V203K6-CH32V203K8-CH32V203C6-CH32V203C8 */ -// #define CH32V20x_D8 /* CH32V203RBT6 */ -// #define CH32V20x_D8W /* CH32V208 */ -#endif -#endif - -// Default package for CH32V30x -#if defined(CH32V30x) -#if !defined(CH32V30x_D8) && !defined(CH32V30x_D8C) -// #define CH32V30x_D8 /* CH32V303x */ -#define CH32V30x_D8C /* CH32V307x-CH32V305x */ -#endif -#endif - -///////////////////////////////////////////////////////////////////////////////////////////////// -// Legacy, for EVT, CMSIS - -#define __MPU_PRESENT 0 /* Other CH32 devices does not provide an MPU */ -#define __Vendor_SysTickConfig 0 /* Set to 1 if different SysTick Config is used */ - -#ifndef __ASSEMBLER__ // Things before this can be used in assembly. - -#include - -#ifdef __cplusplus -#define __I volatile /*!< defines 'read only' permissions */ -#else -#define __I volatile const /*!< defines 'read only' permissions */ -#endif -#define __O volatile /*!< defines 'write only' permissions */ -#define __IO volatile /*!< defines 'read / write' permissions */ - -#endif // __ASSEMBLER__ - -/////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////// -// Code in this section was originally from __CORE_RISCV_H__ - -#ifndef __CORE_RISCV_H__ -#define __CORE_RISCV_H__ - -/* define compiler specific symbols */ -#if defined(__CC_ARM) -#define __ASM __asm /*!< asm keyword for ARM Compiler */ -#define __INLINE __inline /*!< inline keyword for ARM Compiler */ - -#elif defined(__ICCARM__) -#define __ASM __asm /*!< asm keyword for IAR Compiler */ -#define __INLINE inline /*!< inline keyword for IAR Compiler. Only avaiable in High optimization mode! */ - -#elif defined(__GNUC__) -#define __ASM __asm /*!< asm keyword for GNU Compiler */ -#define __INLINE inline /*!< inline keyword for GNU Compiler */ - -#elif defined(__TASKING__) -#define __ASM __asm /*!< asm keyword for TASKING Compiler */ -#define __INLINE inline /*!< inline keyword for TASKING Compiler */ - -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - -#ifndef __ASSEMBLER__ - - /* Standard Peripheral Library old types (maintained for legacy purpose) */ - typedef __I uint32_t vuc32; /* Read Only */ - typedef __I uint16_t vuc16; /* Read Only */ - typedef __I uint8_t vuc8; /* Read Only */ - - typedef const uint32_t uc32; /* Read Only */ - typedef const uint16_t uc16; /* Read Only */ - typedef const uint8_t uc8; /* Read Only */ - - typedef __I int32_t vsc32; /* Read Only */ - typedef __I int16_t vsc16; /* Read Only */ - typedef __I int8_t vsc8; /* Read Only */ - - typedef const int32_t sc32; /* Read Only */ - typedef const int16_t sc16; /* Read Only */ - typedef const int8_t sc8; /* Read Only */ - - typedef __IO uint32_t vu32; - typedef __IO uint16_t vu16; - typedef __IO uint8_t vu8; - - typedef uint32_t u32; - typedef uint16_t u16; - typedef uint8_t u8; - - typedef __IO int32_t vs32; - typedef __IO int16_t vs16; - typedef __IO int8_t vs8; - - typedef int32_t s32; - typedef int16_t s16; - typedef int8_t s8; - - typedef __I uint64_t vuc64; /* Read Only */ - typedef const uint64_t uc64; /* Read Only */ - typedef __I int64_t vsc64; /* Read Only */ - typedef const int64_t sc64; /* Read Only */ - typedef __IO uint64_t vu64; - typedef uint64_t u64; - typedef __IO int64_t vs64; - typedef int64_t s64; - - typedef enum - { - NoREADY = 0, - READY = !NoREADY - } ErrorStatus; - - typedef enum - { - DISABLE = 0, - ENABLE = !DISABLE - } FunctionalState; - - typedef enum - { - RESET = 0, - SET = !RESET - } FlagStatus, ITStatus; - -#define RV_STATIC_INLINE static inline -#endif // __ASSEMBLER__ - -#ifdef CH32V003 -#include "ch32v003hw.h" -#elif defined(CH32X03x) -#include "ch32x03xhw.h" -#elif defined(CH32X03x) -#include "ch32x03xhw.h" -#elif defined(CH32V10x) -#include "ch32v10xhw.h" -#elif defined(CH32V20x) -#include "ch32v20xhw.h" -#elif defined(CH32V30x) -#include "ch32v30xhw.h" -#endif - -#if defined(__riscv) || defined(__riscv__) || defined(CH32V003FUN_BASE) - -#if __GNUC__ > 10 -#define ADD_ARCH_ZICSR ".option arch, +zicsr\n" -#else -#define ADD_ARCH_ZICSR -#endif - -#ifndef __ASSEMBLER__ - - // Enable Global Interrupt - RV_STATIC_INLINE void __enable_irq() - { - uint32_t result; - __ASM volatile(ADD_ARCH_ZICSR "csrr %0," - "mstatus" : "=r"(result)); - result |= 0x88; - __ASM volatile(ADD_ARCH_ZICSR "csrw mstatus, %0" : : "r"(result)); - } - - // Disable Global Interrupt - RV_STATIC_INLINE void __disable_irq() - { - uint32_t result; - __ASM volatile(ADD_ARCH_ZICSR "csrr %0," - "mstatus" : "=r"(result)); - result &= ~0x88; - __ASM volatile(ADD_ARCH_ZICSR "csrw mstatus, %0" : : "r"(result)); - } - - // Is Global Interrupt enabled (1 = yes, 0 = no) - RV_STATIC_INLINE uint8_t __isenabled_irq(void) - { - uint32_t result; - __ASM volatile(ADD_ARCH_ZICSR "csrr %0," - "mstatus" : "=r"(result)); - return (result & 0x08) != 0u; - } - - // Get stack pointer (returns the stack pointer) - RV_STATIC_INLINE uint32_t __get_cpu_sp(void) - { - uint32_t result; - __ASM volatile(ADD_ARCH_ZICSR "mv %0, sp" : "=r"(result)); - return result; - } - - // nop - RV_STATIC_INLINE void __NOP() - { - __ASM volatile("nop"); - } - - // Enable Interrupt (by interrupt number) - RV_STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) - { - NVIC->IENR[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); - } - - // Disable Interrupt (by interrupt number) - RV_STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) - { - NVIC->IRER[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); - } - - // Get Interrupt Enable State, (by number), 1 = Triggered 0 = Not triggered - RV_STATIC_INLINE uint32_t NVIC_GetStatusIRQ(IRQn_Type IRQn) - { - return ((uint32_t)((NVIC->ISR[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F))) ? 1 : 0)); - } - - // Get Interrupt Pending State, (by number), 1 = Pending 0 = Not pending - RV_STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) - { - return ((uint32_t)((NVIC->IPR[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F))) ? 1 : 0)); - } - - // "current number break hang" - RV_STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) - { - NVIC->IPSR[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); - } - - // Clear Interrupt Pending - RV_STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) - { - NVIC->IPRR[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); - } - - // Get Interrupt Active State (returns 1 if active) - RV_STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn) - { - return ((uint32_t)((NVIC->IACTR[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F))) ? 1 : 0)); - } - - // Set Interrupt Priority (priority: bit7: pre-emption priority, bit6: subpriority, bit[5-0]: reserved - RV_STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint8_t priority) - { - NVIC->IPRIOR[(uint32_t)(IRQn)] = priority; - } - - /********************************************************************* - * SUSPEND ALL INTERRUPTS EXCEPT - * The following 3 functions serve to suspend all interrupts, except for the one you momentarily need. - * The purpose of this is to not disturb the one interrupt of interest and let it run unimpeded. - * procedure: - * 1. save the enabled IRQs: uint32_t IRQ_backup = NVIC_get_enabled_IRQs(); - * 2. disable all IRQs: NVIC_clear_all_IRQs_except(IRQ_of_interest); - * 3. restore the previously enabled IRQs: NVIC_restore_IRQs(IRQ_backup); - * - * bit layout of the IRQ backup - * bit 0 | 1 | 2 | 3 | 4 | 5 | 6 .. 22 | 23 .. 28 - * IRQn 2 | 3 | 12 | res | 14 | res | 16 .. 31 | 32 .. 38 - * IRQn 2 and 3 aren't actually user-settable (see RM). - * - * Specifying an invalid IRQn_to_keep like 0 will disable all interrupts. - */ - - RV_STATIC_INLINE uint32_t NVIC_get_enabled_IRQs() - { - return (((NVIC->ISR[0] >> 2) & 0b11) | ((NVIC->ISR[0] >> 12) << 2) | ((NVIC->ISR[1] & 0b1111111) << 23)); - } - - RV_STATIC_INLINE void NVIC_clear_all_IRQs_except(uint8_t IRQn_to_keep) - { - if (!(IRQn_to_keep >> 5)) - { // IRQn_to_keep < 32 - NVIC->IRER[0] = (~0) & (~(1 << IRQn_to_keep)); - NVIC->IRER[1] = (~0); - } - else - { - IRQn_to_keep = IRQn_to_keep >> 5; - NVIC->IRER[0] = (~0); - NVIC->IRER[1] = (~0) & (~(1 << IRQn_to_keep)); - } - } - - RV_STATIC_INLINE void NVIC_restore_IRQs(uint32_t old_state) - { - NVIC->IENR[0] = (old_state >> 2) << 12; - NVIC->IENR[1] = old_state >> 23; - } - - // WFI - wait for interrupt (like a light sleep) - __attribute__((always_inline)) RV_STATIC_INLINE void __WFI(void) - { - NVIC->SCTLR &= ~(1 << 3); // wfi - __ASM volatile("wfi"); - } - - // WFE - wait for events (more like a deeper sleep) - __attribute__((always_inline)) RV_STATIC_INLINE void __WFE(void) - { - uint32_t t; - - t = NVIC->SCTLR; - NVIC->SCTLR |= (1 << 3) | (1 << 5); // (wfi->wfe)+(__sev) - NVIC->SCTLR = (NVIC->SCTLR & ~(1 << 5)) | (t & (1 << 5)); - __ASM volatile("wfi"); - __ASM volatile("wfi"); - } - - /********************************************************************* - * @fn SetVTFIRQ - * @brief Set VTF Interrupt - * @param addr - VTF interrupt service function base address. - * IRQn - Interrupt Numbers - * num - VTF Interrupt Numbers - * NewState - DISABLE or ENABLE - * - * @return none - */ - RV_STATIC_INLINE void SetVTFIRQ(uint32_t addr, IRQn_Type IRQn, uint8_t num, FunctionalState NewState) - { - if (num > 1) return; - - if (NewState != DISABLE) - { - NVIC->VTFIDR[num] = IRQn; - NVIC->VTFADDR[num] = ((addr & 0xFFFFFFFE) | 0x1); - } - else - { - NVIC->VTFIDR[num] = IRQn; - NVIC->VTFADDR[num] = ((addr & 0xFFFFFFFE) & (~0x1)); - } - } - - // Initiate a system reset request - RV_STATIC_INLINE void NVIC_SystemReset(void) - { - NVIC->CFGR = NVIC_KEY3 | (1 << 7); - } - - // For reading INTSYSCR, for interrupt nesting + hardware stack enable. - static inline uint32_t __get_INTSYSCR(void) - { - uint32_t result; - __ASM volatile(ADD_ARCH_ZICSR "csrr %0, 0x804" : "=r"(result)); - return result; - } - - // For setting INTSYSCR, for interrupt nesting + hardware stack enable. - static inline void __set_INTSYSCR(uint32_t value) - { - __ASM volatile(ADD_ARCH_ZICSR "csrw 0x804, %0" : : "r"(value)); - } - -#if defined(CH32V30x) - - // Return the Floating-Point Accrued Exceptions - static inline uint32_t __get_FFLAGS(void) - { - uint32_t result; - __ASM volatile(ADD_ARCH_ZICSR "csrr %0," - "fflags" : "=r"(result)); - return (result); - } - - // Set the Floating-Point Accrued Exceptions - static inline void __set_FFLAGS(uint32_t value) - { - __ASM volatile(ADD_ARCH_ZICSR "csrw fflags, %0" : : "r"(value)); - } - - // Return the Floating-Point Dynamic Rounding Mode - static inline uint32_t __get_FRM(void) - { - uint32_t result; - __ASM volatile(ADD_ARCH_ZICSR "csrr %0," - "frm" : "=r"(result)); - return (result); - } - - // Set the Floating-Point Dynamic Rounding Mode - static inline void __set_FRM(uint32_t value) - { - __ASM volatile(ADD_ARCH_ZICSR "csrw frm, %0" : : "r"(value)); - } - - // Return the Floating-Point Control and Status Register - static inline uint32_t __get_FCSR(void) - { - uint32_t result; - __ASM volatile(ADD_ARCH_ZICSR "csrr %0," - "fcsr" : "=r"(result)); - return (result); - } - - // Set the Floating-Point Dynamic Rounding Mode - static inline void __set_FCSR(uint32_t value) - { - __ASM volatile(ADD_ARCH_ZICSR "csrw fcsr, %0" : : "r"(value)); - } - -#endif // CH32V30x - - // Return the Machine Status Register (MSTATUS) - static inline uint32_t __get_MSTATUS(void) - { - uint32_t result; - __ASM volatile(ADD_ARCH_ZICSR "csrr %0, mstatus" : "=r"(result)); - return (result); - } - - // Set the Machine Status Register (MSTATUS) - static inline void __set_MSTATUS(uint32_t value) - { - __ASM volatile(ADD_ARCH_ZICSR "csrw mstatus, %0" : : "r"(value)); - } - - // Return the Machine ISA Register (MISA) - static inline uint32_t __get_MISA(void) - { - uint32_t result; - __ASM volatile(ADD_ARCH_ZICSR "csrr %0, misa" : "=r"(result)); - return (result); - } - - // Set the Machine ISA Register (MISA) - static inline void __set_MISA(uint32_t value) - { - __ASM volatile(ADD_ARCH_ZICSR "csrw misa, %0" : : "r"(value)); - } - - // Return the Machine Trap-Vector Base-Address Register (MTVEC) - static inline uint32_t __get_MTVEC(void) - { - uint32_t result; - __ASM volatile(ADD_ARCH_ZICSR "csrr %0," - "mtvec" : "=r"(result)); - return (result); - } - - // * @brief Set the Machine Trap-Vector Base-Address Register (MTVEC) - static inline void __set_MTVEC(uint32_t value) - { - __ASM volatile(ADD_ARCH_ZICSR "csrw mtvec, %0" ::"r"(value)); - } - - // Return the Machine Seratch Register (MSCRATCH) - static inline uint32_t __get_MSCRATCH(void) - { - uint32_t result; - __ASM volatile(ADD_ARCH_ZICSR "csrr %0," - "mscratch" : "=r"(result)); - return (result); - } - - // Set the Machine Seratch Register (MSRATCH) - static inline void __set_MSCRATCH(uint32_t value) - { - __ASM volatile(ADD_ARCH_ZICSR "csrw mscratch, %0" : : "r"(value)); - } - - // Return the Machine Exception Program Register (MEPC) - static inline uint32_t __get_MEPC(void) - { - uint32_t result; - __ASM volatile(ADD_ARCH_ZICSR "csrr %0," - "mepc" : "=r"(result)); - return (result); - } - - // Set the Machine Exception Program Register (MEPC) - static inline void __set_MEPC(uint32_t value) - { - __ASM volatile(ADD_ARCH_ZICSR "csrw mepc, %0" : : "r"(value)); - } - - // Return the Machine Cause Register (MCAUSE) - static inline uint32_t __get_MCAUSE(void) - { - uint32_t result; - __ASM volatile(ADD_ARCH_ZICSR "csrr %0," - "mcause" : "=r"(result)); - return (result); - } - - // Set the Machine Cause Register (MCAUSE) - static inline void __set_MCAUSE(uint32_t value) - { - __ASM volatile(ADD_ARCH_ZICSR "csrw mcause, %0" ::"r"(value)); - } - - // Return the Machine Trap Value Register (MTVAL) - static inline uint32_t __get_MTVAL(void) - { - uint32_t result; - __ASM volatile(ADD_ARCH_ZICSR "csrr %0," - "mtval" : "=r"(result)); - return (result); - } - - // Set the Machine Trap Value Register (MTVAL) - static inline void __set_MTVAL(uint32_t value) - { - __ASM volatile(ADD_ARCH_ZICSR "csrw mtval, %0" : : "r"(value)); - } - - // Return Vendor ID Register (MVENDORID) - static inline uint32_t __get_MVENDORID(void) - { - uint32_t result; - __ASM volatile(ADD_ARCH_ZICSR "csrr %0, mvendorid" : "=r"(result)); - return (result); - } - - // Return Machine Architecture ID Register (MARCHID) - static inline uint32_t __get_MARCHID(void) - { - uint32_t result; - __ASM volatile(ADD_ARCH_ZICSR "csrr %0, marchid" : "=r"(result)); - return (result); - } - - // Return Machine Implementation ID Register (MIPID) - static inline uint32_t __get_MIMPID(void) - { - uint32_t result; - __ASM volatile(ADD_ARCH_ZICSR "csrr %0, mimpid" : "=r"(result)); - return (result); - } - - // Return Hart ID Register MHARTID - static inline uint32_t __get_MHARTID(void) - { - uint32_t result; - __ASM volatile(ADD_ARCH_ZICSR "csrr %0, mhartid" : "=r"(result)); - return (result); - } - -#if defined(CH32V003) && CH32V003 - - // Return DBGMCU_CR Register value - static inline uint32_t __get_DEBUG_CR(void) - { - uint32_t result; - __ASM volatile(ADD_ARCH_ZICSR "csrr %0, 0x7C0" : "=r"(result)); - return (result); - } - - // Set the DBGMCU_CR Register value - static inline void __set_DEBUG_CR(uint32_t value) - { - __ASM volatile(ADD_ARCH_ZICSR "csrw 0x7C0, %0" : : "r"(value)); - } - - // Return stack pointer register (SP) - static inline uint32_t __get_SP(void) - { - uint32_t result; - __ASM volatile("mv %0," - "sp" : "=r"(result) :); - return (result); - } -#endif // CH32V003 - -#endif // !assembler - -// _JBTYPE using long long to make sure the alignment is align to 8 byte, -// otherwise in rv32imafd, store/restore FPR may mis-align. -#define _JBTYPE long long -#if defined(__riscv_abi_rve) -#define _JBLEN ((4 * sizeof(long)) / sizeof(long)) -#elif defined(__riscv_float_abi_double) -#define _JBLEN ((14 * sizeof(long) + 12 * sizeof(double)) / sizeof(long)) -#elif defined(__riscv_float_abi_single) -#define _JBLEN ((14 * sizeof(long) + 12 * sizeof(float)) / sizeof(long)) -#else -#define _JBLEN ((14 * sizeof(long)) / sizeof(long)) -#endif - -#ifndef __ASSEMBLER__ -#ifdef _JBLEN -#ifdef _JBTYPE - typedef _JBTYPE jmp_buf[_JBLEN]; -#else - typedef int jmp_buf[_JBLEN]; -#endif // _JBTYPE -#endif // _JBLEN - - int setjmp(jmp_buf env); - void longjmp(jmp_buf env, int val); -#endif - -#endif // defined(__riscv) || defined(__riscv__) || defined( CH32V003FUN_BASE ) - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_RISCV_H__ */ - -/////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////// - -#ifdef __cplusplus -extern "C" -{ -#endif - - /* SYSTICK info - * time on the ch32v003 is kept by the SysTick counter (32bit) - * by default, it will operate at (FUNCONF_SYSTEM_CORE_CLOCK / 8) = 6MHz - * more info at https://github.com/cnlohr/ch32v003fun/wiki/Time - */ - -#if defined(FUNCONF_SYSTICK_USE_HCLK) && FUNCONF_SYSTICK_USE_HCLK && !defined(CH32V10x) -#define DELAY_US_TIME ((FUNCONF_SYSTEM_CORE_CLOCK) / 1000000) -#define DELAY_MS_TIME ((FUNCONF_SYSTEM_CORE_CLOCK) / 1000) -#else // Use systick = hclk/8 -#define DELAY_US_TIME ((FUNCONF_SYSTEM_CORE_CLOCK) / 8000000) -#define DELAY_MS_TIME ((FUNCONF_SYSTEM_CORE_CLOCK) / 8000) -#endif - -#define Delay_Us(n) DelaySysTick((n) * DELAY_US_TIME) -#define Delay_Ms(n) DelaySysTick((n) * DELAY_MS_TIME) - -#define Ticks_from_Us(n) (n * DELAY_US_TIME) -#define Ticks_from_Ms(n) (n * DELAY_MS_TIME) - -// Add a certain number of nops. Note: These are usually executed in pairs -// and take two cycles, so you typically would use 0, 2, 4, etc. -#define ADD_N_NOPS(n) asm volatile(".rept " #n "\nc.nop\n.endr"); - -// Arduino-like GPIO Functionality -#define GpioOf(pin) ((GPIO_TypeDef *)(GPIOA_BASE + 0x400 * ((pin) >> 4))) - -#define FUN_HIGH 0x1 -#define FUN_LOW 0x0 -#define FUN_OUTPUT (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP) -#define FUN_INPUT (GPIO_CNF_IN_FLOATING) - - // For pins, use things like PA8, PB15 - // For configuration, use things like GPIO_CFGLR_OUT_10Mhz_PP - -#define funDigitalWrite(pin, value) \ - { \ - GpioOf(pin)->BSHR = 1 << ((!(value)) * 16 + ((pin) & 0xf)); \ - } - -#if defined(CH32X03x) -#define funGpioInitAll() \ - { \ - RCC->APB2PCENR |= (RCC_APB2Periph_AFIO | RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOC); \ - } -#define funPinMode(pin, mode) \ - { \ - *((&GpioOf(pin)->CFGLR) + ((pin & 0x8) >> 3)) = ((*((&GpioOf(pin)->CFGLR) + ((pin & 0x8) >> 3))) & (~(0xf << (4 * ((pin) & 0x7))))) | ((mode) << (4 * ((pin) & 0x7))); \ - } -#elif defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) -#define funGpioInitAll() \ - { \ - RCC->APB2PCENR |= (RCC_APB2Periph_AFIO | RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOD); \ - } -#define funPinMode(pin, mode) \ - { \ - *((&GpioOf(pin)->CFGLR) + ((pin & 0x8) >> 3)) = ((*((&GpioOf(pin)->CFGLR) + ((pin & 0x8) >> 3))) & (~(0xf << (4 * ((pin) & 0x7))))) | ((mode) << (4 * ((pin) & 0x7))); \ - } -#define funGpioInitB() \ - { \ - RCC->APB2PCENR |= (RCC_APB2Periph_AFIO | RCC_APB2Periph_GPIOB); \ - } -#else -#define funGpioInitAll() \ - { \ - RCC->APB2PCENR |= (RCC_APB2Periph_AFIO | RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOD); \ - } -#define funPinMode(pin, mode) \ - { \ - GpioOf(pin)->CFGLR = (GpioOf(pin)->CFGLR & (~(0xf << (4 * ((pin) & 0xf))))) | ((mode) << (4 * ((pin) & 0xf))); \ - } -#endif - -#define funGpioInitA() \ - { \ - RCC->APB2PCENR |= (RCC_APB2Periph_AFIO | RCC_APB2Periph_GPIOA); \ - } -#define funGpioInitC() \ - { \ - RCC->APB2PCENR |= (RCC_APB2Periph_AFIO | RCC_APB2Periph_GPIOC); \ - } -#define funGpioInitD() \ - { \ - RCC->APB2PCENR |= (RCC_APB2Periph_AFIO | RCC_APB2Periph_GPIOD); \ - } -#define funDigitalRead(pin) ((int)((GpioOf(pin)->INDR >> ((pin) & 0xf)) & 1)) - -#define ANALOG_0 0 -#define ANALOG_1 1 -#define ANALOG_2 2 -#define ANALOG_3 3 -#define ANALOG_4 4 -#define ANALOG_5 5 -#define ANALOG_6 6 -#define ANALOG_7 7 -#define ANALOG_8 8 -#define ANALOG_9 9 -#define ANALOG_10 10 -#define ANALOG_11 11 - -#ifndef __ASSEMBLER__ - -#if defined(__riscv) || defined(__riscv__) || defined(CH32V003FUN_BASE) - - // Stuff that can only be compiled on device (not for the programmer, or other host programs) - - // Initialize the ADC calibrate it and set some sane defaults. - void funAnalogInit(void); - - // Read an analog input (not a GPIO pin number) - // Be sure to call funAnalogInit first. - int funAnalogRead(int nAnalogNumber); - - void handle_reset() __attribute__((naked)) __attribute((section(".text.handle_reset"))) __attribute__((used)); - void DefaultIRQHandler(void) __attribute__((section(".text.vector_handler"))) __attribute__((naked)) __attribute__((used)); -// used to clear the CSS flag in case of clock fail switch -#if defined(FUNCONF_USE_CLK_SEC) && FUNCONF_USE_CLK_SEC - void NMI_RCC_CSS_IRQHandler(void) __attribute__((section(".text.vector_handler"))) __attribute__((naked)) __attribute__((used)); -#endif - - void DelaySysTick(uint32_t n); - -// Depending on a LOT of factors, it's about 6 cycles per n. -// **DO NOT send it zero or less.** -#ifndef __MACOSX__ -#ifndef __DELAY_TINY_DEFINED__ -#define __DELAY_TINY_DEFINED__ - static inline void Delay_Tiny(int n) - { - __ASM volatile("\ - mv a5, %[n]\n\ - 1: \ - c.addi a5, -1\n\ - c.bnez a5, 1b" : : [n] "r"(n) : "a5"); - } -#endif -#endif -#endif // defined(__riscv) || defined(__riscv__) || defined( CH32V003FUN_BASE ) - - // Tricky: We need to make sure main and SystemInit() are preserved. - int main() __attribute__((used)); - void SystemInit(void); - -#ifdef FUNCONF_UART_PRINTF_BAUD -#define UART_BAUD_RATE FUNCONF_UART_PRINTF_BAUD -#else -#define UART_BAUD_RATE 115200 -#endif -// Debug UART baud rate register calculation. Works assuming HCLK prescaler is off. -// Computes UART_BRR = CORE_CLOCK / BAUD_RATE with rounding to closest integer -#define UART_BRR (((FUNCONF_SYSTEM_CORE_CLOCK) + (UART_BAUD_RATE) / 2) / (UART_BAUD_RATE)) - // Put an output debug UART on Pin D5. - // You can write to this with printf(...) or puts(...) - - void SetupUART(int uartBRR); - - // Returns 1 if timeout reached, 0 otherwise. - // If timeout_ms == 0, wait indefinitely. - // Use DidDebuggerAttach() For a zero-wait way of seeing if it attached. - int WaitForDebuggerToAttach(int timeout_ms); - -// Returns 1 if a debugger has activated the debug module. -#define DidDebuggerAttach() (!*DMSTATUS_SENTINEL) - -// Returns 1 if a debugger has activated the debug module. -#define DebugPrintfBufferFree() (!(*DMDATA0 & 0x80)) - - // Just a definition to the internal _write function. - int _write(int fd, const char *buf, int size); - - // Call this to busy-wait the polling of input. - void poll_input(void); - - // Receiving bytes from host. Override if you wish. - void handle_debug_input(int numbytes, uint8_t *data); - -// Functions from ch32fun.c -#include - - int mini_vsnprintf(char *buffer, unsigned int buffer_len, const char *fmt, va_list va); - int mini_vpprintf(int (*puts)(char *s, int len, void *buf), void *buf, const char *fmt, va_list va); - int mini_snprintf(char *buffer, unsigned int buffer_len, const char *fmt, ...); - int mini_pprintf(int (*puts)(char *s, int len, void *buf), void *buf, const char *fmt, ...); - -#endif // __ASSEMBLER__ - - /* - * This file contains various parts of the official WCH EVT Headers which - * were originally under a restrictive license. - * - * The collection of this file was generated by - * cnlohr, 2023-02-18 and - * AlexanderMandera, 2023-06-23 - * It was significantly reworked into several files cnlohr, 2025-01-29 - * - * While originally under a restrictive copyright, WCH has approved use - * under MIT-licensed use, because of inclusion in Zephyr, as well as other - * open-source licensed projects. - * - * These copies of the headers from WCH are available now under: - * - * Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the “Softwareâ€), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED “AS ISâ€, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ - -#ifdef __cplusplus -}; -#endif - -#endif // __CH32FUN_H diff --git a/src/ch32fun/ch32fun.ld b/src/ch32fun/ch32fun.ld deleted file mode 100644 index 352dfb5..0000000 --- a/src/ch32fun/ch32fun.ld +++ /dev/null @@ -1,222 +0,0 @@ -ENTRY( InterruptVector ) - -MEMORY -{ -#if TARGET_MCU_LD == 0 - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 16K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 2K -#elif TARGET_MCU_LD == 1 - #if MCU_PACKAGE == 1 - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 64K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K - #elif MCU_PACKAGE == 2 - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 32K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 10K - #else - #error "Unknown MCU package" - #endif -#elif TARGET_MCU_LD == 2 - #if MCU_PACKAGE == 1 - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 64K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K - #elif MCU_PACKAGE == 2 - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 32K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 10K - #elif MCU_PACKAGE == 3 - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 128K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K - #else - #error "Unknown MCU package" - #endif -#elif TARGET_MCU_LD == 3 - #if MCU_PACKAGE == 1 - #if TARGET_MCU_MEMORY_SPLIT == 1 - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 224K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K - #elif TARGET_MCU_MEMORY_SPLIT == 2 - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 256K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K - #elif TARGET_MCU_MEMORY_SPLIT == 3 - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 288K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K - #else - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 192K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K - #endif - #elif MCU_PACKAGE == 2 - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 128K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K - #else - #error "Unknown MCU package" - #endif -#elif TARGET_MCU_LD == 4 - #if MCU_PACKAGE == 1 - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 62K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K - #else - #error "Unknown MCU package" - #endif -#elif TARGET_MCU_LD == 5 - /* CH32V002 */ - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 16K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 4K -#elif TARGET_MCU_LD == 6 - /* CH32V004 */ - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 32K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 6K -#elif TARGET_MCU_LD == 7 - /* CH32V005, CH32V006, CH32V007 */ - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 62K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 8K -#else - #error "Unknown MCU target" -#endif -} - -SECTIONS -{ - .init : - { - _sinit = .; - . = ALIGN(4); - KEEP(*(SORT_NONE(.init))) - . = ALIGN(4); - _einit = .; - } >FLASH AT>FLASH - - .text : - { - . = ALIGN(4); - *(.text) - *(.text.*) - *(.rodata) - *(.rodata*) - *(.gnu.linkonce.t.*) - . = ALIGN(4); - } >FLASH AT>FLASH - - .fini : - { - KEEP(*(SORT_NONE(.fini))) - . = ALIGN(4); - } >FLASH AT>FLASH - - PROVIDE( _etext = . ); - PROVIDE( _eitcm = . ); - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >FLASH AT>FLASH - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >FLASH AT>FLASH - - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__fini_array_end = .); - } >FLASH AT>FLASH - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >FLASH AT>FLASH - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >FLASH AT>FLASH - - .dalign : - { - . = ALIGN(4); - PROVIDE(_data_vma = .); - } >RAM AT>FLASH - - .dlalign : - { - . = ALIGN(4); - PROVIDE(_data_lma = .); - } >FLASH AT>FLASH - - .data : - { - . = ALIGN(4); - __global_pointer$ = . + 0x3fc; /* This gets set in the startup code. This allows -mrelax'd code to be smaller by acting as a sort of quick reference in the gp register. */ - *(.gnu.linkonce.r.*) - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - *(.sdata .sdata.*) - *(.sdata2*) - *(.gnu.linkonce.s.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - . = ALIGN(4); - PROVIDE( _edata = .); - } >RAM AT>FLASH - - .bss : - { - . = ALIGN(4); - PROVIDE( _sbss = .); - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss*) - *(.gnu.linkonce.b.*) - *(COMMON*) - . = ALIGN(4); - PROVIDE( _ebss = .); - } >RAM AT>FLASH - - PROVIDE( _end = _ebss); - PROVIDE( end = . ); - - PROVIDE( _eusrstack = ORIGIN(RAM) + LENGTH(RAM)); - - /DISCARD/ : { - *(.note .note.*) - *(.eh_frame .eh_frame.*) - *(.comment .comment.*) - *(.ARM.extab* .gnu.linkonce.armextab.*) - *(.ARM.exidx*) - } -} - - - diff --git a/src/ch32fun/ch32fun.mk b/src/ch32fun/ch32fun.mk deleted file mode 100644 index eb76e65..0000000 --- a/src/ch32fun/ch32fun.mk +++ /dev/null @@ -1,262 +0,0 @@ -# Default prefix for Windows -ifeq ($(OS),Windows_NT) - PREFIX?=riscv64-unknown-elf -# Check if riscv64-unknown-elf-gcc exists -else ifneq ($(shell which riscv64-unknown-elf-gcc),) - PREFIX?=riscv64-unknown-elf -# We used to check if riscv64-linux-gnu-gcc exists, because it would still produce valid output with -ffreestanding. -# It was different enough that we decided not to automatically fallback to it. -# Default prefix -else - PREFIX?=riscv64-elf -endif - -# Fedora places newlib in a different location -ifneq ($(wildcard /etc/fedora-release),) - NEWLIB?=/usr/arm-none-eabi/include -else - NEWLIB?=/usr/include/newlib -endif - -CH32FUN?=$(shell dirname $(lastword $(MAKEFILE_LIST))) -#TARGET_MCU?=CH32V003 # Because we are now opening up to more processors, don't assume this. - -TARGET_EXT?=c - -CH32FUN?=$(dir $(lastword $(MAKEFILE_LIST))) -MINICHLINK?=$(CH32FUN)/../minichlink - -WRITE_SECTION?=flash -SYSTEM_C?=$(CH32FUN)/ch32fun.c - -ifeq ($(DEBUG),1) - EXTRA_CFLAGS+=-DFUNCONF_DEBUG=1 -endif - -CFLAGS?=-g -Os -flto -ffunction-sections -fdata-sections -fmessage-length=0 -msmall-data-limit=8 -LDFLAGS+=-Wl,--print-memory-usage -Wl,-Map=$(TARGET).map - -ifeq ($(TARGET_MCU),CH32V003) - CFLAGS_ARCH+=-march=rv32ec -mabi=ilp32e -DCH32V003=1 - GENERATED_LD_FILE?=$(CH32FUN)/generated_ch32v003.ld - TARGET_MCU_LD:=0 - LINKER_SCRIPT?=$(GENERATED_LD_FILE) - LDFLAGS+=-L$(CH32FUN)/../misc -lgcc -else - MCU_PACKAGE?=1 - ifeq ($(findstring CH32V00,$(TARGET_MCU)),CH32V00) # CH32V002, 4, 5, 6, 7 - # Note: The CH32V003 is not a CH32V00x. - CFLAGS_ARCH+=-march=rv32eczmmul -mabi=ilp32e -DCH32V00x=1 - ifeq ($(findstring CH32V002, $(TARGET_MCU)), CH32V002) - TARGET_MCU_LD:=5 - else ifeq ($(findstring CH32V004, $(TARGET_MCU)), CH32V004) - TARGET_MCU_LD:=6 - else ifeq ($(findstring CH32V005, $(TARGET_MCU)), CH32V005) - TARGET_MCU_LD:=7 - else ifeq ($(findstring CH32V006, $(TARGET_MCU)), CH32V006) - TARGET_MCU_LD:=7 - else ifeq ($(findstring CH32V007, $(TARGET_MCU)), CH32V007) - TARGET_MCU_LD:=7 - else - ERROR:=$(error Unknown MCU $(TARGET_MCU)) - endif - else ifeq ($(findstring CH32V10,$(TARGET_MCU)),CH32V10) # CH32V103 - TARGET_MCU_PACKAGE?=CH32V103R8T6 - CFLAGS_ARCH+= -march=rv32imac \ - -mabi=ilp32 \ - -DCH32V10x=1 - - # MCU Flash/RAM split - ifeq ($(findstring R8, $(TARGET_MCU_PACKAGE)), R8) - MCU_PACKAGE:=1 - else ifeq ($(findstring C8, $(TARGET_MCU_PACKAGE)), C8) - MCU_PACKAGE:=1 - else ifeq ($(findstring C6, $(TARGET_MCU_PACKAGE)), C6) - MCU_PACKAGE:=2 - endif - - TARGET_MCU_LD:=1 - else ifeq ($(findstring CH32X03,$(TARGET_MCU)),CH32X03) # CH32X033, X035 - TARGET_MCU_PACKAGE?=CH32X035F8U6 - CFLAGS_ARCH+=-march=rv32imac \ - -mabi=ilp32 \ - -DCH32X03x=1 - - # MCU Flash/RAM split - ifeq ($(findstring F8, $(TARGET_MCU_PACKAGE)), F8) - MCU_PACKAGE:=1 - else ifeq ($(findstring R8, $(TARGET_MCU_PACKAGE)), R8) - MCU_PACKAGE:=1 - else ifeq ($(findstring K8, $(TARGET_MCU_PACKAGE)), K8) - MCU_PACKAGE:=1 - else ifeq ($(findstring C8, $(TARGET_MCU_PACKAGE)), C8) - MCU_PACKAGE:=1 - else ifeq ($(findstring G8, $(TARGET_MCU_PACKAGE)), G8) - MCU_PACKAGE:=1 - else ifeq ($(findstring G6, $(TARGET_MCU_PACKAGE)), G6) - MCU_PACKAGE:=1 - else ifeq ($(findstring F7, $(TARGET_MCU_PACKAGE)), F7) - MCU_PACKAGE:=1 - endif - - TARGET_MCU_LD:=4 - else ifeq ($(findstring CH32V20,$(TARGET_MCU)),CH32V20) # CH32V203 - TARGET_MCU_PACKAGE?=CH32V203F6P6 - CFLAGS_ARCH+= -march=rv32imac \ - -mabi=ilp32 \ - -DCH32V20x=1 - - # MCU Flash/RAM split - - - # Package - ifeq ($(findstring 203RB, $(TARGET_MCU_PACKAGE)), 203RB) - CFLAGS+=-DCH32V20x_D8 - else ifeq ($(findstring 208, $(TARGET_MCU_PACKAGE)), 208) - CFLAGS+=-DCH32V20x_D8W - MCU_PACKAGE:=3 - else ifeq ($(findstring F8, $(TARGET_MCU_PACKAGE)), F8) - MCU_PACKAGE:=1 - else ifeq ($(findstring G8, $(TARGET_MCU_PACKAGE)), G8) - MCU_PACKAGE:=1 - else ifeq ($(findstring K8, $(TARGET_MCU_PACKAGE)), K8) - MCU_PACKAGE:=1 - else ifeq ($(findstring C8, $(TARGET_MCU_PACKAGE)), C8) - MCU_PACKAGE:=1 - else ifeq ($(findstring F6, $(TARGET_MCU_PACKAGE)), F6) - MCU_PACKAGE:=2 - else ifeq ($(findstring G6, $(TARGET_MCU_PACKAGE)), G6) - MCU_PACKAGE:=2 - else ifeq ($(findstring K6, $(TARGET_MCU_PACKAGE)), K6) - MCU_PACKAGE:=2 - else ifeq ($(findstring C6, $(TARGET_MCU_PACKAGE)), C6) - MCU_PACKAGE:=2 - else ifeq ($(findstring RB, $(TARGET_MCU_PACKAGE)), RB) - MCU_PACKAGE:=3 - else ifeq ($(findstring GB, $(TARGET_MCU_PACKAGE)), GB) - MCU_PACKAGE:=3 - else ifeq ($(findstring CB, $(TARGET_MCU_PACKAGE)), CB) - MCU_PACKAGE:=3 - else ifeq ($(findstring WB, $(TARGET_MCU_PACKAGE)), WB) - MCU_PACKAGE:=3 - else - CFLAGS+=-DCH32V20x_D6 - endif - - TARGET_MCU_LD:=2 - else ifeq ($(findstring CH32V30,$(TARGET_MCU)),CH32V30) #CH32V307 - TARGET_MCU_PACKAGE?=CH32V307VCT6 - MCU_PACKAGE?=1 - TARGET_MCU_MEMORY_SPLIT?=3 - ENABLE_FPU?=1 - - ifeq ($(ENABLE_FPU), 1) - CFLAGS_ARCH+= -march=rv32imafc -mabi=ilp32f - else - CFLAGS_ARCH+= -march=rv32imac -mabi=ilp32 -DDISABLED_FLOAT - endif - - CFLAGS_ARCH+= \ - -DCH32V30x=1 \ - -DTARGET_MCU_MEMORY_SPLIT=$(TARGET_MCU_MEMORY_SPLIT) - - # MCU Flash/RAM split - ifeq ($(findstring RC, $(TARGET_MCU_PACKAGE)), RC) - MCU_PACKAGE:=1 - else ifeq ($(findstring VC, $(TARGET_MCU_PACKAGE)), VC) - MCU_PACKAGE:=1 - else ifeq ($(findstring WC, $(TARGET_MCU_PACKAGE)), WC) - MCU_PACKAGE:=1 - else ifeq ($(findstring CB, $(TARGET_MCU_PACKAGE)), CB) - MCU_PACKAGE:=2 - else ifeq ($(findstring FB, $(TARGET_MCU_PACKAGE)), FB) - MCU_PACKAGE:=2 - else ifeq ($(findstring RB, $(TARGET_MCU_PACKAGE)), RB) - MCU_PACKAGE:=2 - endif - - # Package - ifeq ($(findstring 303, $(TARGET_MCU_PACKAGE)), 303) - CFLAGS+=-DCH32V30x_D8 - else - CFLAGS+=-DCH32V30x_D8C - endif - - TARGET_MCU_LD:=3 - else - ERROR:=$(error Unknown MCU $(TARGET_MCU)) - endif - - LDFLAGS+=-lgcc - GENERATED_LD_FILE:=$(CH32FUN)/generated_$(TARGET_MCU_PACKAGE)_$(TARGET_MCU_MEMORY_SPLIT).ld - LINKER_SCRIPT:=$(GENERATED_LD_FILE) -endif - -CFLAGS+= \ - $(CFLAGS_ARCH) -static-libgcc \ - -I$(NEWLIB) \ - -I$(CH32FUN)/../extralibs \ - -I$(CH32FUN) \ - -nostdlib \ - -I. -Wall $(EXTRA_CFLAGS) - -LDFLAGS+=-T $(LINKER_SCRIPT) -Wl,--gc-sections -FILES_TO_COMPILE:=$(SYSTEM_C) $(TARGET).$(TARGET_EXT) $(ADDITIONAL_C_FILES) - -$(TARGET).bin : $(TARGET).elf - $(PREFIX)-objdump -S $^ > $(TARGET).lst - $(PREFIX)-objcopy -O binary $< $(TARGET).bin - $(PREFIX)-objcopy -O ihex $< $(TARGET).hex - -ifeq ($(OS),Windows_NT) -closechlink : - -taskkill /F /IM minichlink.exe /T -else -closechlink : - -killall minichlink -endif - -terminal : monitor - -monitor : - $(MINICHLINK)/minichlink -T - -unbrick : - $(MINICHLINK)/minichlink -u - -gdbserver : - -$(MINICHLINK)/minichlink -baG - -gdbclient : - gdb-multiarch $(TARGET).elf -ex "target remote :3333" - -clangd : - make clean - bear -- make build - -clangd_clean : - rm -f compile_commands.json - rm -rf .cache - -FLASH_COMMAND?=$(MINICHLINK)/minichlink -w $< $(WRITE_SECTION) -b - -.PHONY : $(GENERATED_LD_FILE) -$(GENERATED_LD_FILE) : - $(PREFIX)-gcc -E -P -x c -DTARGET_MCU=$(TARGET_MCU) -DMCU_PACKAGE=$(MCU_PACKAGE) -DTARGET_MCU_LD=$(TARGET_MCU_LD) -DTARGET_MCU_MEMORY_SPLIT=$(TARGET_MCU_MEMORY_SPLIT) $(CH32FUN)/ch32fun.ld > $(GENERATED_LD_FILE) - -$(TARGET).elf : $(FILES_TO_COMPILE) $(LINKER_SCRIPT) $(EXTRA_ELF_DEPENDENCIES) - $(PREFIX)-gcc -o $@ $(FILES_TO_COMPILE) $(CFLAGS) $(LDFLAGS) - -# Rule for independently building ch32fun.o indirectly, instead of recompiling it from source every time. -# Not used in the default 003fun toolchain, but used in more sophisticated toolchains. -ch32fun.o : $(SYSTEM_C) - $(PREFIX)-gcc -c -o $@ $(SYSTEM_C) $(CFLAGS) - -cv_flash : $(TARGET).bin - make -C $(MINICHLINK) all - $(FLASH_COMMAND) - -cv_clean : - rm -rf $(TARGET).elf $(TARGET).bin $(TARGET).hex $(TARGET).lst $(TARGET).map $(TARGET).hex $(GENERATED_LD_FILE) || true - -build : $(TARGET).bin diff --git a/src/ch32fun/ch32v003fun-bootloader.ld b/src/ch32fun/ch32v003fun-bootloader.ld deleted file mode 100644 index 39d6580..0000000 --- a/src/ch32fun/ch32v003fun-bootloader.ld +++ /dev/null @@ -1,148 +0,0 @@ -ENTRY( InterruptVector ) - -MEMORY -{ - /* Actually at 0x1FFFF000 but the system maps it to 0x00000000 */ - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 1920 - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 2K -} - -SECTIONS -{ - .init : - { - _sinit = .; - . = ALIGN(4); - KEEP(*(SORT_NONE(.init))) - . = ALIGN(4); - _einit = .; - } >FLASH AT>FLASH - - .text : - { - . = ALIGN(4); - *(.text) - *(.text.*) - *(.rodata) - *(.rodata*) - *(.gnu.linkonce.t.*) - . = ALIGN(4); - } >FLASH AT>FLASH - - .fini : - { - KEEP(*(SORT_NONE(.fini))) - . = ALIGN(4); - } >FLASH AT>FLASH - - PROVIDE( _etext = . ); - PROVIDE( _eitcm = . ); - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >FLASH AT>FLASH - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >FLASH AT>FLASH - - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__fini_array_end = .); - } >FLASH AT>FLASH - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >FLASH AT>FLASH - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >FLASH AT>FLASH - - .dalign : - { - . = ALIGN(4); - PROVIDE(_data_vma = .); - } >RAM AT>FLASH - - .dlalign : - { - . = ALIGN(4); - PROVIDE(_data_lma = .); - } >FLASH AT>FLASH - - .data : - { - . = ALIGN(4); - *(.gnu.linkonce.r.*) - *(.data .data.*) - *(.gnu.linkonce.d.*) - . = ALIGN(8); - PROVIDE( __global_pointer$ = . + 0x800 ); - *(.sdata .sdata.*) - *(.sdata2*) - *(.gnu.linkonce.s.*) - . = ALIGN(8); - *(.srodata.cst16) - *(.srodata.cst8) - *(.srodata.cst4) - *(.srodata.cst2) - *(.srodata .srodata.*) - . = ALIGN(4); - PROVIDE( _edata = .); - } >RAM AT>FLASH - - .bss : - { - . = ALIGN(4); - PROVIDE( _sbss = .); - *(.sbss*) - *(.gnu.linkonce.sb.*) - *(.bss*) - *(.gnu.linkonce.b.*) - *(COMMON*) - . = ALIGN(4); - PROVIDE( _ebss = .); - } >RAM AT>FLASH - - PROVIDE( _end = _ebss); - PROVIDE( end = . ); - - PROVIDE( _eusrstack = ORIGIN(RAM) + LENGTH(RAM)); -} - - - diff --git a/src/ch32fun/ch32x03xhw.h b/src/ch32fun/ch32x03xhw.h deleted file mode 100644 index 317a747..0000000 --- a/src/ch32fun/ch32x03xhw.h +++ /dev/null @@ -1,6109 +0,0 @@ -#ifndef TODO_HARDWARE_H -#define TODO_HARDWARE_H - -#include "ch32fun.h" - -#ifndef __ASSEMBLER__ // Things before this can be used in assembly. - -#ifdef __cplusplus -extern "C" -{ -#endif - - /* Interrupt Number Definition, according to the selected device */ - typedef enum IRQn - { - /****** RISC-V Processor Exceptions Numbers *******************************************************/ - NonMaskableInt_IRQn = 2, /* 2 Non Maskable Interrupt */ - EXC_IRQn = 3, /* 3 Exception Interrupt */ - Ecall_M_Mode_IRQn = 5, /* 5 Ecall M Mode Interrupt */ - Ecall_U_Mode_IRQn = 8, /* 8 Ecall U Mode Interrupt */ - Break_Point_IRQn = 9, /* 9 Break Point Interrupt */ - SysTicK_IRQn = 12, /* 12 System timer Interrupt */ - Software_IRQn = 14, /* 14 software Interrupt */ - - /****** RISC-V specific Interrupt Numbers *********************************************************/ - WWDG_IRQn = 16, /* Window WatchDog Interrupt */ - PVD_IRQn = 17, /* PVD through EXTI Line detection Interrupt */ - FLASH_IRQn = 18, /* FLASH global Interrupt */ - RCC_IRQn = 19, /* RCC global Interrupt */ - EXTI7_0_IRQn = 20, /* External Line[7:0] Interrupts */ - AWU_IRQn = 21, /* AWU global Interrupt */ - DMA1_Channel1_IRQn = 22, /* DMA1 Channel 1 global Interrupt */ - DMA1_Channel2_IRQn = 23, /* DMA1 Channel 2 global Interrupt */ - DMA1_Channel3_IRQn = 24, /* DMA1 Channel 3 global Interrupt */ - DMA1_Channel4_IRQn = 25, /* DMA1 Channel 4 global Interrupt */ - DMA1_Channel5_IRQn = 26, /* DMA1 Channel 5 global Interrupt */ - DMA1_Channel6_IRQn = 27, /* DMA1 Channel 6 global Interrupt */ - DMA1_Channel7_IRQn = 28, /* DMA1 Channel 7 global Interrupt */ - ADC_IRQn = 29, /* ADC global Interrupt */ - I2C1_EV_IRQn = 30, /* I2C1 Event Interrupt */ - I2C1_ER_IRQn = 31, /* I2C1 Error Interrupt */ - USART1_IRQn = 32, /* USART1 global Interrupt */ - SPI1_IRQn = 33, /* SPI1 global Interrupt */ - TIM1_BRK_IRQn = 34, /* TIM1 Break Interrupt */ - TIM1_UP_IRQn = 35, /* TIM1 Update Interrupt */ - TIM1_TRG_COM_IRQn = 36, /* TIM1 Trigger and Commutation Interrupt */ - TIM1_CC_IRQn = 37, /* TIM1 Capture Compare Interrupt */ - TIM2_IRQn = 38, /* TIM2 global Interrupt */ - USART2_IRQn = 39, /* UART2 Interrupt */ - EXTI15_8_IRQn = 40, /* External Line[8:15] Interrupt */ - EXTI25_16_IRQn = 41, /* External Line[25:16] Interrupt */ - USART3_IRQn = 42, /* UART2 Interrupt */ - USART4_IRQn = 43, /* UART2 Interrupt */ - DMA1_Channel8_IRQn = 44, /* DMA1 Channel 8 global Interrupt */ - USBFS_IRQn = 45, /* USB Full-Speed Interrupt */ - USBFS_WakeUp_IRQn = 46, /* USB Full-Speed Wake-Up Interrupt */ - PIOC_IRQn = 47, /* Programmable IO Controller Interrupt */ - OPA_IRQn = 48, /* Op Amp Interrupt */ - USBPD_IRQn = 49, /* USB Power Delivery Interrupt */ - USBPD_WKUP_IRQn = 50, /* USB Power Delivery Wake-Up Interrupt */ - TIM2_CC_IRQn = 51, /* Timer 2 Compare Global Interrupt */ - TIM2_TRG_IRQn = 52, /* Timer 2 Trigger Global Interrupt */ - TIM2_BRK_IRQn = 53, /* Timer 2 Brk Global Interrupt */ - TIM3_IRQn = 54, /* Timer 3 Global Interrupt */ - } IRQn_Type; - -#define DEFAULT_INTERRUPT_VECTOR_CONTENTS "\n\ - .align 2\n\ - .option push;\n\ - .option norvc;\n\ - j handle_reset\n\ - .word 0\n\ - .word NMI_Handler /* NMI Handler */ \n\ - .word HardFault_Handler /* Hard Fault Handler */ \n\ - .word 0\n\ - .word Ecall_M_Mode_Handler /* Ecall M Mode */ \n\ - .word 0 \n\ - .word 0 \n\ - .word Ecall_U_Mode_Handler /* Ecall U Mode */ \n\ - .word Break_Point_Handler /* Break Point */ \n\ - .word 0\n\ - .word 0\n\ - .word SysTick_Handler /* SysTick Handler */ \n\ - .word 0\n\ - .word SW_Handler /* SW Handler */ \n\ - .word 0\n\ - /* External Interrupts */ \n\ - .word WWDG_IRQHandler /* Window Watchdog */ \n\ - .word PVD_IRQHandler /* PVD through EXTI Line detect */ \n\ - .word FLASH_IRQHandler /* Flash */ \n\ - .word RCC_IRQHandler /* RCC */ \n\ - .word EXTI7_0_IRQHandler /* EXTI Line 7..0 */ \n\ - .word AWU_IRQHandler /* AWU */ \n\ - .word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */ \n\ - .word DMA1_Channel2_IRQHandler /* DMA1 Channel 2 */ \n\ - .word DMA1_Channel3_IRQHandler /* DMA1 Channel 3 */ \n\ - .word DMA1_Channel4_IRQHandler /* DMA1 Channel 4 */ \n\ - .word DMA1_Channel5_IRQHandler /* DMA1 Channel 5 */ \n\ - .word DMA1_Channel6_IRQHandler /* DMA1 Channel 6 */ \n\ - .word DMA1_Channel7_IRQHandler /* DMA1 Channel 7 */ \n\ - .word ADC1_IRQHandler /* ADC1 */ \n\ - .word I2C1_EV_IRQHandler /* I2C1 Event */ \n\ - .word I2C1_ER_IRQHandler /* I2C1 Error */ \n\ - .word USART1_IRQHandler /* USART1 */ \n\ - .word SPI1_IRQHandler /* SPI1 */ \n\ - .word TIM1_BRK_IRQHandler /* TIM1 Break */ \n\ - .word TIM1_UP_IRQHandler /* TIM1 Update */ \n\ - .word TIM1_TRG_COM_IRQHandler /* TIM1 Trigger and Commutation */ \n\ - .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ \n\ - .word TIM2_IRQHandler /* TIM2 */ \n\ - .word USART2_IRQHandler /* UART2 Interrupt */ \n\ - .word EXTI15_8_IRQHandler /* External Line[8:15] Interrupt */ \n\ - .word EXTI25_16_IRQHandler /* External Line[25:16] Interrupt */ \n\ - .word USART3_IRQHandler /* UART2 Interrupt */ \n\ - .word USART4_IRQHandler /* UART2 Interrupt */ \n\ - .word DMA1_Channel8_IRQHandler /* DMA1 Channel 8 global Interrupt */ \n\ - .word USBFS_IRQHandler /* USB Full-Speed Interrupt */ \n\ - .word USBFS_WakeUp_IRQHandler /* USB Full-Speed Wake-Up Interrupt */ \n\ - .word PIOC_IRQHandler /* Programmable IO Controller Interrupt */ \n\ - .word OPA_IRQHandler /* Op Amp Interrupt */ \n\ - .word USBPD_IRQHandler /* USB Power Delivery Interrupt */ \n\ - .word USBPD_WKUP_IRQHandler /* USB Power Delivery Wake-Up Interrupt */ \n\ - .word TIM2_CC_IRQHandler /* Timer 2 Compare Global Interrupt */ \n\ - .word TIM2_TRG_IRQHandler /* Timer 2 Trigger Global Interrupt */ \n\ - .word TIM2_BRK_IRQHandler /* Timer 2 Brk Global Interrupt */ \n\ - .word TIM3_IRQHandler /* Timer 3 Global Interrupt */ \n\ - .option pop;\n" - - /* memory mapped structure for SysTick */ - typedef struct - { - __IO uint32_t CTLR; - __IO uint32_t SR; - __IO uint32_t CNTL; - __IO uint32_t CNTH; - __IO uint32_t CMPL; - __IO uint32_t CMPH; - } SysTick_Type; - -#endif /* __ASSEMBLER__*/ - -#define HardFault_IRQn EXC_IRQn - -#define ADC1_2_IRQn ADC_IRQn - -/* Standard Peripheral Library old definitions (maintained for legacy purpose) */ -#define HSI_Value HSI_VALUE -#define HSE_Value HSE_VALUE -#define HSEStartUp_TimeOut HSE_STARTUP_TIMEOUT - -#ifndef __ASSEMBLER__ - /* Analog to Digital Converter */ - typedef struct - { - __IO uint32_t STATR; - __IO uint32_t CTLR1; - __IO uint32_t CTLR2; - __IO uint32_t SAMPTR1; - __IO uint32_t SAMPTR2; - __IO uint32_t IOFR1; - __IO uint32_t IOFR2; - __IO uint32_t IOFR3; - __IO uint32_t IOFR4; - __IO uint32_t WDHTR; - __IO uint32_t WDLTR; - __IO uint32_t RSQR1; - __IO uint32_t RSQR2; - __IO uint32_t RSQR3; - __IO uint32_t ISQR; - __IO uint32_t IDATAR1; - __IO uint32_t IDATAR2; - __IO uint32_t IDATAR3; - __IO uint32_t IDATAR4; - __IO uint32_t RDATAR; - __IO uint32_t CTLR3; - __IO uint32_t WDTR1; - __IO uint32_t WDTR2; - __IO uint32_t WDTR3; - } ADC_TypeDef; - - /* CRC Calculation Unit */ - typedef struct - { - __IO uint32_t DATAR; - __IO uint8_t IDATAR; - uint8_t RESERVED0; - uint16_t RESERVED1; - __IO uint32_t CTLR; - } CRC_TypeDef; - - /* Debug MCU */ - typedef struct - { - __IO uint32_t CFGR0; - __IO uint32_t CFGR1; - } DBGMCU_TypeDef; - - /* DMA Controller */ - typedef struct - { - __IO uint32_t CFGR; - __IO uint32_t CNTR; - __IO uint32_t PADDR; - __IO uint32_t MADDR; - } DMA_Channel_TypeDef; - - typedef struct - { - __IO uint32_t INTFR; - __IO uint32_t INTFCR; - } DMA_TypeDef; - - /* External Interrupt/Event Controller */ - typedef struct - { - __IO uint32_t INTENR; - __IO uint32_t EVENR; - __IO uint32_t RTENR; - __IO uint32_t FTENR; - __IO uint32_t SWIEVR; - __IO uint32_t INTFR; - } EXTI_TypeDef; - - /* FLASH Registers */ - typedef struct - { - __IO uint32_t ACTLR; - __IO uint32_t KEYR; - __IO uint32_t OBKEYR; - __IO uint32_t STATR; - __IO uint32_t CTLR; - __IO uint32_t ADDR; - __IO uint32_t RESERVED; - __IO uint32_t OBR; - __IO uint32_t WPR; - __IO uint32_t MODEKEYR; - __IO uint32_t BOOT_MODEKEYR; - } FLASH_TypeDef; - - /* Option Bytes Registers */ - typedef struct - { - __IO uint16_t RDPR; - __IO uint16_t USER; - __IO uint16_t Data0; - __IO uint16_t Data1; - __IO uint16_t WRPR0; - __IO uint16_t WRPR1; - __IO uint16_t WRPR2; - __IO uint16_t WRPR3; - } OB_TypeDef; - - typedef struct - { - __IO uint16_t CAP; - __IO uint16_t RES1; - __IO uint32_t RES2; - __IO uint32_t UID0; - __IO uint32_t UID1; - __IO uint32_t UID2; - __IO uint32_t RES3; - } ESG_TypeDef; - - typedef struct - { - union - { - __I uint32_t CHIPID; - struct - { - __I uint16_t REVID; - __I uint16_t DEVID; - }; - }; - } INFO_TypeDef; - - /* General Purpose I/O */ - typedef enum - { - GPIO_CFGLR_IN_ANALOG = 0, - GPIO_CFGLR_IN_FLOAT = 4, - GPIO_CFGLR_IN_PUPD = 8, - GPIO_CFGLR_OUT_10Mhz_PP = 1, - GPIO_CFGLR_OUT_2Mhz_PP = 2, - GPIO_CFGLR_OUT_50Mhz_PP = 3, - GPIO_CFGLR_OUT_10Mhz_OD = 5, - GPIO_CFGLR_OUT_2Mhz_OD = 6, - GPIO_CFGLR_OUT_50Mhz_OD = 7, - GPIO_CFGLR_OUT_10Mhz_AF_PP = 9, - GPIO_CFGLR_OUT_2Mhz_AF_PP = 10, - GPIO_CFGLR_OUT_50Mhz_AF_PP = 11, - GPIO_CFGLR_OUT_10Mhz_AF_OD = 13, - GPIO_CFGLR_OUT_2Mhz_AF_OD = 14, - GPIO_CFGLR_OUT_50Mhz_AF_OD = 15, - } GPIO_CFGLR_PIN_MODE_Typedef; - - typedef union - { - uint32_t __FULL; - struct - { - GPIO_CFGLR_PIN_MODE_Typedef PIN0 : 4; - GPIO_CFGLR_PIN_MODE_Typedef PIN1 : 4; - GPIO_CFGLR_PIN_MODE_Typedef PIN2 : 4; - GPIO_CFGLR_PIN_MODE_Typedef PIN3 : 4; - GPIO_CFGLR_PIN_MODE_Typedef PIN4 : 4; - GPIO_CFGLR_PIN_MODE_Typedef PIN5 : 4; - GPIO_CFGLR_PIN_MODE_Typedef PIN6 : 4; - GPIO_CFGLR_PIN_MODE_Typedef PIN7 : 4; - }; - } GPIO_CFGLR_t; - typedef union - { - uint32_t __FULL; - const struct - { - uint32_t IDR0 : 1; - uint32_t IDR1 : 1; - uint32_t IDR2 : 1; - uint32_t IDR3 : 1; - uint32_t IDR4 : 1; - uint32_t IDR5 : 1; - uint32_t IDR6 : 1; - uint32_t IDR7 : 1; - uint32_t : 24; - }; - } GPIO_INDR_t; - typedef union - { - uint32_t __FULL; - struct - { - uint32_t ODR0 : 1; - uint32_t ODR1 : 1; - uint32_t ODR2 : 1; - uint32_t ODR3 : 1; - uint32_t ODR4 : 1; - uint32_t ODR5 : 1; - uint32_t ODR6 : 1; - uint32_t ODR7 : 1; - uint32_t : 24; - }; - } GPIO_OUTDR_t; - typedef union - { - uint32_t __FULL; - struct - { - uint32_t BS0 : 1; - uint32_t BS1 : 1; - uint32_t BS2 : 1; - uint32_t BS3 : 1; - uint32_t BS4 : 1; - uint32_t BS5 : 1; - uint32_t BS6 : 1; - uint32_t BS7 : 1; - uint32_t : 8; - uint32_t BR0 : 1; - uint32_t BR1 : 1; - uint32_t BR2 : 1; - uint32_t BR3 : 1; - uint32_t BR4 : 1; - uint32_t BR5 : 1; - uint32_t BR6 : 1; - uint32_t BR7 : 1; - uint32_t : 8; - }; - } GPIO_BSHR_t; - typedef union - { - uint32_t __FULL; - struct - { - uint32_t BR0 : 1; - uint32_t BR1 : 1; - uint32_t BR2 : 1; - uint32_t BR3 : 1; - uint32_t BR4 : 1; - uint32_t BR5 : 1; - uint32_t BR6 : 1; - uint32_t BR7 : 1; - uint32_t : 24; - }; - } GPIO_BCR_t; - typedef union - { - uint32_t __FULL; - struct - { - uint32_t LCK0 : 1; - uint32_t LCK1 : 1; - uint32_t LCK2 : 1; - uint32_t LCK3 : 1; - uint32_t LCK4 : 1; - uint32_t LCK5 : 1; - uint32_t LCK6 : 1; - uint32_t LCK7 : 1; - uint32_t LCKK : 1; - uint32_t : 23; - }; - } GPIO_LCKR_t; - typedef struct - { - __IO uint32_t CFGLR; - __IO uint32_t CFGHR; - __I uint32_t INDR; - __IO uint32_t OUTDR; - __IO uint32_t BSHR; - __IO uint32_t BCR; - __IO uint32_t LCKR; - __IO uint32_t CFGXR; - __IO uint32_t BSXR; - } GPIO_TypeDef; - -#define DYN_GPIO_READ(gpio, field) ((GPIO_##field##_t){.__FULL = gpio->field}) -#define DYN_GPIO_WRITE(gpio, field, ...) gpio->field = ((const GPIO_##field##_t)__VA_ARGS__).__FULL -#define DYN_GPIO_MOD(gpio, field, reg, val) \ - { \ - GPIO_##field##_t tmp; \ - tmp.__FULL = gpio->field; \ - tmp.reg = val; \ - gpio->field = tmp.__FULL; \ - } - - /* Alternate Function I/O */ - typedef struct - { - uint32_t RESERVED0; - __IO uint32_t PCFR1; - __IO uint32_t EXTICR1; - __IO uint32_t EXTICR2; - uint32_t RESERVED1; - uint32_t RESERVED2; - __IO uint32_t CTLR; - } AFIO_TypeDef; - - /* Inter Integrated Circuit Interface */ - typedef struct - { - __IO uint16_t CTLR1; - uint16_t RESERVED0; - __IO uint16_t CTLR2; - uint16_t RESERVED1; - __IO uint16_t OADDR1; - uint16_t RESERVED2; - __IO uint16_t OADDR2; - uint16_t RESERVED3; - __IO uint16_t DATAR; - uint16_t RESERVED4; - __IO uint16_t STAR1; - uint16_t RESERVED5; - __IO uint16_t STAR2; - uint16_t RESERVED6; - __IO uint16_t CKCFGR; - uint16_t RESERVED7; - } I2C_TypeDef; - - /* Independent WatchDog */ - typedef struct - { - __IO uint32_t CTLR; - __IO uint32_t PSCR; - __IO uint32_t RLDR; - __IO uint32_t STATR; - } IWDG_TypeDef; - - /* Power Control */ - typedef struct - { - __IO uint32_t CTLR; - __IO uint32_t CSR; - } PWR_TypeDef; - - /* Reset and Clock Control */ - typedef struct - { - __IO uint32_t CTLR; - __IO uint32_t CFGR0; - __IO uint32_t INTR; - __IO uint32_t APB2PRSTR; - __IO uint32_t APB1PRSTR; - __IO uint32_t AHBPCENR; - __IO uint32_t APB2PCENR; - __IO uint32_t APB1PCENR; - __IO uint32_t RESERVED1; - __IO uint32_t RSTSCKR; - __IO uint32_t AHBRSTR; - } RCC_TypeDef; - - /* Serial Peripheral Interface */ - typedef struct - { - __IO uint16_t CTLR1; - uint16_t RESERVED0; - __IO uint16_t CTLR2; - uint16_t RESERVED1; - __IO uint16_t STATR; - uint16_t RESERVED2; - __IO uint16_t DATAR; - uint16_t RESERVED3; - __IO uint16_t CRCR; - uint16_t RESERVED4; - __IO uint16_t RCRCR; - uint16_t RESERVED5; - __IO uint16_t TCRCR; - uint16_t RESERVED6; - uint32_t RESERVED7; - uint32_t RESERVED8; - __IO uint16_t HSCR; - uint16_t RESERVED9; - } SPI_TypeDef; - - /* TIM */ - typedef struct - { - __IO uint16_t CTLR1; - uint16_t RESERVED0; - __IO uint16_t CTLR2; - uint16_t RESERVED1; - __IO uint16_t SMCFGR; - uint16_t RESERVED2; - __IO uint16_t DMAINTENR; - uint16_t RESERVED3; - __IO uint16_t INTFR; - uint16_t RESERVED4; - __IO uint16_t SWEVGR; - uint16_t RESERVED5; - __IO uint16_t CHCTLR1; - uint16_t RESERVED6; - __IO uint16_t CHCTLR2; - uint16_t RESERVED7; - __IO uint16_t CCER; - uint16_t RESERVED8; - __IO uint16_t CNT; - uint16_t RESERVED9; - __IO uint16_t PSC; - uint16_t RESERVED10; - __IO uint16_t ATRLR; - uint16_t RESERVED11; - __IO uint16_t RPTCR; - uint16_t RESERVED12; - __IO uint32_t CH1CVR; - __IO uint32_t CH2CVR; - __IO uint32_t CH3CVR; - __IO uint32_t CH4CVR; - __IO uint16_t BDTR; - uint16_t RESERVED13; - __IO uint16_t DMACFGR; - uint16_t RESERVED14; - __IO uint16_t DMAADR; - uint16_t RESERVED15; - __IO uint16_t SPEC; - uint16_t RESERVED16; - } TIM_TypeDef; - - /* Universal Synchronous Asynchronous Receiver Transmitter */ - typedef struct - { - __IO uint16_t STATR; - uint16_t RESERVED0; - __IO uint16_t DATAR; - uint16_t RESERVED1; - __IO uint16_t BRR; - uint16_t RESERVED2; - __IO uint16_t CTLR1; - uint16_t RESERVED3; - __IO uint16_t CTLR2; - uint16_t RESERVED4; - __IO uint16_t CTLR3; - uint16_t RESERVED5; - __IO uint16_t GPR; - uint16_t RESERVED6; - } USART_TypeDef; - - /* Window WatchDog */ - typedef struct - { - __IO uint32_t CTLR; - __IO uint32_t CFGR; - __IO uint32_t STATR; - } WWDG_TypeDef; - - /* Enhanced Registers */ - typedef struct - { - __IO uint32_t EXTEN_CTR; - } EXTEN_TypeDef; - - /* The reference manual for the ch32v2xx/v3xx reference this as "CTR" field in the "EXTEND" register so adding an alias here. */ - typedef struct - { - __IO uint32_t CTR; - } EXTEND_TypeDef; - - /* Touch Sensor, Mirrors Analog to Digital Converter */ - typedef struct - { - __IO uint32_t RESERVED0[3]; - __IO uint32_t CHARGE1; - __IO uint32_t CHARGE2; - __IO uint32_t RESERVED1[10]; - __IO uint32_t CHGOFFSET; - __IO uint32_t RESERVED2[3]; - __IO uint32_t DR_ACT_DCG; - } TKEY_TypeDef; - - /* Op amp / comparator */ - typedef struct - { - __IO uint16_t CFGR1; - __IO uint16_t CFGR2; - __IO uint32_t CTLR1; - __IO uint32_t CTLR2; - __IO uint32_t OPA_KEY; - __IO uint32_t CMP_KEY; - __IO uint32_t POLL_KEY; - } OPACMP_TypeDef; - - /* USB Full Speed Device Mode */ - typedef struct - { - __IO uint8_t BASE_CTRL; // XXX (spelling) - __IO uint8_t UDEV_CTRL; // or host ctlr - __IO uint8_t INT_EN; - __IO uint8_t DEV_ADDR; - __IO uint8_t RESERVED0; - __IO uint8_t MIS_ST; - __IO uint8_t INT_FG; - __IO uint8_t INT_ST; - __IO uint16_t RX_LEN; - __IO uint16_t RESERVED1; - __IO uint8_t UEP4_1_MOD; - __IO uint8_t UEP2_3_MOD; // Also HOST_EP_MOD - __IO uint8_t UEP567_MOD; - __IO uint8_t RESERVED2; - - __IO uint32_t UEP0_DMA; - __IO uint32_t UEP1_DMA; - __IO uint32_t UEP2_DMA; // Also HOST_RX_DMA - __IO uint32_t UEP3_DMA; // Also HOST_TX_DMA - - //__IO uint32_t UEP0_CTRL; - __IO uint16_t UEP0_TX_LEN; - __IO uint16_t UEP0_CTRL_H; - - //__IO uint32_t UEP1_CTRL; - __IO uint16_t UEP1_TX_LEN; - __IO uint16_t UEP1_CTRL_H; // Also HOST_SETUP - - //__IO uint32_t UEP2_CTRL; - __IO uint16_t UEP2_TX_LEN; // Also HOST_PID - __IO uint16_t UEP2_CTRL_H; // Also HOST_RX_CTL - - //__IO uint32_t UEP3_CTRL; - __IO uint16_t UEP3_TX_LEN; // Also HOST_TX_LEN - __IO uint16_t UEP3_CTRL_H; // Also HOST_TX_CTL - - //__IO uint32_t UEP4_CTRL; - __IO uint16_t UEP4_TX_LEN; - __IO uint16_t UEP4_CTRL_H; - - __IO uint32_t RESERVED3[8]; - - __IO uint32_t UEP5_DMA; - __IO uint32_t UEP6_DMA; - __IO uint32_t UEP7_DMA; - - __IO uint32_t RESERVED4; - - //__IO uint32_t UEP5_CTRL; - __IO uint16_t UEP5_TX_LEN; - __IO uint16_t UEP5_CTRL_H; - - //__IO uint32_t UEP6_CTRL; - __IO uint16_t UEP6_TX_LEN; - __IO uint16_t UEP6_CTRL_H; - - //__IO uint32_t UEP7_CTRL; - __IO uint16_t UEP7_TX_LEN; - __IO uint16_t UEP7_CTRL_H; - - __IO uint32_t UEPX_MOD; - } USBFS_TypeDef; - -#define USB_PHY_V33 (1 << 6) -#define USB_IOEN (1 << 7) - -#define USBFSD_UEP_MOD_BASE 0x4002340C -#define USBFSD_UEP_DMA_BASE 0x40023410 -#define USBFSD_UEP_LEN_BASE 0x40023420 -#define USBFSD_UEP_CTL_BASE 0x40023422 -#define USBFSD_UEP_RX_EN 0x08 -#define USBFSD_UEP_TX_EN 0x04 -#define USBFSD_UEP_BUF_MOD 0x01 -#define USBFSD_UEP_MOD(N) (*((volatile uint8_t *)(USBFSD_UEP_MOD_BASE + N))) -#define USBFSD_UEP_TX_CTRL(N) (*((volatile uint8_t *)(USBFSD_UEP_CTL_BASE + N * 0x04))) -#define USBFSD_UEP_RX_CTRL(N) (*((volatile uint8_t *)(USBFSD_UEP_CTL_BASE + N * 0x04))) -#define USBFSD_UEP_DMA(N) (*((volatile uint32_t *)(USBFSD_UEP_DMA_BASE + N * 0x04))) -#define USBFSD_UEP_BUF(N) ((uint8_t *)(*((volatile uint32_t *)(USBFSD_UEP_DMA_BASE + N * 0x04))) + 0x20000000) -#define USBFSD_UEP_TLEN(N) (*((volatile uint16_t *)(USBFSD_UEP_LEN_BASE + N * 0x04))) - -/* R8_UEPn_TX_CTRL */ -#define USBFS_UEP_T_AUTO_TOG (1 << 4) // enable automatic toggle after successful transfer completion on endpoint 1/2/3: 0=manual toggle, 1=automatic toggle -#define USBFS_UEP_T_TOG (1 << 6) // prepared data toggle flag of USB endpoint X transmittal (IN): 0=DATA0, 1=DATA1 -#define USBFS_UEP_T_RES_MASK (3 << 0) // bit mask of handshake response type for USB endpoint X transmittal (IN) -#define USBFS_UEP_T_RES_ACK (0 << 1) -#define USBFS_UEP_T_RES_NONE (1 << 0) -#define USBFS_UEP_T_RES_NAK (1 << 1) -#define USBFS_UEP_T_RES_STALL (3 << 0) -// bUEP_T_RES1 & bUEP_T_RES0: handshake response type for USB endpoint X transmittal (IN) -// 00: DATA0 or DATA1 then expecting ACK (ready) -// 01: DATA0 or DATA1 then expecting no response, time out from host, for non-zero endpoint isochronous transactions -// 10: NAK (busy) -// 11: STALL (error) -// host aux setup - -/* R8_UEPn_RX_CTRL, n=0-7 */ -#define USBFS_UEP_R_AUTO_TOG (1 << 4) // enable automatic toggle after successful transfer completion on endpoint 1/2/3: 0=manual toggle, 1=automatic toggle -#define USBFS_UEP_R_TOG (1 << 7) // expected data toggle flag of USB endpoint X receiving (OUT): 0=DATA0, 1=DATA1 -#define USBFS_UEP_R_RES_MASK (3 << 2) // bit mask of handshake response type for USB endpoint X receiving (OUT) -#define USBFS_UEP_R_RES_ACK (0 << 3) -#define USBFS_UEP_R_RES_NONE (1 << 2) -#define USBFS_UEP_R_RES_NAK (1 << 3) -#define USBFS_UEP_R_RES_STALL (3 << 2) - -#define EP1_T_EN (1 << 6) -#define EP2_T_EN (1 << 2) -#define EP3_T_EN (1 << 6) -#define EP4_T_EN (1 << 2) -#define EP1_R_EN (1 << 7) -#define EP2_R_EN (1 << 3) -#define EP3_R_EN (1 << 7) -#define EP4_R_EN (1 << 3) - -/* R8_USB_CTRL */ -#define USBFS_UC_HOST_MODE 0x80 -#define USBFS_UC_LOW_SPEED 0x40 -#define USBFS_UC_DEV_PU_EN 0x20 -#define USBFS_UC_SYS_CTRL_MASK 0x30 -#define USBFS_UC_SYS_CTRL0 0x00 -#define USBFS_UC_SYS_CTRL1 0x10 -#define USBFS_UC_SYS_CTRL2 0x20 -#define USBFS_UC_SYS_CTRL3 0x30 -#define USBFS_UC_INT_BUSY 0x08 -#define USBFS_UC_RESET_SIE 0x04 -#define USBFS_UC_CLR_ALL 0x02 -#define USBFS_UC_DMA_EN 0x01 - -/* R8_USB_INT_EN */ -#define USBFS_UIE_DEV_SOF 0x80 -#define USBFS_UIE_DEV_NAK 0x40 -#define USBFS_UIE_FIFO_OV 0x10 -#define USBFS_UIE_HST_SOF 0x08 -#define USBFS_UIE_SUSPEND 0x04 -#define USBFS_UIE_TRANSFER 0x02 -#define USBFS_UIE_DETECT 0x01 -#define USBFS_UIE_BUS_RST 0x01 - -/* R8_USB_DEV_AD */ -#define USBFS_UDA_GP_BIT 0x80 -#define USBFS_USB_ADDR_MASK 0x7F - -/* R8_USB_MIS_ST */ -#define USBFS_UMS_SOF_PRES 0x80 -#define USBFS_UMS_SOF_ACT 0x40 -#define USBFS_UMS_SIE_FREE 0x20 -#define USBFS_UMS_R_FIFO_RDY 0x10 -#define USBFS_UMS_BUS_RESET 0x08 -#define USBFS_UMS_SUSPEND 0x04 -#define USBFS_UMS_DM_LEVEL 0x02 -#define USBFS_UMS_DEV_ATTACH 0x01 - -#define USBFS_UDA_GP_BIT 0x80 -#define USBFS_USB_ADDR_MASK 0x7F - -#define DEF_USBD_UEP0_SIZE 64 /* usb hs/fs device end-point 0 size */ -#define UEP_SIZE 64 - -#define DEF_UEP_IN 0x80 -#define DEF_UEP_OUT 0x00 -#define DEF_UEP_BUSY 0x01 -#define DEF_UEP_FREE 0x00 - -#define DEF_UEP0 0 -#define DEF_UEP1 1 -#define DEF_UEP2 2 -#define DEF_UEP3 3 -#define DEF_UEP4 4 -#define DEF_UEP5 5 -#define DEF_UEP6 6 -#define DEF_UEP7 7 -#define UNUM_EP 8 - - /* USB Host Mode */ - - typedef struct - { - __IO uint8_t RESERVED0; - __IO uint8_t HOST_CTRL; - __IO uint8_t RESERVED1; - __IO uint8_t RESERVED2; - __IO uint8_t RESERVED3; - __IO uint8_t RESERVED4; - __IO uint8_t RESERVED5; - __IO uint8_t RESERVED6; - __IO uint16_t RESERVED7; - __IO uint16_t RESERVED8; - __IO uint8_t RESERVED9; - __IO uint8_t HOST_EP_MOD; - __IO uint8_t RESERVED10; - __IO uint8_t RESERVED11; - - __IO uint32_t RESERVED12; - __IO uint32_t RESERVED13; - __IO uint32_t HOST_RX_DMA; - __IO uint32_t HOST_TX_DMA; - - __IO uint16_t RESERVED14; - __IO uint16_t RESERVED15; - __IO uint16_t RESERVED16; - - __IO uint16_t HOST_SETUP; - __IO uint16_t HOST_EP_PID; - __IO uint16_t HOST_RX_CTL; - __IO uint16_t HOST_TX_LEN; - __IO uint16_t HOST_TX_CTL; - - __IO uint16_t RESERVED20; - __IO uint16_t RESERVED21; - - __IO uint32_t RESERVED22[8]; - - __IO uint32_t RESERVED23; - __IO uint32_t RESERVED24; - __IO uint32_t RESERVED25; - - __IO uint32_t RESERVED26; - - __IO uint16_t RESERVED27; - __IO uint16_t RESERVED28; - - __IO uint16_t RESERVED29; - __IO uint16_t RESERVED30; - - __IO uint16_t RESERVED31; - __IO uint16_t RESERVED32; - - __IO uint32_t RESERVED33; - } USBDH_TypeDef; - - /* USB Power Delivery */ - typedef struct - { - __IO uint32_t CONFIG; - __IO uint32_t CONTROL; - __IO uint32_t STATUS; - __IO uint32_t PORT; - __IO uint32_t DMA; - } USBPD_TypeDef; - - /* USB Power Delivery */ - typedef struct - { - __IO uint16_t CONFIG; - __IO uint16_t BCM_CLK_CNT; - - __IO uint8_t CONTROL; - __IO uint8_t TX_SEL; - __IO uint16_t BMC_TX_SZ; - - __IO uint8_t DATA_BUF; - __IO uint8_t STATUS; - __IO uint16_t BMC_BYTE_CNT; - - __IO uint16_t PORT_CC1; - __IO uint16_t PORT_CC2; - - __IO uint32_t USBPD_DMA; - } USBPD_DETAILED_TypeDef; - - /* memory mapped structure for Program Fast Interrupt Controller (PFIC) */ - typedef struct - { - __I uint32_t ISR[8]; - __I uint32_t IPR[8]; - __IO uint32_t ITHRESDR; - __IO uint32_t RESERVED; - __IO uint32_t CFGR; - __I uint32_t GISR; - __IO uint8_t VTFIDR[4]; - uint8_t RESERVED0[12]; - __IO uint32_t VTFADDR[4]; - uint8_t RESERVED1[0x90]; - __O uint32_t IENR[8]; - uint8_t RESERVED2[0x60]; - __O uint32_t IRER[8]; - uint8_t RESERVED3[0x60]; - __O uint32_t IPSR[8]; - uint8_t RESERVED4[0x60]; - __O uint32_t IPRR[8]; - uint8_t RESERVED5[0x60]; - __IO uint32_t IACTR[8]; - uint8_t RESERVED6[0xE0]; - __IO uint8_t IPRIOR[256]; - uint8_t RESERVED7[0x810]; - __IO uint32_t SCTLR; - } PFIC_Type; - -#endif // !__ASSEMBLER__ - -/* Peripheral memory map */ -#ifdef __ASSEMBLER__ -#define FLASH_BASE (0x08000000) /* FLASH base address in the alias region */ -#define SRAM_BASE (0x20000000) /* SRAM base address in the alias region */ -#define PERIPH_BASE (0x40000000) /* Peripheral base address in the alias region */ -#define CORE_PERIPH_BASE (0xE0000000) /* System peripherals base address in the alias region */ -#else -#define FLASH_BASE ((uint32_t)0x08000000) /* FLASH base address in the alias region */ -#define SRAM_BASE ((uint32_t)0x20000000) /* SRAM base address in the alias region */ -#define PERIPH_BASE ((uint32_t)0x40000000) /* Peripheral base address in the alias region */ -#define CORE_PERIPH_BASE ((uint32_t)0xE0000000) /* System peripherals base address in the alias region */ -#endif - -#define APB1PERIPH_BASE (PERIPH_BASE) -#define APB2PERIPH_BASE (PERIPH_BASE + 0x10000) -#define AHBPERIPH_BASE (PERIPH_BASE + 0x20000) - -#define TIM2_BASE (APB1PERIPH_BASE + 0x0000) -#define TIM3_BASE (APB1PERIPH_BASE + 0x0400) -#define WWDG_BASE (APB1PERIPH_BASE + 0x2C00) -#define IWDG_BASE (APB1PERIPH_BASE + 0x3000) -#define USART2_BASE (APB1PERIPH_BASE + 0x4400) -#define USART3_BASE (APB1PERIPH_BASE + 0x4800) -#define USART4_BASE (APB1PERIPH_BASE + 0x4C00) -#define I2C1_BASE (APB1PERIPH_BASE + 0x5400) -#define PWR_BASE (APB1PERIPH_BASE + 0x7000) - -#define AFIO_BASE (APB2PERIPH_BASE + 0x0000) -#define EXTI_BASE (APB2PERIPH_BASE + 0x0400) -#define GPIOA_BASE (APB2PERIPH_BASE + 0x0800) -#define GPIOB_BASE (APB2PERIPH_BASE + 0x0C00) -#define GPIOC_BASE (APB2PERIPH_BASE + 0x1000) -#define GPIOD_BASE (APB2PERIPH_BASE + 0x1400) -#define ADC1_BASE (APB2PERIPH_BASE + 0x2400) -#define TIM1_BASE (APB2PERIPH_BASE + 0x2C00) -#define SPI1_BASE (APB2PERIPH_BASE + 0x3000) -#define USART1_BASE (APB2PERIPH_BASE + 0x3800) - -#define DMA1_BASE (AHBPERIPH_BASE + 0x0000) -#define DMA1_Channel1_BASE (AHBPERIPH_BASE + 0x0008) -#define DMA1_Channel2_BASE (AHBPERIPH_BASE + 0x001C) -#define DMA1_Channel3_BASE (AHBPERIPH_BASE + 0x0030) -#define DMA1_Channel4_BASE (AHBPERIPH_BASE + 0x0044) -#define DMA1_Channel5_BASE (AHBPERIPH_BASE + 0x0058) -#define DMA1_Channel6_BASE (AHBPERIPH_BASE + 0x006C) -#define DMA1_Channel7_BASE (AHBPERIPH_BASE + 0x0080) -#define DMA1_Channel8_BASE (AHBPERIPH_BASE + 0x0094) -#define RCC_BASE (AHBPERIPH_BASE + 0x1000) - -#define FLASH_R_BASE (AHBPERIPH_BASE + 0x2000) /* Flash registers base address */ - -#define OPA_BASE (AHBPERIPH_BASE + 0x6000) -#define USBFS_BASE (AHBPERIPH_BASE + 0x3400) -#define AWU_BASE (AHBPERIPH_BASE + 0x6400) -#define PIOC_BASE (AHBPERIPH_BASE + 0x6C00) -#define USBPD_BASE (AHBPERIPH_BASE + 0x7000) - -#define OB_BASE ((uint32_t)0x1FFFF800) /* Flash Option Bytes base address */ -#define ESIG_BASE ((uint32_t)0x1FFFF7E0) -#define INFO_BASE ((uint32_t)0x1FFFF704) - -#define PFIC_BASE (CORE_PERIPH_BASE + 0xE000) -#define SysTick_BASE (CORE_PERIPH_BASE + 0xF000) - -// AFIO CTLR Bits -#define PB6_FILT_EN (1 << 27) -#define PB5_FILT_EN (1 << 26) -#define PA4_FILT_EN (1 << 25) -#define PA3_FILT_EN (1 << 24) -#define UDM_BC_CMPO (1 << 19) -#define UDP_BC_CMPO (1 << 17) -#define UDM_BC_VSRC (1 << 17) -#define UDP_BC_VSRC (1 << 16) -#define USBPD_IN_HVT (1 << 9) -#define USBPD_PHY_V33 (1 << 8) -#define USB_IOEN (1 << 7) -#define USB_PHY_V33 (1 << 6) -#define UDP_PUE_00 (0b00 << 2) -#define UDP_PUE_01 (0b01 << 2) -#define UDP_PUE_10 (0b10 << 2) -#define UDP_PUE_11 (0b11 << 2) -#define UDM_PUE_00 (0b00 << 0) -#define UDM_PUE_01 (0b01 << 0) -#define UDM_PUE_10 (0b10 << 0) -#define UDM_PUE_11 (0b11 << 0) -#define UDP_PUE_MASK 0x0000000C -#define UDP_PUE_DISABLE 0x00000000 -#define UDP_PUE_35UA 0x00000004 -#define UDP_PUE_10K 0x00000008 -#define UDP_PUE_1K5 0x0000000C -#define UDM_PUE_MASK 0x00000003 -#define UDM_PUE_DISABLE 0x00000000 -#define UDM_PUE_35UA 0x00000001 -#define UDM_PUE_10K 0x00000002 -#define UDM_PUE_1K5 0x00000003 - -// USB PD Bits -#define IE_TX_END (1 << 15) -#define IE_RX_RESET (1 << 14) -#define IE_RX_ACT (1 << 13) -#define IE_RX_BYTE (1 << 12) -#define IE_RX_BIT (1 << 11) -#define IE_PD_IO (1 << 10) -#define WAKE_POLAR (1 << 5) -#define PD_RST_EN (1 << 4) -#define PD_DMA_EN (1 << 3) -#define CC_SEL (1 << 2) -#define PD_ALL_CLR (1 << 1) -#define PD_FILT_EN (1 << 0) -#define BMC_CLK_CNT_MASK (0xff) - -// R8_CONTROL -#define BMC_BYTE_HI (1 << 7) -#define TX_BIT_BACK (1 << 6) -#define DATA_FLAG (1 << 5) -#define RX_STATE_MASK (0x7 << 2) -#define RX_STATE_0 (1 << 2) -#define RX_STATE_1 (1 << 3) -#define RX_STATE_2 (1 << 4) -#define BMC_START (1 << 1) -#define PD_TX_EN (1 << 0) - -#define TX_SEL4_MASK (3 << 6) -#define TX_SEL4_0 (1 << 6) -#define TX_SEL4_1 (1 << 7) - -#define TX_SEL3_MASK (3 << 4) -#define TX_SEL3_0 (1 << 4) -#define TX_SEL3_1 (1 << 5) - -#define TX_SEL2_MASK (3 << 2) -#define TX_SEL2_0 (1 << 2) -#define TX_SEL2_1 (1 << 3) - -#define TX_SEL1 (1 << 0) - -#define BMC_TX_SZ_MASK (0x1ff) - -// R8_STATUS -#define IF_TX_END (1 << 7) -#define IF_RX_RESET (1 << 6) -#define IF_RX_ACT (1 << 5) -#define IF_RX_BYTE (1 << 4) -#define IF_RX_BIT (1 << 3) -#define IFBUF_ERR (1 << 2) -#define BMC_AUX_MASK (3 << 0) -#define BMC_AUX_1 (1 << 1) -#define BMC_AUX_0 (1 << 0) - -// PORT CC1 -#define CC1_CE_MASK (7 << 5) -#define CC1_CE_0 (1 << 5) -#define CC1_CE_1 (2 << 5) -#define CC1_CE_2 (4 << 5) - -#define CC1_LVE (1 << 4) -#define CC1_PU_MASK (3 << 2) -#define CC1_PU_DISABLE (0 << 2) -#define CC1_PU_330uA (1 << 2) -#define CC1_PU_180uA (2 << 2) -#define CC1_PU_80uA (3 << 2) -#define PA_CC1_AI (1 << 0) - -#define CC2_CE_MASK (7 << 5) -#define CC2_CE_0 (1 << 5) -#define CC2_CE_1 (2 << 5) -#define CC2_CE_2 (4 << 5) - -#define CC2_LVE (1 << 4) -#define CC2_PU_MASK (3 << 2) -#define CC2_PU_DISABLE (0 << 2) -#define CC2_PU_330uA (1 << 2) -#define CC2_PU_180uA (2 << 2) -#define CC2_PU_80uA (3 << 2) -#define PA_CC2_AI (1 << 0) - -/* Peripheral declaration */ -#define TIM2 ((TIM_TypeDef *)TIM2_BASE) -#define TIM3 ((TIM_TypeDef *)TIM3_BASE) -#define WWDG ((WWDG_TypeDef *)WWDG_BASE) -#define IWDG ((IWDG_TypeDef *)IWDG_BASE) -#define USART2 ((USART_TypeDef *)USART2_BASE) -#define USART3 ((USART_TypeDef *)USART3_BASE) -#define USART4 ((USART_TypeDef *)USART4_BASE) -#define I2C1 ((I2C_TypeDef *)I2C1_BASE) -#define PWR ((PWR_TypeDef *)PWR_BASE) - -#define AFIO ((AFIO_TypeDef *)AFIO_BASE) -#define EXTI ((EXTI_TypeDef *)EXTI_BASE) -#define GPIOA ((GPIO_TypeDef *)GPIOA_BASE) -#define GPIOB ((GPIO_TypeDef *)GPIOB_BASE) -#define GPIOC ((GPIO_TypeDef *)GPIOC_BASE) -#define GPIOD ((GPIO_TypeDef *)GPIOD_BASE) -#define ADC1 ((ADC_TypeDef *)ADC1_BASE) -#define TIM3 ((TIM_TypeDef *)TIM3_BASE) -#define TKey ((TKEY_TypeDef *)ADC1_BASE) -#define OPA ((OPACMP_TypeDef *)OPA_BASE) -#define USBFS ((USBFS_TypeDef *)USBFS_BASE) -#define USBPDWORD ((USBPD_TypeDef *)USBPD_BASE) -#define USBPD ((USBPD_DETAILED_TypeDef *)USBPD_BASE) -#define USBDH ((USBDH_TypeDef *)USBFS_BASE) - -#define TIM1 ((TIM_TypeDef *)TIM1_BASE) -#define SPI1 ((SPI_TypeDef *)SPI1_BASE) -#define USART1 ((USART_TypeDef *)USART1_BASE) - -#define DMA1 ((DMA_TypeDef *)DMA1_BASE) -#define DMA1_Channel1 ((DMA_Channel_TypeDef *)DMA1_Channel1_BASE) -#define DMA1_Channel2 ((DMA_Channel_TypeDef *)DMA1_Channel2_BASE) -#define DMA1_Channel3 ((DMA_Channel_TypeDef *)DMA1_Channel3_BASE) -#define DMA1_Channel4 ((DMA_Channel_TypeDef *)DMA1_Channel4_BASE) -#define DMA1_Channel5 ((DMA_Channel_TypeDef *)DMA1_Channel5_BASE) -#define DMA1_Channel6 ((DMA_Channel_TypeDef *)DMA1_Channel6_BASE) -#define DMA1_Channel7 ((DMA_Channel_TypeDef *)DMA1_Channel7_BASE) -#define DMA1_Channel8 ((DMA_Channel_TypeDef *)DMA1_Channel8_BASE) -#define RCC ((RCC_TypeDef *)RCC_BASE) -#define FLASH ((FLASH_TypeDef *)FLASH_R_BASE) -#define OB ((OB_TypeDef *)OB_BASE) -#define ESIG ((ESG_TypeDef *)ESIG_BASE) -// Mentioned in ch32v30x_dbgmcu.c, may not work on all processors. -#define INFO ((INFO_TypeDef *)INFO_BASE) -#define EXTEN ((EXTEN_TypeDef *)EXTEN_BASE) -#define EXTEND ((EXTEND_TypeDef *)EXTEN_BASE) // Alias to EXTEN - -/******************************************************************************/ -/* Peripheral Registers Bits Definition */ -/******************************************************************************/ - -/******************************************************************************/ -/* Analog to Digital Converter */ -/******************************************************************************/ - -/******************** Bit definition for ADC_STATR register ********************/ -#define ADC_AWD ((uint8_t)0x01) /* Analog watchdog flag */ -#define ADC_EOC ((uint8_t)0x02) /* End of conversion */ -#define ADC_JEOC ((uint8_t)0x04) /* Injected channel end of conversion */ -#define ADC_JSTRT ((uint8_t)0x08) /* Injected channel Start flag */ -#define ADC_STRT ((uint8_t)0x10) /* Regular channel Start flag */ - -/******************* Bit definition for ADC_CTLR1 register ********************/ -#define ADC_AWDCH ((uint32_t)0x0000001F) /* AWDCH[4:0] bits (Analog watchdog channel select bits) */ -#define ADC_AWDCH_0 ((uint32_t)0x00000001) /* Bit 0 */ -#define ADC_AWDCH_1 ((uint32_t)0x00000002) /* Bit 1 */ -#define ADC_AWDCH_2 ((uint32_t)0x00000004) /* Bit 2 */ -#define ADC_AWDCH_3 ((uint32_t)0x00000008) /* Bit 3 */ -#define ADC_AWDCH_4 ((uint32_t)0x00000010) /* Bit 4 */ - -#define ADC_EOCIE ((uint32_t)0x00000020) /* Interrupt enable for EOC */ -#define ADC_AWDIE ((uint32_t)0x00000040) /* Analog Watchdog interrupt enable */ -#define ADC_JEOCIE ((uint32_t)0x00000080) /* Interrupt enable for injected channels */ -#define ADC_SCAN ((uint32_t)0x00000100) /* Scan mode */ -#define ADC_AWDSGL ((uint32_t)0x00000200) /* Enable the watchdog on a single channel in scan mode */ -#define ADC_JAUTO ((uint32_t)0x00000400) /* Automatic injected group conversion */ -#define ADC_DISCEN ((uint32_t)0x00000800) /* Discontinuous mode on regular channels */ -#define ADC_JDISCEN ((uint32_t)0x00001000) /* Discontinuous mode on injected channels */ - -#define ADC_DISCNUM ((uint32_t)0x0000E000) /* DISCNUM[2:0] bits (Discontinuous mode channel count) */ -#define ADC_DISCNUM_0 ((uint32_t)0x00002000) /* Bit 0 */ -#define ADC_DISCNUM_1 ((uint32_t)0x00004000) /* Bit 1 */ -#define ADC_DISCNUM_2 ((uint32_t)0x00008000) /* Bit 2 */ - -#define ADC_DUALMOD ((uint32_t)0x000F0000) /* DUALMOD[3:0] bits (Dual mode selection) */ -#define ADC_DUALMOD_0 ((uint32_t)0x00010000) /* Bit 0 */ -#define ADC_DUALMOD_1 ((uint32_t)0x00020000) /* Bit 1 */ -#define ADC_DUALMOD_2 ((uint32_t)0x00040000) /* Bit 2 */ -#define ADC_DUALMOD_3 ((uint32_t)0x00080000) /* Bit 3 */ - -#define ADC_JAWDEN ((uint32_t)0x00400000) /* Analog watchdog enable on injected channels */ -#define ADC_AWDEN ((uint32_t)0x00800000) /* Analog watchdog enable on regular channels */ -#define ADC_TKENABLE ((uint32_t)0x01000000) /* TKEN mode enable */ - -/******************* Bit definition for ADC_CTLR2 register ********************/ -#define ADC_ADON ((uint32_t)0x00000001) /* A/D Converter ON / OFF */ -#define ADC_CONT ((uint32_t)0x00000002) /* Continuous Conversion */ -#define ADC_CAL ((uint32_t)0x00000004) /* A/D Calibration */ -#define ADC_RSTCAL ((uint32_t)0x00000008) /* Reset Calibration */ -#define ADC_DMA ((uint32_t)0x00000100) /* Direct Memory access mode */ -#define ADC_ALIGN ((uint32_t)0x00000800) /* Data Alignment */ - -#define ADC_JEXTSEL ((uint32_t)0x00007000) /* JEXTSEL[2:0] bits (External event select for injected group) */ -#define ADC_JEXTSEL_0 ((uint32_t)0x00001000) /* Bit 0 */ -#define ADC_JEXTSEL_1 ((uint32_t)0x00002000) /* Bit 1 */ -#define ADC_JEXTSEL_2 ((uint32_t)0x00004000) /* Bit 2 */ - -#define ADC_JEXTTRIG ((uint32_t)0x00008000) /* External Trigger Conversion mode for injected channels */ - -#define ADC_EXTSEL ((uint32_t)0x000E0000) /* EXTSEL[2:0] bits (External Event Select for regular group) */ -#define ADC_EXTSEL_0 ((uint32_t)0x00020000) /* Bit 0 */ -#define ADC_EXTSEL_1 ((uint32_t)0x00040000) /* Bit 1 */ -#define ADC_EXTSEL_2 ((uint32_t)0x00080000) /* Bit 2 */ - -#define ADC_EXTTRIG ((uint32_t)0x00100000) /* External Trigger Conversion mode for regular channels */ -#define ADC_JSWSTART ((uint32_t)0x00200000) /* Start Conversion of injected channels */ -#define ADC_SWSTART ((uint32_t)0x00400000) /* Start Conversion of regular channels */ -#define ADC_TSVREFE ((uint32_t)0x00800000) /* Temperature Sensor and VREFINT Enable */ - -/****************** Bit definition for ADC_SAMPTR1 register *******************/ -#define ADC_SMP10 ((uint32_t)0x00000007) /* SMP10[2:0] bits (Channel 10 Sample time selection) */ -#define ADC_SMP10_0 ((uint32_t)0x00000001) /* Bit 0 */ -#define ADC_SMP10_1 ((uint32_t)0x00000002) /* Bit 1 */ -#define ADC_SMP10_2 ((uint32_t)0x00000004) /* Bit 2 */ - -#define ADC_SMP11 ((uint32_t)0x00000038) /* SMP11[2:0] bits (Channel 11 Sample time selection) */ -#define ADC_SMP11_0 ((uint32_t)0x00000008) /* Bit 0 */ -#define ADC_SMP11_1 ((uint32_t)0x00000010) /* Bit 1 */ -#define ADC_SMP11_2 ((uint32_t)0x00000020) /* Bit 2 */ - -#define ADC_SMP12 ((uint32_t)0x000001C0) /* SMP12[2:0] bits (Channel 12 Sample time selection) */ -#define ADC_SMP12_0 ((uint32_t)0x00000040) /* Bit 0 */ -#define ADC_SMP12_1 ((uint32_t)0x00000080) /* Bit 1 */ -#define ADC_SMP12_2 ((uint32_t)0x00000100) /* Bit 2 */ - -#define ADC_SMP13 ((uint32_t)0x00000E00) /* SMP13[2:0] bits (Channel 13 Sample time selection) */ -#define ADC_SMP13_0 ((uint32_t)0x00000200) /* Bit 0 */ -#define ADC_SMP13_1 ((uint32_t)0x00000400) /* Bit 1 */ -#define ADC_SMP13_2 ((uint32_t)0x00000800) /* Bit 2 */ - -#define ADC_SMP14 ((uint32_t)0x00007000) /* SMP14[2:0] bits (Channel 14 Sample time selection) */ -#define ADC_SMP14_0 ((uint32_t)0x00001000) /* Bit 0 */ -#define ADC_SMP14_1 ((uint32_t)0x00002000) /* Bit 1 */ -#define ADC_SMP14_2 ((uint32_t)0x00004000) /* Bit 2 */ - -#define ADC_SMP15 ((uint32_t)0x00038000) /* SMP15[2:0] bits (Channel 15 Sample time selection) */ -#define ADC_SMP15_0 ((uint32_t)0x00008000) /* Bit 0 */ -#define ADC_SMP15_1 ((uint32_t)0x00010000) /* Bit 1 */ -#define ADC_SMP15_2 ((uint32_t)0x00020000) /* Bit 2 */ - -#define ADC_SMP16 ((uint32_t)0x001C0000) /* SMP16[2:0] bits (Channel 16 Sample time selection) */ -#define ADC_SMP16_0 ((uint32_t)0x00040000) /* Bit 0 */ -#define ADC_SMP16_1 ((uint32_t)0x00080000) /* Bit 1 */ -#define ADC_SMP16_2 ((uint32_t)0x00100000) /* Bit 2 */ - -#define ADC_SMP17 ((uint32_t)0x00E00000) /* SMP17[2:0] bits (Channel 17 Sample time selection) */ -#define ADC_SMP17_0 ((uint32_t)0x00200000) /* Bit 0 */ -#define ADC_SMP17_1 ((uint32_t)0x00400000) /* Bit 1 */ -#define ADC_SMP17_2 ((uint32_t)0x00800000) /* Bit 2 */ - -/****************** Bit definition for ADC_SAMPTR2 register *******************/ -#define ADC_SMP0 ((uint32_t)0x00000007) /* SMP0[2:0] bits (Channel 0 Sample time selection) */ -#define ADC_SMP0_0 ((uint32_t)0x00000001) /* Bit 0 */ -#define ADC_SMP0_1 ((uint32_t)0x00000002) /* Bit 1 */ -#define ADC_SMP0_2 ((uint32_t)0x00000004) /* Bit 2 */ - -#define ADC_SMP1 ((uint32_t)0x00000038) /* SMP1[2:0] bits (Channel 1 Sample time selection) */ -#define ADC_SMP1_0 ((uint32_t)0x00000008) /* Bit 0 */ -#define ADC_SMP1_1 ((uint32_t)0x00000010) /* Bit 1 */ -#define ADC_SMP1_2 ((uint32_t)0x00000020) /* Bit 2 */ - -#define ADC_SMP2 ((uint32_t)0x000001C0) /* SMP2[2:0] bits (Channel 2 Sample time selection) */ -#define ADC_SMP2_0 ((uint32_t)0x00000040) /* Bit 0 */ -#define ADC_SMP2_1 ((uint32_t)0x00000080) /* Bit 1 */ -#define ADC_SMP2_2 ((uint32_t)0x00000100) /* Bit 2 */ - -#define ADC_SMP3 ((uint32_t)0x00000E00) /* SMP3[2:0] bits (Channel 3 Sample time selection) */ -#define ADC_SMP3_0 ((uint32_t)0x00000200) /* Bit 0 */ -#define ADC_SMP3_1 ((uint32_t)0x00000400) /* Bit 1 */ -#define ADC_SMP3_2 ((uint32_t)0x00000800) /* Bit 2 */ - -#define ADC_SMP4 ((uint32_t)0x00007000) /* SMP4[2:0] bits (Channel 4 Sample time selection) */ -#define ADC_SMP4_0 ((uint32_t)0x00001000) /* Bit 0 */ -#define ADC_SMP4_1 ((uint32_t)0x00002000) /* Bit 1 */ -#define ADC_SMP4_2 ((uint32_t)0x00004000) /* Bit 2 */ - -#define ADC_SMP5 ((uint32_t)0x00038000) /* SMP5[2:0] bits (Channel 5 Sample time selection) */ -#define ADC_SMP5_0 ((uint32_t)0x00008000) /* Bit 0 */ -#define ADC_SMP5_1 ((uint32_t)0x00010000) /* Bit 1 */ -#define ADC_SMP5_2 ((uint32_t)0x00020000) /* Bit 2 */ - -#define ADC_SMP6 ((uint32_t)0x001C0000) /* SMP6[2:0] bits (Channel 6 Sample time selection) */ -#define ADC_SMP6_0 ((uint32_t)0x00040000) /* Bit 0 */ -#define ADC_SMP6_1 ((uint32_t)0x00080000) /* Bit 1 */ -#define ADC_SMP6_2 ((uint32_t)0x00100000) /* Bit 2 */ - -#define ADC_SMP7 ((uint32_t)0x00E00000) /* SMP7[2:0] bits (Channel 7 Sample time selection) */ -#define ADC_SMP7_0 ((uint32_t)0x00200000) /* Bit 0 */ -#define ADC_SMP7_1 ((uint32_t)0x00400000) /* Bit 1 */ -#define ADC_SMP7_2 ((uint32_t)0x00800000) /* Bit 2 */ - -#define ADC_SMP8 ((uint32_t)0x07000000) /* SMP8[2:0] bits (Channel 8 Sample time selection) */ -#define ADC_SMP8_0 ((uint32_t)0x01000000) /* Bit 0 */ -#define ADC_SMP8_1 ((uint32_t)0x02000000) /* Bit 1 */ -#define ADC_SMP8_2 ((uint32_t)0x04000000) /* Bit 2 */ - -#define ADC_SMP9 ((uint32_t)0x38000000) /* SMP9[2:0] bits (Channel 9 Sample time selection) */ -#define ADC_SMP9_0 ((uint32_t)0x08000000) /* Bit 0 */ -#define ADC_SMP9_1 ((uint32_t)0x10000000) /* Bit 1 */ -#define ADC_SMP9_2 ((uint32_t)0x20000000) /* Bit 2 */ - -/****************** Bit definition for ADC_IOFR1 register *******************/ -#define ADC_JOFFSET1 ((uint16_t)0x0FFF) /* Data offset for injected channel 1 */ - -/****************** Bit definition for ADC_IOFR2 register *******************/ -#define ADC_JOFFSET2 ((uint16_t)0x0FFF) /* Data offset for injected channel 2 */ - -/****************** Bit definition for ADC_IOFR3 register *******************/ -#define ADC_JOFFSET3 ((uint16_t)0x0FFF) /* Data offset for injected channel 3 */ - -/****************** Bit definition for ADC_IOFR4 register *******************/ -#define ADC_JOFFSET4 ((uint16_t)0x0FFF) /* Data offset for injected channel 4 */ - -/******************* Bit definition for ADC_WDHTR register ********************/ -#define ADC_HT ((uint16_t)0x0FFF) /* Analog watchdog high threshold */ - -/******************* Bit definition for ADC_WDLTR register ********************/ -#define ADC_LT ((uint16_t)0x0FFF) /* Analog watchdog low threshold */ - -/******************* Bit definition for ADC_RSQR1 register *******************/ -#define ADC_SQ13 ((uint32_t)0x0000001F) /* SQ13[4:0] bits (13th conversion in regular sequence) */ -#define ADC_SQ13_0 ((uint32_t)0x00000001) /* Bit 0 */ -#define ADC_SQ13_1 ((uint32_t)0x00000002) /* Bit 1 */ -#define ADC_SQ13_2 ((uint32_t)0x00000004) /* Bit 2 */ -#define ADC_SQ13_3 ((uint32_t)0x00000008) /* Bit 3 */ -#define ADC_SQ13_4 ((uint32_t)0x00000010) /* Bit 4 */ - -#define ADC_SQ14 ((uint32_t)0x000003E0) /* SQ14[4:0] bits (14th conversion in regular sequence) */ -#define ADC_SQ14_0 ((uint32_t)0x00000020) /* Bit 0 */ -#define ADC_SQ14_1 ((uint32_t)0x00000040) /* Bit 1 */ -#define ADC_SQ14_2 ((uint32_t)0x00000080) /* Bit 2 */ -#define ADC_SQ14_3 ((uint32_t)0x00000100) /* Bit 3 */ -#define ADC_SQ14_4 ((uint32_t)0x00000200) /* Bit 4 */ - -#define ADC_SQ15 ((uint32_t)0x00007C00) /* SQ15[4:0] bits (15th conversion in regular sequence) */ -#define ADC_SQ15_0 ((uint32_t)0x00000400) /* Bit 0 */ -#define ADC_SQ15_1 ((uint32_t)0x00000800) /* Bit 1 */ -#define ADC_SQ15_2 ((uint32_t)0x00001000) /* Bit 2 */ -#define ADC_SQ15_3 ((uint32_t)0x00002000) /* Bit 3 */ -#define ADC_SQ15_4 ((uint32_t)0x00004000) /* Bit 4 */ - -#define ADC_SQ16 ((uint32_t)0x000F8000) /* SQ16[4:0] bits (16th conversion in regular sequence) */ -#define ADC_SQ16_0 ((uint32_t)0x00008000) /* Bit 0 */ -#define ADC_SQ16_1 ((uint32_t)0x00010000) /* Bit 1 */ -#define ADC_SQ16_2 ((uint32_t)0x00020000) /* Bit 2 */ -#define ADC_SQ16_3 ((uint32_t)0x00040000) /* Bit 3 */ -#define ADC_SQ16_4 ((uint32_t)0x00080000) /* Bit 4 */ - -#define ADC_L ((uint32_t)0x00F00000) /* L[3:0] bits (Regular channel sequence length) */ -#define ADC_L_0 ((uint32_t)0x00100000) /* Bit 0 */ -#define ADC_L_1 ((uint32_t)0x00200000) /* Bit 1 */ -#define ADC_L_2 ((uint32_t)0x00400000) /* Bit 2 */ -#define ADC_L_3 ((uint32_t)0x00800000) /* Bit 3 */ - -/******************* Bit definition for ADC_RSQR2 register *******************/ -#define ADC_SQ7 ((uint32_t)0x0000001F) /* SQ7[4:0] bits (7th conversion in regular sequence) */ -#define ADC_SQ7_0 ((uint32_t)0x00000001) /* Bit 0 */ -#define ADC_SQ7_1 ((uint32_t)0x00000002) /* Bit 1 */ -#define ADC_SQ7_2 ((uint32_t)0x00000004) /* Bit 2 */ -#define ADC_SQ7_3 ((uint32_t)0x00000008) /* Bit 3 */ -#define ADC_SQ7_4 ((uint32_t)0x00000010) /* Bit 4 */ - -#define ADC_SQ8 ((uint32_t)0x000003E0) /* SQ8[4:0] bits (8th conversion in regular sequence) */ -#define ADC_SQ8_0 ((uint32_t)0x00000020) /* Bit 0 */ -#define ADC_SQ8_1 ((uint32_t)0x00000040) /* Bit 1 */ -#define ADC_SQ8_2 ((uint32_t)0x00000080) /* Bit 2 */ -#define ADC_SQ8_3 ((uint32_t)0x00000100) /* Bit 3 */ -#define ADC_SQ8_4 ((uint32_t)0x00000200) /* Bit 4 */ - -#define ADC_SQ9 ((uint32_t)0x00007C00) /* SQ9[4:0] bits (9th conversion in regular sequence) */ -#define ADC_SQ9_0 ((uint32_t)0x00000400) /* Bit 0 */ -#define ADC_SQ9_1 ((uint32_t)0x00000800) /* Bit 1 */ -#define ADC_SQ9_2 ((uint32_t)0x00001000) /* Bit 2 */ -#define ADC_SQ9_3 ((uint32_t)0x00002000) /* Bit 3 */ -#define ADC_SQ9_4 ((uint32_t)0x00004000) /* Bit 4 */ - -#define ADC_SQ10 ((uint32_t)0x000F8000) /* SQ10[4:0] bits (10th conversion in regular sequence) */ -#define ADC_SQ10_0 ((uint32_t)0x00008000) /* Bit 0 */ -#define ADC_SQ10_1 ((uint32_t)0x00010000) /* Bit 1 */ -#define ADC_SQ10_2 ((uint32_t)0x00020000) /* Bit 2 */ -#define ADC_SQ10_3 ((uint32_t)0x00040000) /* Bit 3 */ -#define ADC_SQ10_4 ((uint32_t)0x00080000) /* Bit 4 */ - -#define ADC_SQ11 ((uint32_t)0x01F00000) /* SQ11[4:0] bits (11th conversion in regular sequence) */ -#define ADC_SQ11_0 ((uint32_t)0x00100000) /* Bit 0 */ -#define ADC_SQ11_1 ((uint32_t)0x00200000) /* Bit 1 */ -#define ADC_SQ11_2 ((uint32_t)0x00400000) /* Bit 2 */ -#define ADC_SQ11_3 ((uint32_t)0x00800000) /* Bit 3 */ -#define ADC_SQ11_4 ((uint32_t)0x01000000) /* Bit 4 */ - -#define ADC_SQ12 ((uint32_t)0x3E000000) /* SQ12[4:0] bits (12th conversion in regular sequence) */ -#define ADC_SQ12_0 ((uint32_t)0x02000000) /* Bit 0 */ -#define ADC_SQ12_1 ((uint32_t)0x04000000) /* Bit 1 */ -#define ADC_SQ12_2 ((uint32_t)0x08000000) /* Bit 2 */ -#define ADC_SQ12_3 ((uint32_t)0x10000000) /* Bit 3 */ -#define ADC_SQ12_4 ((uint32_t)0x20000000) /* Bit 4 */ - -/******************* Bit definition for ADC_RSQR3 register *******************/ -#define ADC_SQ1 ((uint32_t)0x0000001F) /* SQ1[4:0] bits (1st conversion in regular sequence) */ -#define ADC_SQ1_0 ((uint32_t)0x00000001) /* Bit 0 */ -#define ADC_SQ1_1 ((uint32_t)0x00000002) /* Bit 1 */ -#define ADC_SQ1_2 ((uint32_t)0x00000004) /* Bit 2 */ -#define ADC_SQ1_3 ((uint32_t)0x00000008) /* Bit 3 */ -#define ADC_SQ1_4 ((uint32_t)0x00000010) /* Bit 4 */ - -#define ADC_SQ2 ((uint32_t)0x000003E0) /* SQ2[4:0] bits (2nd conversion in regular sequence) */ -#define ADC_SQ2_0 ((uint32_t)0x00000020) /* Bit 0 */ -#define ADC_SQ2_1 ((uint32_t)0x00000040) /* Bit 1 */ -#define ADC_SQ2_2 ((uint32_t)0x00000080) /* Bit 2 */ -#define ADC_SQ2_3 ((uint32_t)0x00000100) /* Bit 3 */ -#define ADC_SQ2_4 ((uint32_t)0x00000200) /* Bit 4 */ - -#define ADC_SQ3 ((uint32_t)0x00007C00) /* SQ3[4:0] bits (3rd conversion in regular sequence) */ -#define ADC_SQ3_0 ((uint32_t)0x00000400) /* Bit 0 */ -#define ADC_SQ3_1 ((uint32_t)0x00000800) /* Bit 1 */ -#define ADC_SQ3_2 ((uint32_t)0x00001000) /* Bit 2 */ -#define ADC_SQ3_3 ((uint32_t)0x00002000) /* Bit 3 */ -#define ADC_SQ3_4 ((uint32_t)0x00004000) /* Bit 4 */ - -#define ADC_SQ4 ((uint32_t)0x000F8000) /* SQ4[4:0] bits (4th conversion in regular sequence) */ -#define ADC_SQ4_0 ((uint32_t)0x00008000) /* Bit 0 */ -#define ADC_SQ4_1 ((uint32_t)0x00010000) /* Bit 1 */ -#define ADC_SQ4_2 ((uint32_t)0x00020000) /* Bit 2 */ -#define ADC_SQ4_3 ((uint32_t)0x00040000) /* Bit 3 */ -#define ADC_SQ4_4 ((uint32_t)0x00080000) /* Bit 4 */ - -#define ADC_SQ5 ((uint32_t)0x01F00000) /* SQ5[4:0] bits (5th conversion in regular sequence) */ -#define ADC_SQ5_0 ((uint32_t)0x00100000) /* Bit 0 */ -#define ADC_SQ5_1 ((uint32_t)0x00200000) /* Bit 1 */ -#define ADC_SQ5_2 ((uint32_t)0x00400000) /* Bit 2 */ -#define ADC_SQ5_3 ((uint32_t)0x00800000) /* Bit 3 */ -#define ADC_SQ5_4 ((uint32_t)0x01000000) /* Bit 4 */ - -#define ADC_SQ6 ((uint32_t)0x3E000000) /* SQ6[4:0] bits (6th conversion in regular sequence) */ -#define ADC_SQ6_0 ((uint32_t)0x02000000) /* Bit 0 */ -#define ADC_SQ6_1 ((uint32_t)0x04000000) /* Bit 1 */ -#define ADC_SQ6_2 ((uint32_t)0x08000000) /* Bit 2 */ -#define ADC_SQ6_3 ((uint32_t)0x10000000) /* Bit 3 */ -#define ADC_SQ6_4 ((uint32_t)0x20000000) /* Bit 4 */ - -/******************* Bit definition for ADC_ISQR register *******************/ -#define ADC_JSQ1 ((uint32_t)0x0000001F) /* JSQ1[4:0] bits (1st conversion in injected sequence) */ -#define ADC_JSQ1_0 ((uint32_t)0x00000001) /* Bit 0 */ -#define ADC_JSQ1_1 ((uint32_t)0x00000002) /* Bit 1 */ -#define ADC_JSQ1_2 ((uint32_t)0x00000004) /* Bit 2 */ -#define ADC_JSQ1_3 ((uint32_t)0x00000008) /* Bit 3 */ -#define ADC_JSQ1_4 ((uint32_t)0x00000010) /* Bit 4 */ - -#define ADC_JSQ2 ((uint32_t)0x000003E0) /* JSQ2[4:0] bits (2nd conversion in injected sequence) */ -#define ADC_JSQ2_0 ((uint32_t)0x00000020) /* Bit 0 */ -#define ADC_JSQ2_1 ((uint32_t)0x00000040) /* Bit 1 */ -#define ADC_JSQ2_2 ((uint32_t)0x00000080) /* Bit 2 */ -#define ADC_JSQ2_3 ((uint32_t)0x00000100) /* Bit 3 */ -#define ADC_JSQ2_4 ((uint32_t)0x00000200) /* Bit 4 */ - -#define ADC_JSQ3 ((uint32_t)0x00007C00) /* JSQ3[4:0] bits (3rd conversion in injected sequence) */ -#define ADC_JSQ3_0 ((uint32_t)0x00000400) /* Bit 0 */ -#define ADC_JSQ3_1 ((uint32_t)0x00000800) /* Bit 1 */ -#define ADC_JSQ3_2 ((uint32_t)0x00001000) /* Bit 2 */ -#define ADC_JSQ3_3 ((uint32_t)0x00002000) /* Bit 3 */ -#define ADC_JSQ3_4 ((uint32_t)0x00004000) /* Bit 4 */ - -#define ADC_JSQ4 ((uint32_t)0x000F8000) /* JSQ4[4:0] bits (4th conversion in injected sequence) */ -#define ADC_JSQ4_0 ((uint32_t)0x00008000) /* Bit 0 */ -#define ADC_JSQ4_1 ((uint32_t)0x00010000) /* Bit 1 */ -#define ADC_JSQ4_2 ((uint32_t)0x00020000) /* Bit 2 */ -#define ADC_JSQ4_3 ((uint32_t)0x00040000) /* Bit 3 */ -#define ADC_JSQ4_4 ((uint32_t)0x00080000) /* Bit 4 */ - -#define ADC_JL ((uint32_t)0x00300000) /* JL[1:0] bits (Injected Sequence length) */ -#define ADC_JL_0 ((uint32_t)0x00100000) /* Bit 0 */ -#define ADC_JL_1 ((uint32_t)0x00200000) /* Bit 1 */ - -/******************* Bit definition for ADC_IDATAR1 register *******************/ -#define ADC_IDATAR1_JDATA ((uint16_t)0xFFFF) /* Injected data */ - -/******************* Bit definition for ADC_IDATAR2 register *******************/ -#define ADC_IDATAR2_JDATA ((uint16_t)0xFFFF) /* Injected data */ - -/******************* Bit definition for ADC_IDATAR3 register *******************/ -#define ADC_IDATAR3_JDATA ((uint16_t)0xFFFF) /* Injected data */ - -/******************* Bit definition for ADC_IDATAR4 register *******************/ -#define ADC_IDATAR4_JDATA ((uint16_t)0xFFFF) /* Injected data */ - -/******************** Bit definition for ADC_RDATAR register ********************/ -#define ADC_RDATAR_DATA ((uint32_t)0x0000FFFF) /* Regular data */ -#define ADC_RDATAR_ADC2DATA ((uint32_t)0xFFFF0000) /* ADC2 data */ - -/******************** Bit definition for ADC_CTLR3 register ********************/ -#define ADC_CTLR3_CLK_DIV ((uint32_t)0x0000000F) /* CLK_DIVL[3:0] bits */ -#define ADC_CTLR3_CLK_DIV_0 ((uint32_t)0x00000001) /* Bit 0 */ -#define ADC_CTLR3_CLK_DIV_1 ((uint32_t)0x00000002) /* Bit 1 */ -#define ADC_CTLR3_CLK_DIV_2 ((uint32_t)0x00000004) /* Bit 2 */ -#define ADC_CTLR3_CLK_DIV_3 ((uint32_t)0x00000008) /* Bit 3 */ - -#define ADC_CTLR3_AWD_SCAN ((uint32_t)0x00000200) /* Analog watchdog Scan enable */ -#define ADC_CTLR3_AWD0_RST_EN ((uint32_t)0x00001000) /* Watchdog0 Reset Enable */ -#define ADC_CTLR3_AWD1_RST_EN ((uint32_t)0x00002000) /* Watchdog1 Reset Enable */ -#define ADC_CTLR3_AWD2_RST_EN ((uint32_t)0x00004000) /* Watchdog2 Reset Enable */ -#define ADC_CTLR3_AWD3_RST_EN ((uint32_t)0x00008000) /* Watchdog3 Reset Enable */ - -/******************** Bit definition for ADC_WDTR1 register ********************/ -#define ADC_WDTR1_LTR1 ((uint32_t)0x00000FFF) /* Analog watchdog1 low threshold */ -#define ADC_WDTR1_HTR1 ((uint32_t)0x0FFF0000) /* Analog watchdog1 high threshold */ - -/******************** Bit definition for ADC_WDTR2 register ********************/ -#define ADC_WDTR2_LTR2 ((uint32_t)0x00000FFF) /* Analog watchdog2 low threshold */ -#define ADC_WDTR2_HTR2 ((uint32_t)0x0FFF0000) /* Analog watchdog2 high threshold */ - -/******************** Bit definition for ADC_WDTR3 register ********************/ -#define ADC_WDTR3_LTR3 ((uint32_t)0x00000FFF) /* Analog watchdog3 low threshold */ -#define ADC_WDTR3_HTR3 ((uint32_t)0x0FFF0000) /* Analog watchdog3 high threshold */ - -/******************************************************************************/ -/* DMA Controller */ -/******************************************************************************/ - -/******************* Bit definition for DMA_INTFR register ********************/ -#define DMA_GIF1 ((uint32_t)0x00000001) /* Channel 1 Global interrupt flag */ -#define DMA_TCIF1 ((uint32_t)0x00000002) /* Channel 1 Transfer Complete flag */ -#define DMA_HTIF1 ((uint32_t)0x00000004) /* Channel 1 Half Transfer flag */ -#define DMA_TEIF1 ((uint32_t)0x00000008) /* Channel 1 Transfer Error flag */ -#define DMA_GIF2 ((uint32_t)0x00000010) /* Channel 2 Global interrupt flag */ -#define DMA_TCIF2 ((uint32_t)0x00000020) /* Channel 2 Transfer Complete flag */ -#define DMA_HTIF2 ((uint32_t)0x00000040) /* Channel 2 Half Transfer flag */ -#define DMA_TEIF2 ((uint32_t)0x00000080) /* Channel 2 Transfer Error flag */ -#define DMA_GIF3 ((uint32_t)0x00000100) /* Channel 3 Global interrupt flag */ -#define DMA_TCIF3 ((uint32_t)0x00000200) /* Channel 3 Transfer Complete flag */ -#define DMA_HTIF3 ((uint32_t)0x00000400) /* Channel 3 Half Transfer flag */ -#define DMA_TEIF3 ((uint32_t)0x00000800) /* Channel 3 Transfer Error flag */ -#define DMA_GIF4 ((uint32_t)0x00001000) /* Channel 4 Global interrupt flag */ -#define DMA_TCIF4 ((uint32_t)0x00002000) /* Channel 4 Transfer Complete flag */ -#define DMA_HTIF4 ((uint32_t)0x00004000) /* Channel 4 Half Transfer flag */ -#define DMA_TEIF4 ((uint32_t)0x00008000) /* Channel 4 Transfer Error flag */ -#define DMA_GIF5 ((uint32_t)0x00010000) /* Channel 5 Global interrupt flag */ -#define DMA_TCIF5 ((uint32_t)0x00020000) /* Channel 5 Transfer Complete flag */ -#define DMA_HTIF5 ((uint32_t)0x00040000) /* Channel 5 Half Transfer flag */ -#define DMA_TEIF5 ((uint32_t)0x00080000) /* Channel 5 Transfer Error flag */ -#define DMA_GIF6 ((uint32_t)0x00100000) /* Channel 6 Global interrupt flag */ -#define DMA_TCIF6 ((uint32_t)0x00200000) /* Channel 6 Transfer Complete flag */ -#define DMA_HTIF6 ((uint32_t)0x00400000) /* Channel 6 Half Transfer flag */ -#define DMA_TEIF6 ((uint32_t)0x00800000) /* Channel 6 Transfer Error flag */ -#define DMA_GIF7 ((uint32_t)0x01000000) /* Channel 7 Global interrupt flag */ -#define DMA_TCIF7 ((uint32_t)0x02000000) /* Channel 7 Transfer Complete flag */ -#define DMA_HTIF7 ((uint32_t)0x04000000) /* Channel 7 Half Transfer flag */ -#define DMA_TEIF7 ((uint32_t)0x08000000) /* Channel 7 Transfer Error flag */ -#define DMA_GIF8 ((uint32_t)0x10000000) /* Channel 8 Global interrupt flag */ -#define DMA_TCIF8 ((uint32_t)0x20000000) /* Channel 8 Transfer Complete flag */ -#define DMA_HTIF8 ((uint32_t)0x40000000) /* Channel 8 Half Transfer flag */ -#define DMA_TEIF8 ((uint32_t)0x80000000) /* Channel 8 Transfer Error flag */ - -/******************* Bit definition for DMA_INTFCR register *******************/ -#define DMA_CGIF1 ((uint32_t)0x00000001) /* Channel 1 Global interrupt clear */ -#define DMA_CTCIF1 ((uint32_t)0x00000002) /* Channel 1 Transfer Complete clear */ -#define DMA_CHTIF1 ((uint32_t)0x00000004) /* Channel 1 Half Transfer clear */ -#define DMA_CTEIF1 ((uint32_t)0x00000008) /* Channel 1 Transfer Error clear */ -#define DMA_CGIF2 ((uint32_t)0x00000010) /* Channel 2 Global interrupt clear */ -#define DMA_CTCIF2 ((uint32_t)0x00000020) /* Channel 2 Transfer Complete clear */ -#define DMA_CHTIF2 ((uint32_t)0x00000040) /* Channel 2 Half Transfer clear */ -#define DMA_CTEIF2 ((uint32_t)0x00000080) /* Channel 2 Transfer Error clear */ -#define DMA_CGIF3 ((uint32_t)0x00000100) /* Channel 3 Global interrupt clear */ -#define DMA_CTCIF3 ((uint32_t)0x00000200) /* Channel 3 Transfer Complete clear */ -#define DMA_CHTIF3 ((uint32_t)0x00000400) /* Channel 3 Half Transfer clear */ -#define DMA_CTEIF3 ((uint32_t)0x00000800) /* Channel 3 Transfer Error clear */ -#define DMA_CGIF4 ((uint32_t)0x00001000) /* Channel 4 Global interrupt clear */ -#define DMA_CTCIF4 ((uint32_t)0x00002000) /* Channel 4 Transfer Complete clear */ -#define DMA_CHTIF4 ((uint32_t)0x00004000) /* Channel 4 Half Transfer clear */ -#define DMA_CTEIF4 ((uint32_t)0x00008000) /* Channel 4 Transfer Error clear */ -#define DMA_CGIF5 ((uint32_t)0x00010000) /* Channel 5 Global interrupt clear */ -#define DMA_CTCIF5 ((uint32_t)0x00020000) /* Channel 5 Transfer Complete clear */ -#define DMA_CHTIF5 ((uint32_t)0x00040000) /* Channel 5 Half Transfer clear */ -#define DMA_CTEIF5 ((uint32_t)0x00080000) /* Channel 5 Transfer Error clear */ -#define DMA_CGIF6 ((uint32_t)0x00100000) /* Channel 6 Global interrupt clear */ -#define DMA_CTCIF6 ((uint32_t)0x00200000) /* Channel 6 Transfer Complete clear */ -#define DMA_CHTIF6 ((uint32_t)0x00400000) /* Channel 6 Half Transfer clear */ -#define DMA_CTEIF6 ((uint32_t)0x00800000) /* Channel 6 Transfer Error clear */ -#define DMA_CGIF7 ((uint32_t)0x01000000) /* Channel 7 Global interrupt clear */ -#define DMA_CTCIF7 ((uint32_t)0x02000000) /* Channel 7 Transfer Complete clear */ -#define DMA_CHTIF7 ((uint32_t)0x04000000) /* Channel 7 Half Transfer clear */ -#define DMA_CTEIF7 ((uint32_t)0x08000000) /* Channel 7 Transfer Error clear */ -#define DMA_CGIF8 ((uint32_t)0x10000000) /* Channel 8 Global interrupt clear */ -#define DMA_CTCIF8 ((uint32_t)0x20000000) /* Channel 8 Transfer Complete clear */ -#define DMA_CHTIF8 ((uint32_t)0x40000000) /* Channel 8 Half Transfer clear */ -#define DMA_CTEIF8 ((uint32_t)0x80000000) /* Channel 8 Transfer Error clear */ - -/******************* Bit definition for DMA_CFGR1 register *******************/ -#define DMA_CFGR1_EN ((uint16_t)0x0001) /* Channel enable*/ -#define DMA_CFGR1_TCIE ((uint16_t)0x0002) /* Transfer complete interrupt enable */ -#define DMA_CFGR1_HTIE ((uint16_t)0x0004) /* Half Transfer interrupt enable */ -#define DMA_CFGR1_TEIE ((uint16_t)0x0008) /* Transfer error interrupt enable */ -#define DMA_CFGR1_DIR ((uint16_t)0x0010) /* Data transfer direction (Setting = Memory -> Peripheral) */ -#define DMA_CFGR1_CIRC ((uint16_t)0x0020) /* Circular mode */ -#define DMA_CFGR1_PINC ((uint16_t)0x0040) /* Peripheral increment mode */ -#define DMA_CFGR1_MINC ((uint16_t)0x0080) /* Memory increment mode */ - -#define DMA_CFGR1_PSIZE ((uint16_t)0x0300) /* PSIZE[1:0] bits (Peripheral size) */ -#define DMA_CFGR1_PSIZE_0 ((uint16_t)0x0100) /* Bit 0 */ -#define DMA_CFGR1_PSIZE_1 ((uint16_t)0x0200) /* Bit 1 */ - -#define DMA_CFGR1_MSIZE ((uint16_t)0x0C00) /* MSIZE[1:0] bits (Memory size) */ -#define DMA_CFGR1_MSIZE_0 ((uint16_t)0x0400) /* Bit 0 */ -#define DMA_CFGR1_MSIZE_1 ((uint16_t)0x0800) /* Bit 1 */ - -#define DMA_CFGR1_PL ((uint16_t)0x3000) /* PL[1:0] bits(Channel Priority level) */ -#define DMA_CFGR1_PL_0 ((uint16_t)0x1000) /* Bit 0 */ -#define DMA_CFGR1_PL_1 ((uint16_t)0x2000) /* Bit 1 */ - -#define DMA_CFGR1_MEM2MEM ((uint16_t)0x4000) /* Memory to memory mode */ - -/******************* Bit definition for DMA_CFGR2 register *******************/ -#define DMA_CFGR2_EN ((uint16_t)0x0001) /* Channel enable */ -#define DMA_CFGR2_TCIE ((uint16_t)0x0002) /* Transfer complete interrupt enable */ -#define DMA_CFGR2_HTIE ((uint16_t)0x0004) /* Half Transfer interrupt enable */ -#define DMA_CFGR2_TEIE ((uint16_t)0x0008) /* Transfer error interrupt enable */ -#define DMA_CFGR2_DIR ((uint16_t)0x0010) /* Data transfer direction */ -#define DMA_CFGR2_CIRC ((uint16_t)0x0020) /* Circular mode */ -#define DMA_CFGR2_PINC ((uint16_t)0x0040) /* Peripheral increment mode */ -#define DMA_CFGR2_MINC ((uint16_t)0x0080) /* Memory increment mode */ - -#define DMA_CFGR2_PSIZE ((uint16_t)0x0300) /* PSIZE[1:0] bits (Peripheral size) */ -#define DMA_CFGR2_PSIZE_0 ((uint16_t)0x0100) /* Bit 0 */ -#define DMA_CFGR2_PSIZE_1 ((uint16_t)0x0200) /* Bit 1 */ - -#define DMA_CFGR2_MSIZE ((uint16_t)0x0C00) /* MSIZE[1:0] bits (Memory size) */ -#define DMA_CFGR2_MSIZE_0 ((uint16_t)0x0400) /* Bit 0 */ -#define DMA_CFGR2_MSIZE_1 ((uint16_t)0x0800) /* Bit 1 */ - -#define DMA_CFGR2_PL ((uint16_t)0x3000) /* PL[1:0] bits (Channel Priority level) */ -#define DMA_CFGR2_PL_0 ((uint16_t)0x1000) /* Bit 0 */ -#define DMA_CFGR2_PL_1 ((uint16_t)0x2000) /* Bit 1 */ - -#define DMA_CFGR2_MEM2MEM ((uint16_t)0x4000) /* Memory to memory mode */ - -/******************* Bit definition for DMA_CFGR3 register *******************/ -#define DMA_CFGR3_EN ((uint16_t)0x0001) /* Channel enable */ -#define DMA_CFGR3_TCIE ((uint16_t)0x0002) /* Transfer complete interrupt enable */ -#define DMA_CFGR3_HTIE ((uint16_t)0x0004) /* Half Transfer interrupt enable */ -#define DMA_CFGR3_TEIE ((uint16_t)0x0008) /* Transfer error interrupt enable */ -#define DMA_CFGR3_DIR ((uint16_t)0x0010) /* Data transfer direction */ -#define DMA_CFGR3_CIRC ((uint16_t)0x0020) /* Circular mode */ -#define DMA_CFGR3_PINC ((uint16_t)0x0040) /* Peripheral increment mode */ -#define DMA_CFGR3_MINC ((uint16_t)0x0080) /* Memory increment mode */ - -#define DMA_CFGR3_PSIZE ((uint16_t)0x0300) /* PSIZE[1:0] bits (Peripheral size) */ -#define DMA_CFGR3_PSIZE_0 ((uint16_t)0x0100) /* Bit 0 */ -#define DMA_CFGR3_PSIZE_1 ((uint16_t)0x0200) /* Bit 1 */ - -#define DMA_CFGR3_MSIZE ((uint16_t)0x0C00) /* MSIZE[1:0] bits (Memory size) */ -#define DMA_CFGR3_MSIZE_0 ((uint16_t)0x0400) /* Bit 0 */ -#define DMA_CFGR3_MSIZE_1 ((uint16_t)0x0800) /* Bit 1 */ - -#define DMA_CFGR3_PL ((uint16_t)0x3000) /* PL[1:0] bits (Channel Priority level) */ -#define DMA_CFGR3_PL_0 ((uint16_t)0x1000) /* Bit 0 */ -#define DMA_CFGR3_PL_1 ((uint16_t)0x2000) /* Bit 1 */ - -#define DMA_CFGR3_MEM2MEM ((uint16_t)0x4000) /* Memory to memory mode */ - -/******************* Bit definition for DMA_CFGR4 register *******************/ -#define DMA_CFGR4_EN ((uint16_t)0x0001) /* Channel enable */ -#define DMA_CFGR4_TCIE ((uint16_t)0x0002) /* Transfer complete interrupt enable */ -#define DMA_CFGR4_HTIE ((uint16_t)0x0004) /* Half Transfer interrupt enable */ -#define DMA_CFGR4_TEIE ((uint16_t)0x0008) /* Transfer error interrupt enable */ -#define DMA_CFGR4_DIR ((uint16_t)0x0010) /* Data transfer direction */ -#define DMA_CFGR4_CIRC ((uint16_t)0x0020) /* Circular mode */ -#define DMA_CFGR4_PINC ((uint16_t)0x0040) /* Peripheral increment mode */ -#define DMA_CFGR4_MINC ((uint16_t)0x0080) /* Memory increment mode */ - -#define DMA_CFGR4_PSIZE ((uint16_t)0x0300) /* PSIZE[1:0] bits (Peripheral size) */ -#define DMA_CFGR4_PSIZE_0 ((uint16_t)0x0100) /* Bit 0 */ -#define DMA_CFGR4_PSIZE_1 ((uint16_t)0x0200) /* Bit 1 */ - -#define DMA_CFGR4_MSIZE ((uint16_t)0x0C00) /* MSIZE[1:0] bits (Memory size) */ -#define DMA_CFGR4_MSIZE_0 ((uint16_t)0x0400) /* Bit 0 */ -#define DMA_CFGR4_MSIZE_1 ((uint16_t)0x0800) /* Bit 1 */ - -#define DMA_CFGR4_PL ((uint16_t)0x3000) /* PL[1:0] bits (Channel Priority level) */ -#define DMA_CFGR4_PL_0 ((uint16_t)0x1000) /* Bit 0 */ -#define DMA_CFGR4_PL_1 ((uint16_t)0x2000) /* Bit 1 */ - -#define DMA_CFGR4_MEM2MEM ((uint16_t)0x4000) /* Memory to memory mode */ - -/****************** Bit definition for DMA_CFGR5 register *******************/ -#define DMA_CFGR5_EN ((uint16_t)0x0001) /* Channel enable */ -#define DMA_CFGR5_TCIE ((uint16_t)0x0002) /* Transfer complete interrupt enable */ -#define DMA_CFGR5_HTIE ((uint16_t)0x0004) /* Half Transfer interrupt enable */ -#define DMA_CFGR5_TEIE ((uint16_t)0x0008) /* Transfer error interrupt enable */ -#define DMA_CFGR5_DIR ((uint16_t)0x0010) /* Data transfer direction */ -#define DMA_CFGR5_CIRC ((uint16_t)0x0020) /* Circular mode */ -#define DMA_CFGR5_PINC ((uint16_t)0x0040) /* Peripheral increment mode */ -#define DMA_CFGR5_MINC ((uint16_t)0x0080) /* Memory increment mode */ - -#define DMA_CFGR5_PSIZE ((uint16_t)0x0300) /* PSIZE[1:0] bits (Peripheral size) */ -#define DMA_CFGR5_PSIZE_0 ((uint16_t)0x0100) /* Bit 0 */ -#define DMA_CFGR5_PSIZE_1 ((uint16_t)0x0200) /* Bit 1 */ - -#define DMA_CFGR5_MSIZE ((uint16_t)0x0C00) /* MSIZE[1:0] bits (Memory size) */ -#define DMA_CFGR5_MSIZE_0 ((uint16_t)0x0400) /* Bit 0 */ -#define DMA_CFGR5_MSIZE_1 ((uint16_t)0x0800) /* Bit 1 */ - -#define DMA_CFGR5_PL ((uint16_t)0x3000) /* PL[1:0] bits (Channel Priority level) */ -#define DMA_CFGR5_PL_0 ((uint16_t)0x1000) /* Bit 0 */ -#define DMA_CFGR5_PL_1 ((uint16_t)0x2000) /* Bit 1 */ - -#define DMA_CFGR5_MEM2MEM ((uint16_t)0x4000) /* Memory to memory mode enable */ - -/******************* Bit definition for DMA_CFGR6 register *******************/ -#define DMA_CFGR6_EN ((uint16_t)0x0001) /* Channel enable */ -#define DMA_CFGR6_TCIE ((uint16_t)0x0002) /* Transfer complete interrupt enable */ -#define DMA_CFGR6_HTIE ((uint16_t)0x0004) /* Half Transfer interrupt enable */ -#define DMA_CFGR6_TEIE ((uint16_t)0x0008) /* Transfer error interrupt enable */ -#define DMA_CFGR6_DIR ((uint16_t)0x0010) /* Data transfer direction */ -#define DMA_CFGR6_CIRC ((uint16_t)0x0020) /* Circular mode */ -#define DMA_CFGR6_PINC ((uint16_t)0x0040) /* Peripheral increment mode */ -#define DMA_CFGR6_MINC ((uint16_t)0x0080) /* Memory increment mode */ - -#define DMA_CFGR6_PSIZE ((uint16_t)0x0300) /* PSIZE[1:0] bits (Peripheral size) */ -#define DMA_CFGR6_PSIZE_0 ((uint16_t)0x0100) /* Bit 0 */ -#define DMA_CFGR6_PSIZE_1 ((uint16_t)0x0200) /* Bit 1 */ - -#define DMA_CFGR6_MSIZE ((uint16_t)0x0C00) /* MSIZE[1:0] bits (Memory size) */ -#define DMA_CFGR6_MSIZE_0 ((uint16_t)0x0400) /* Bit 0 */ -#define DMA_CFGR6_MSIZE_1 ((uint16_t)0x0800) /* Bit 1 */ - -#define DMA_CFGR6_PL ((uint16_t)0x3000) /* PL[1:0] bits (Channel Priority level) */ -#define DMA_CFGR6_PL_0 ((uint16_t)0x1000) /* Bit 0 */ -#define DMA_CFGR6_PL_1 ((uint16_t)0x2000) /* Bit 1 */ - -#define DMA_CFGR6_MEM2MEM ((uint16_t)0x4000) /* Memory to memory mode */ - -/******************* Bit definition for DMA_CFGR7 register *******************/ -#define DMA_CFGR7_EN ((uint16_t)0x0001) /* Channel enable */ -#define DMA_CFGR7_TCIE ((uint16_t)0x0002) /* Transfer complete interrupt enable */ -#define DMA_CFGR7_HTIE ((uint16_t)0x0004) /* Half Transfer interrupt enable */ -#define DMA_CFGR7_TEIE ((uint16_t)0x0008) /* Transfer error interrupt enable */ -#define DMA_CFGR7_DIR ((uint16_t)0x0010) /* Data transfer direction */ -#define DMA_CFGR7_CIRC ((uint16_t)0x0020) /* Circular mode */ -#define DMA_CFGR7_PINC ((uint16_t)0x0040) /* Peripheral increment mode */ -#define DMA_CFGR7_MINC ((uint16_t)0x0080) /* Memory increment mode */ - -#define DMA_CFGR7_PSIZE ((uint16_t)0x0300) /* PSIZE[1:0] bits (Peripheral size) */ -#define DMA_CFGR7_PSIZE_0 ((uint16_t)0x0100) /* Bit 0 */ -#define DMA_CFGR7_PSIZE_1 ((uint16_t)0x0200) /* Bit 1 */ - -#define DMA_CFGR7_MSIZE ((uint16_t)0x0C00) /* MSIZE[1:0] bits (Memory size) */ -#define DMA_CFGR7_MSIZE_0 ((uint16_t)0x0400) /* Bit 0 */ -#define DMA_CFGR7_MSIZE_1 ((uint16_t)0x0800) /* Bit 1 */ - -#define DMA_CFGR7_PL ((uint16_t)0x3000) /* PL[1:0] bits (Channel Priority level) */ -#define DMA_CFGR7_PL_0 ((uint16_t)0x1000) /* Bit 0 */ -#define DMA_CFGR7_PL_1 ((uint16_t)0x2000) /* Bit 1 */ - -#define DMA_CFGR7_MEM2MEM ((uint16_t)0x4000) /* Memory to memory mode enable */ - -/******************* Bit definition for DMA_CFG8 register *******************/ -#define DMA_CFG8_EN ((uint16_t)0x0001) /* Channel enable */ -#define DMA_CFG8_TCIE ((uint16_t)0x0002) /* Transfer complete interrupt enable */ -#define DMA_CFG8_HTIE ((uint16_t)0x0004) /* Half Transfer interrupt enable */ -#define DMA_CFG8_TEIE ((uint16_t)0x0008) /* Transfer error interrupt enable */ -#define DMA_CFG8_DIR ((uint16_t)0x0010) /* Data transfer direction */ -#define DMA_CFG8_CIRC ((uint16_t)0x0020) /* Circular mode */ -#define DMA_CFG8_PINC ((uint16_t)0x0040) /* Peripheral increment mode */ -#define DMA_CFG8_MINC ((uint16_t)0x0080) /* Memory increment mode */ - -#define DMA_CFG8_PSIZE ((uint16_t)0x0300) /* PSIZE[1:0] bits (Peripheral size) */ -#define DMA_CFG8_PSIZE_0 ((uint16_t)0x0100) /* Bit 0 */ -#define DMA_CFG8_PSIZE_1 ((uint16_t)0x0200) /* Bit 1 */ - -#define DMA_CFG8_MSIZE ((uint16_t)0x0C00) /* MSIZE[1:0] bits (Memory size) */ -#define DMA_CFG8_MSIZE_0 ((uint16_t)0x0400) /* Bit 0 */ -#define DMA_CFG8_MSIZE_1 ((uint16_t)0x0800) /* Bit 1 */ - -#define DMA_CFG8_PL ((uint16_t)0x3000) /* PL[1:0] bits (Channel Priority level) */ -#define DMA_CFG8_PL_0 ((uint16_t)0x1000) /* Bit 0 */ -#define DMA_CFG8_PL_1 ((uint16_t)0x2000) /* Bit 1 */ - -#define DMA_CFG8_MEM2MEM ((uint16_t)0x4000) /* Memory to memory mode enable */ - -/****************** Bit definition for DMA_CNTR1 register ******************/ -#define DMA_CNTR1_NDT ((uint16_t)0xFFFF) /* Number of data to Transfer */ - -/****************** Bit definition for DMA_CNTR2 register ******************/ -#define DMA_CNTR2_NDT ((uint16_t)0xFFFF) /* Number of data to Transfer */ - -/****************** Bit definition for DMA_CNTR3 register ******************/ -#define DMA_CNTR3_NDT ((uint16_t)0xFFFF) /* Number of data to Transfer */ - -/****************** Bit definition for DMA_CNTR4 register ******************/ -#define DMA_CNTR4_NDT ((uint16_t)0xFFFF) /* Number of data to Transfer */ - -/****************** Bit definition for DMA_CNTR5 register ******************/ -#define DMA_CNTR5_NDT ((uint16_t)0xFFFF) /* Number of data to Transfer */ - -/****************** Bit definition for DMA_CNTR6 register ******************/ -#define DMA_CNTR6_NDT ((uint16_t)0xFFFF) /* Number of data to Transfer */ - -/****************** Bit definition for DMA_CNTR7 register ******************/ -#define DMA_CNTR7_NDT ((uint16_t)0xFFFF) /* Number of data to Transfer */ - -/****************** Bit definition for DMA_CNTR8 register ******************/ -#define DMA_CNTR8_NDT ((uint16_t)0xFFFF) /* Number of data to Transfer */ - -/****************** Bit definition for DMA_PADDR1 register *******************/ -#define DMA_PADDR1_PA ((uint32_t)0xFFFFFFFF) /* Peripheral Address */ - -/****************** Bit definition for DMA_PADDR2 register *******************/ -#define DMA_PADDR2_PA ((uint32_t)0xFFFFFFFF) /* Peripheral Address */ - -/****************** Bit definition for DMA_PADDR3 register *******************/ -#define DMA_PADDR3_PA ((uint32_t)0xFFFFFFFF) /* Peripheral Address */ - -/****************** Bit definition for DMA_PADDR4 register *******************/ -#define DMA_PADDR4_PA ((uint32_t)0xFFFFFFFF) /* Peripheral Address */ - -/****************** Bit definition for DMA_PADDR5 register *******************/ -#define DMA_PADDR5_PA ((uint32_t)0xFFFFFFFF) /* Peripheral Address */ - -/****************** Bit definition for DMA_PADDR6 register *******************/ -#define DMA_PADDR6_PA ((uint32_t)0xFFFFFFFF) /* Peripheral Address */ - -/****************** Bit definition for DMA_PADDR7 register *******************/ -#define DMA_PADDR7_PA ((uint32_t)0xFFFFFFFF) /* Peripheral Address */ - -/****************** Bit definition for DMA_PADDR8 register *******************/ -#define DMA_PADDR8_PA ((uint32_t)0xFFFFFFFF) /* Peripheral Address */ - -/****************** Bit definition for DMA_MADDR1 register *******************/ -#define DMA_MADDR1_MA ((uint32_t)0xFFFFFFFF) /* Memory Address */ - -/****************** Bit definition for DMA_MADDR2 register *******************/ -#define DMA_MADDR2_MA ((uint32_t)0xFFFFFFFF) /* Memory Address */ - -/****************** Bit definition for DMA_MADDR3 register *******************/ -#define DMA_MADDR3_MA ((uint32_t)0xFFFFFFFF) /* Memory Address */ - -/****************** Bit definition for DMA_MADDR4 register *******************/ -#define DMA_MADDR4_MA ((uint32_t)0xFFFFFFFF) /* Memory Address */ - -/****************** Bit definition for DMA_MADDR5 register *******************/ -#define DMA_MADDR5_MA ((uint32_t)0xFFFFFFFF) /* Memory Address */ - -/****************** Bit definition for DMA_MADDR6 register *******************/ -#define DMA_MADDR6_MA ((uint32_t)0xFFFFFFFF) /* Memory Address */ - -/****************** Bit definition for DMA_MADDR7 register *******************/ -#define DMA_MADDR7_MA ((uint32_t)0xFFFFFFFF) /* Memory Address */ - -/****************** Bit definition for DMA_MADDR8 register *******************/ -#define DMA_MADDR8_MA ((uint32_t)0xFFFFFFFF) /* Memory Address */ - -/******************************************************************************/ -/* External Interrupt/Event Controller */ -/******************************************************************************/ - -/******************* Bit definition for EXTI_INTENR register *******************/ -#define EXTI_INTENR_MR0 ((uint32_t)0x00000001) /* Interrupt Mask on line 0 */ -#define EXTI_INTENR_MR1 ((uint32_t)0x00000002) /* Interrupt Mask on line 1 */ -#define EXTI_INTENR_MR2 ((uint32_t)0x00000004) /* Interrupt Mask on line 2 */ -#define EXTI_INTENR_MR3 ((uint32_t)0x00000008) /* Interrupt Mask on line 3 */ -#define EXTI_INTENR_MR4 ((uint32_t)0x00000010) /* Interrupt Mask on line 4 */ -#define EXTI_INTENR_MR5 ((uint32_t)0x00000020) /* Interrupt Mask on line 5 */ -#define EXTI_INTENR_MR6 ((uint32_t)0x00000040) /* Interrupt Mask on line 6 */ -#define EXTI_INTENR_MR7 ((uint32_t)0x00000080) /* Interrupt Mask on line 7 */ -#define EXTI_INTENR_MR8 ((uint32_t)0x00000100) /* Interrupt Mask on line 8 */ -#define EXTI_INTENR_MR9 ((uint32_t)0x00000200) /* Interrupt Mask on line 9 */ -#define EXTI_INTENR_MR10 ((uint32_t)0x00000400) /* Interrupt Mask on line 10 */ -#define EXTI_INTENR_MR11 ((uint32_t)0x00000800) /* Interrupt Mask on line 11 */ -#define EXTI_INTENR_MR12 ((uint32_t)0x00001000) /* Interrupt Mask on line 12 */ -#define EXTI_INTENR_MR13 ((uint32_t)0x00002000) /* Interrupt Mask on line 13 */ -#define EXTI_INTENR_MR14 ((uint32_t)0x00004000) /* Interrupt Mask on line 14 */ -#define EXTI_INTENR_MR15 ((uint32_t)0x00008000) /* Interrupt Mask on line 15 */ -#define EXTI_INTENR_MR16 ((uint32_t)0x00010000) /* Interrupt Mask on line 16 */ -#define EXTI_INTENR_MR17 ((uint32_t)0x00020000) /* Interrupt Mask on line 17 */ -#define EXTI_INTENR_MR18 ((uint32_t)0x00040000) /* Interrupt Mask on line 18 */ -#define EXTI_INTENR_MR19 ((uint32_t)0x00080000) /* Interrupt Mask on line 19 */ -#define EXTI_INTENR_MR20 ((uint32_t)0x00100000) /* Interrupt Mask on line 20 */ -#define EXTI_INTENR_MR21 ((uint32_t)0x00200000) /* Interrupt Mask on line 21 */ -#define EXTI_INTENR_MR22 ((uint32_t)0x00400000) /* Interrupt Mask on line 22 */ -#define EXTI_INTENR_MR23 ((uint32_t)0x00800000) /* Interrupt Mask on line 23 */ -#define EXTI_INTENR_MR24 ((uint32_t)0x01000000) /* Interrupt Mask on line 24 */ -#define EXTI_INTENR_MR25 ((uint32_t)0x02000000) /* Interrupt Mask on line 25 */ -#define EXTI_INTENR_MR26 ((uint32_t)0x04000000) /* Interrupt Mask on line 26 */ -#define EXTI_INTENR_MR27 ((uint32_t)0x08000000) /* Interrupt Mask on line 27 */ -#define EXTI_INTENR_MR28 ((uint32_t)0x10000000) /* Interrupt Mask on line 28 */ -#define EXTI_INTENR_MR29 ((uint32_t)0x20000000) /* Interrupt Mask on line 29 */ - -/******************* Bit definition for EXTI_EVENR register *******************/ -#define EXTI_EVENR_MR0 ((uint32_t)0x00000001) /* Event Mask on line 0 */ -#define EXTI_EVENR_MR1 ((uint32_t)0x00000002) /* Event Mask on line 1 */ -#define EXTI_EVENR_MR2 ((uint32_t)0x00000004) /* Event Mask on line 2 */ -#define EXTI_EVENR_MR3 ((uint32_t)0x00000008) /* Event Mask on line 3 */ -#define EXTI_EVENR_MR4 ((uint32_t)0x00000010) /* Event Mask on line 4 */ -#define EXTI_EVENR_MR5 ((uint32_t)0x00000020) /* Event Mask on line 5 */ -#define EXTI_EVENR_MR6 ((uint32_t)0x00000040) /* Event Mask on line 6 */ -#define EXTI_EVENR_MR7 ((uint32_t)0x00000080) /* Event Mask on line 7 */ -#define EXTI_EVENR_MR8 ((uint32_t)0x00000100) /* Event Mask on line 8 */ -#define EXTI_EVENR_MR9 ((uint32_t)0x00000200) /* Event Mask on line 9 */ -#define EXTI_EVENR_MR10 ((uint32_t)0x00000400) /* Event Mask on line 10 */ -#define EXTI_EVENR_MR11 ((uint32_t)0x00000800) /* Event Mask on line 11 */ -#define EXTI_EVENR_MR12 ((uint32_t)0x00001000) /* Event Mask on line 12 */ -#define EXTI_EVENR_MR13 ((uint32_t)0x00002000) /* Event Mask on line 13 */ -#define EXTI_EVENR_MR14 ((uint32_t)0x00004000) /* Event Mask on line 14 */ -#define EXTI_EVENR_MR15 ((uint32_t)0x00008000) /* Event Mask on line 15 */ -#define EXTI_EVENR_MR16 ((uint32_t)0x00010000) /* Event Mask on line 16 */ -#define EXTI_EVENR_MR17 ((uint32_t)0x00020000) /* Event Mask on line 17 */ -#define EXTI_EVENR_MR18 ((uint32_t)0x00040000) /* Event Mask on line 18 */ -#define EXTI_EVENR_MR19 ((uint32_t)0x00080000) /* Event Mask on line 19 */ -#define EXTI_EVENR_MR20 ((uint32_t)0x00100000) /* Event Mask on line 20 */ -#define EXTI_EVENR_MR21 ((uint32_t)0x00200000) /* Event Mask on line 21 */ -#define EXTI_EVENR_MR22 ((uint32_t)0x00400000) /* Event Mask on line 22 */ -#define EXTI_EVENR_MR23 ((uint32_t)0x00800000) /* Event Mask on line 23 */ -#define EXTI_EVENR_MR24 ((uint32_t)0x01000000) /* Event Mask on line 24 */ -#define EXTI_EVENR_MR25 ((uint32_t)0x02000000) /* Event Mask on line 25 */ -#define EXTI_EVENR_MR26 ((uint32_t)0x04000000) /* Event Mask on line 26 */ -#define EXTI_EVENR_MR27 ((uint32_t)0x08000000) /* Event Mask on line 27 */ -#define EXTI_EVENR_MR28 ((uint32_t)0x10000000) /* Event Mask on line 28 */ -#define EXTI_EVENR_MR29 ((uint32_t)0x20000000) /* Event Mask on line 29 */ - -/****************** Bit definition for EXTI_RTENR register *******************/ -#define EXTI_RTENR_TR0 ((uint32_t)0x00000001) /* Rising trigger event configuration bit of line 0 */ -#define EXTI_RTENR_TR1 ((uint32_t)0x00000002) /* Rising trigger event configuration bit of line 1 */ -#define EXTI_RTENR_TR2 ((uint32_t)0x00000004) /* Rising trigger event configuration bit of line 2 */ -#define EXTI_RTENR_TR3 ((uint32_t)0x00000008) /* Rising trigger event configuration bit of line 3 */ -#define EXTI_RTENR_TR4 ((uint32_t)0x00000010) /* Rising trigger event configuration bit of line 4 */ -#define EXTI_RTENR_TR5 ((uint32_t)0x00000020) /* Rising trigger event configuration bit of line 5 */ -#define EXTI_RTENR_TR6 ((uint32_t)0x00000040) /* Rising trigger event configuration bit of line 6 */ -#define EXTI_RTENR_TR7 ((uint32_t)0x00000080) /* Rising trigger event configuration bit of line 7 */ -#define EXTI_RTENR_TR8 ((uint32_t)0x00000100) /* Rising trigger event configuration bit of line 8 */ -#define EXTI_RTENR_TR9 ((uint32_t)0x00000200) /* Rising trigger event configuration bit of line 9 */ -#define EXTI_RTENR_TR10 ((uint32_t)0x00000400) /* Rising trigger event configuration bit of line 10 */ -#define EXTI_RTENR_TR11 ((uint32_t)0x00000800) /* Rising trigger event configuration bit of line 11 */ -#define EXTI_RTENR_TR12 ((uint32_t)0x00001000) /* Rising trigger event configuration bit of line 12 */ -#define EXTI_RTENR_TR13 ((uint32_t)0x00002000) /* Rising trigger event configuration bit of line 13 */ -#define EXTI_RTENR_TR14 ((uint32_t)0x00004000) /* Rising trigger event configuration bit of line 14 */ -#define EXTI_RTENR_TR15 ((uint32_t)0x00008000) /* Rising trigger event configuration bit of line 15 */ -#define EXTI_RTENR_TR16 ((uint32_t)0x00010000) /* Rising trigger event configuration bit of line 16 */ -#define EXTI_RTENR_TR17 ((uint32_t)0x00020000) /* Rising trigger event configuration bit of line 17 */ -#define EXTI_RTENR_TR18 ((uint32_t)0x00040000) /* Rising trigger event configuration bit of line 18 */ -#define EXTI_RTENR_TR19 ((uint32_t)0x00080000) /* Rising trigger event configuration bit of line 19 */ -#define EXTI_RTENR_TR20 ((uint32_t)0x00100000) /* Rising trigger event configuration bit of line 20 */ -#define EXTI_RTENR_TR21 ((uint32_t)0x00200000) /* Rising trigger event configuration bit of line 21 */ -#define EXTI_RTENR_TR22 ((uint32_t)0x00400000) /* Rising trigger event configuration bit of line 22 */ -#define EXTI_RTENR_TR23 ((uint32_t)0x00800000) /* Rising trigger event configuration bit of line 23 */ -#define EXTI_RTENR_TR24 ((uint32_t)0x01000000) /* Rising trigger event configuration bit of line 24 */ -#define EXTI_RTENR_TR25 ((uint32_t)0x02000000) /* Rising trigger event configuration bit of line 25 */ -#define EXTI_RTENR_TR26 ((uint32_t)0x04000000) /* Rising trigger event configuration bit of line 26 */ -#define EXTI_RTENR_TR27 ((uint32_t)0x08000000) /* Rising trigger event configuration bit of line 27 */ -#define EXTI_RTENR_TR28 ((uint32_t)0x10000000) /* Rising trigger event configuration bit of line 28 */ -#define EXTI_RTENR_TR29 ((uint32_t)0x20000000) /* Rising trigger event configuration bit of line 29 */ - -/****************** Bit definition for EXTI_FTENR register *******************/ -#define EXTI_FTENR_TR0 ((uint32_t)0x00000001) /* Falling trigger event configuration bit of line 0 */ -#define EXTI_FTENR_TR1 ((uint32_t)0x00000002) /* Falling trigger event configuration bit of line 1 */ -#define EXTI_FTENR_TR2 ((uint32_t)0x00000004) /* Falling trigger event configuration bit of line 2 */ -#define EXTI_FTENR_TR3 ((uint32_t)0x00000008) /* Falling trigger event configuration bit of line 3 */ -#define EXTI_FTENR_TR4 ((uint32_t)0x00000010) /* Falling trigger event configuration bit of line 4 */ -#define EXTI_FTENR_TR5 ((uint32_t)0x00000020) /* Falling trigger event configuration bit of line 5 */ -#define EXTI_FTENR_TR6 ((uint32_t)0x00000040) /* Falling trigger event configuration bit of line 6 */ -#define EXTI_FTENR_TR7 ((uint32_t)0x00000080) /* Falling trigger event configuration bit of line 7 */ -#define EXTI_FTENR_TR8 ((uint32_t)0x00000100) /* Falling trigger event configuration bit of line 8 */ -#define EXTI_FTENR_TR9 ((uint32_t)0x00000200) /* Falling trigger event configuration bit of line 9 */ -#define EXTI_FTENR_TR10 ((uint32_t)0x00000400) /* Falling trigger event configuration bit of line 10 */ -#define EXTI_FTENR_TR11 ((uint32_t)0x00000800) /* Falling trigger event configuration bit of line 11 */ -#define EXTI_FTENR_TR12 ((uint32_t)0x00001000) /* Falling trigger event configuration bit of line 12 */ -#define EXTI_FTENR_TR13 ((uint32_t)0x00002000) /* Falling trigger event configuration bit of line 13 */ -#define EXTI_FTENR_TR14 ((uint32_t)0x00004000) /* Falling trigger event configuration bit of line 14 */ -#define EXTI_FTENR_TR15 ((uint32_t)0x00008000) /* Falling trigger event configuration bit of line 15 */ -#define EXTI_FTENR_TR16 ((uint32_t)0x00010000) /* Falling trigger event configuration bit of line 16 */ -#define EXTI_FTENR_TR17 ((uint32_t)0x00020000) /* Falling trigger event configuration bit of line 17 */ -#define EXTI_FTENR_TR18 ((uint32_t)0x00040000) /* Falling trigger event configuration bit of line 18 */ -#define EXTI_FTENR_TR19 ((uint32_t)0x00080000) /* Falling trigger event configuration bit of line 19 */ -#define EXTI_FTENR_TR20 ((uint32_t)0x00100000) /* Falling trigger event configuration bit of line 20 */ -#define EXTI_FTENR_TR21 ((uint32_t)0x00200000) /* Falling trigger event configuration bit of line 21 */ -#define EXTI_FTENR_TR22 ((uint32_t)0x00400000) /* Falling trigger event configuration bit of line 22 */ -#define EXTI_FTENR_TR23 ((uint32_t)0x00800000) /* Falling trigger event configuration bit of line 23 */ -#define EXTI_FTENR_TR24 ((uint32_t)0x01000000) /* Falling trigger event configuration bit of line 24 */ -#define EXTI_FTENR_TR25 ((uint32_t)0x02000000) /* Falling trigger event configuration bit of line 25 */ -#define EXTI_FTENR_TR26 ((uint32_t)0x04000000) /* Falling trigger event configuration bit of line 26 */ -#define EXTI_FTENR_TR27 ((uint32_t)0x08000000) /* Falling trigger event configuration bit of line 27 */ -#define EXTI_FTENR_TR28 ((uint32_t)0x10000000) /* Falling trigger event configuration bit of line 28 */ -#define EXTI_FTENR_TR29 ((uint32_t)0x20000000) /* Falling trigger event configuration bit of line 29 */ - -/****************** Bit definition for EXTI_SWIEVR register ******************/ -#define EXTI_SWIEVR_SWIEVR0 ((uint32_t)0x00000001) /* Software Interrupt on line 0 */ -#define EXTI_SWIEVR_SWIEVR1 ((uint32_t)0x00000002) /* Software Interrupt on line 1 */ -#define EXTI_SWIEVR_SWIEVR2 ((uint32_t)0x00000004) /* Software Interrupt on line 2 */ -#define EXTI_SWIEVR_SWIEVR3 ((uint32_t)0x00000008) /* Software Interrupt on line 3 */ -#define EXTI_SWIEVR_SWIEVR4 ((uint32_t)0x00000010) /* Software Interrupt on line 4 */ -#define EXTI_SWIEVR_SWIEVR5 ((uint32_t)0x00000020) /* Software Interrupt on line 5 */ -#define EXTI_SWIEVR_SWIEVR6 ((uint32_t)0x00000040) /* Software Interrupt on line 6 */ -#define EXTI_SWIEVR_SWIEVR7 ((uint32_t)0x00000080) /* Software Interrupt on line 7 */ -#define EXTI_SWIEVR_SWIEVR8 ((uint32_t)0x00000100) /* Software Interrupt on line 8 */ -#define EXTI_SWIEVR_SWIEVR9 ((uint32_t)0x00000200) /* Software Interrupt on line 9 */ -#define EXTI_SWIEVR_SWIEVR10 ((uint32_t)0x00000400) /* Software Interrupt on line 10 */ -#define EXTI_SWIEVR_SWIEVR11 ((uint32_t)0x00000800) /* Software Interrupt on line 11 */ -#define EXTI_SWIEVR_SWIEVR12 ((uint32_t)0x00001000) /* Software Interrupt on line 12 */ -#define EXTI_SWIEVR_SWIEVR13 ((uint32_t)0x00002000) /* Software Interrupt on line 13 */ -#define EXTI_SWIEVR_SWIEVR14 ((uint32_t)0x00004000) /* Software Interrupt on line 14 */ -#define EXTI_SWIEVR_SWIEVR15 ((uint32_t)0x00008000) /* Software Interrupt on line 15 */ -#define EXTI_SWIEVR_SWIEVR16 ((uint32_t)0x00010000) /* Software Interrupt on line 16 */ -#define EXTI_SWIEVR_SWIEVR17 ((uint32_t)0x00020000) /* Software Interrupt on line 17 */ -#define EXTI_SWIEVR_SWIEVR18 ((uint32_t)0x00040000) /* Software Interrupt on line 18 */ -#define EXTI_SWIEVR_SWIEVR19 ((uint32_t)0x00080000) /* Software Interrupt on line 19 */ -#define EXTI_SWIEVR_SWIEVR20 ((uint32_t)0x00100000) /* Software Interrupt on line 20 */ -#define EXTI_SWIEVR_SWIEVR21 ((uint32_t)0x00200000) /* Software Interrupt on line 21 */ -#define EXTI_SWIEVR_SWIEVR22 ((uint32_t)0x00400000) /* Software Interrupt on line 22 */ -#define EXTI_SWIEVR_SWIEVR23 ((uint32_t)0x00800000) /* Software Interrupt on line 23 */ -#define EXTI_SWIEVR_SWIEVR24 ((uint32_t)0x01000000) /* Software Interrupt on line 24 */ -#define EXTI_SWIEVR_SWIEVR25 ((uint32_t)0x02000000) /* Software Interrupt on line 25 */ -#define EXTI_SWIEVR_SWIEVR26 ((uint32_t)0x04000000) /* Software Interrupt on line 26 */ -#define EXTI_SWIEVR_SWIEVR27 ((uint32_t)0x08000000) /* Software Interrupt on line 27 */ -#define EXTI_SWIEVR_SWIEVR28 ((uint32_t)0x10000000) /* Software Interrupt on line 28 */ -#define EXTI_SWIEVR_SWIEVR29 ((uint32_t)0x20000000) /* Software Interrupt on line 29 */ - -/******************* Bit definition for EXTI_INTFR register ********************/ -#define EXTI_INTF_INTF0 ((uint32_t)0x00000001) /* Pending bit for line 0 */ -#define EXTI_INTF_INTF1 ((uint32_t)0x00000002) /* Pending bit for line 1 */ -#define EXTI_INTF_INTF2 ((uint32_t)0x00000004) /* Pending bit for line 2 */ -#define EXTI_INTF_INTF3 ((uint32_t)0x00000008) /* Pending bit for line 3 */ -#define EXTI_INTF_INTF4 ((uint32_t)0x00000010) /* Pending bit for line 4 */ -#define EXTI_INTF_INTF5 ((uint32_t)0x00000020) /* Pending bit for line 5 */ -#define EXTI_INTF_INTF6 ((uint32_t)0x00000040) /* Pending bit for line 6 */ -#define EXTI_INTF_INTF7 ((uint32_t)0x00000080) /* Pending bit for line 7 */ -#define EXTI_INTF_INTF8 ((uint32_t)0x00000100) /* Pending bit for line 8 */ -#define EXTI_INTF_INTF9 ((uint32_t)0x00000200) /* Pending bit for line 9 */ -#define EXTI_INTF_INTF10 ((uint32_t)0x00000400) /* Pending bit for line 10 */ -#define EXTI_INTF_INTF11 ((uint32_t)0x00000800) /* Pending bit for line 11 */ -#define EXTI_INTF_INTF12 ((uint32_t)0x00001000) /* Pending bit for line 12 */ -#define EXTI_INTF_INTF13 ((uint32_t)0x00002000) /* Pending bit for line 13 */ -#define EXTI_INTF_INTF14 ((uint32_t)0x00004000) /* Pending bit for line 14 */ -#define EXTI_INTF_INTF15 ((uint32_t)0x00008000) /* Pending bit for line 15 */ -#define EXTI_INTF_INTF16 ((uint32_t)0x00010000) /* Pending bit for line 16 */ -#define EXTI_INTF_INTF17 ((uint32_t)0x00020000) /* Pending bit for line 17 */ -#define EXTI_INTF_INTF18 ((uint32_t)0x00040000) /* Pending bit for line 18 */ -#define EXTI_INTF_INTF19 ((uint32_t)0x00080000) /* Pending bit for line 19 */ -#define EXTI_INTF_INTF20 ((uint32_t)0x00100000) /* Pending bit for line 20 */ -#define EXTI_INTF_INTF21 ((uint32_t)0x00200000) /* Pending bit for line 21 */ -#define EXTI_INTF_INTF22 ((uint32_t)0x00400000) /* Pending bit for line 22 */ -#define EXTI_INTF_INTF23 ((uint32_t)0x00800000) /* Pending bit for line 23 */ -#define EXTI_INTF_INTF24 ((uint32_t)0x01000000) /* Pending bit for line 24 */ -#define EXTI_INTF_INTF25 ((uint32_t)0x02000000) /* Pending bit for line 25 */ -#define EXTI_INTF_INTF26 ((uint32_t)0x04000000) /* Pending bit for line 26 */ -#define EXTI_INTF_INTF27 ((uint32_t)0x08000000) /* Pending bit for line 27 */ -#define EXTI_INTF_INTF28 ((uint32_t)0x10000000) /* Pending bit for line 28 */ -#define EXTI_INTF_INTF29 ((uint32_t)0x20000000) /* Pending bit for line 29 */ - -/******************************************************************************/ -/* FLASH and Option Bytes Registers */ -/******************************************************************************/ - -/******************* Bit definition for FLASH_ACTLR register ******************/ -#define FLASH_ACTLR_LATENCY ((uint8_t)0x03) /* LATENCY[2:0] bits (Latency) */ -#define FLASH_ACTLR_LATENCY_0 ((uint8_t)0x00) /* Bit 0 */ -#define FLASH_ACTLR_LATENCY_1 ((uint8_t)0x01) /* Bit 0 */ -#define FLASH_ACTLR_LATENCY_2 ((uint8_t)0x02) /* Bit 1 */ - -/****************** Bit definition for FLASH_KEYR register ******************/ -#define FLASH_KEYR_FKEYR ((uint32_t)0xFFFFFFFF) /* FPEC Key */ - -/***************** Bit definition for FLASH_OBKEYR register ****************/ -#define FLASH_OBKEYR_OBKEYR ((uint32_t)0xFFFFFFFF) /* Option Byte Key */ - -/****************** Bit definition for FLASH_STATR register *******************/ -#define FLASH_STATR_BSY ((uint8_t)0x01) /* Busy */ -#define FLASH_STATR_WRPRTERR ((uint8_t)0x10) /* Write Protection Error */ -#define FLASH_STATR_EOP ((uint8_t)0x20) /* End of operation */ -#define FLASH_STATR_FWAKE_FLAG ((uint8_t)0x40) /* Flag of wake */ -#define FLASH_STATR_TURBO ((uint8_t)0x80) /* The state of TURBO Enable */ -#define FLASH_STATR_BOOT_AVA ((uint16_t)0x1000) /* The state of Init Config */ -#define FLASH_STATR_BOOT_STATUS ((uint16_t)0x2000) /* The source of Execute Program */ -#define FLASH_STATR_BOOT_MODE ((uint16_t)0x4000) /* The switch of user section or boot section*/ -#define FLASH_STATR_BOOT_LOCK ((uint16_t)0x8000) /* Lock boot area*/ - -/******************* Bit definition for FLASH_CTLR register *******************/ -#define FLASH_CTLR_PG (0x0001) /* Programming */ -#define FLASH_CTLR_PER (0x0002) /* Page Erase 1KByte*/ -#define FLASH_CTLR_MER (0x0004) /* Mass Erase */ -#define FLASH_CTLR_OPTPG (0x0010) /* Option Byte Programming */ -#define FLASH_CTLR_OPTER (0x0020) /* Option Byte Erase */ -#define FLASH_CTLR_STRT (0x0040) /* Start */ -#define FLASH_CTLR_LOCK (0x0080) /* Lock */ -#define FLASH_CTLR_OPTWRE (0x0200) /* Option Bytes Write Enable */ -#define FLASH_CTLR_ERRIE (0x0400) /* Error Interrupt Enable */ -#define FLASH_CTLR_EOPIE (0x1000) /* End of operation interrupt enable */ -#define FLASH_CTLR_FWAKEIE ((uint32_t)0x00002000) /* Wake inter Enable */ -#define FLASH_CTLR_FLOCK ((uint32_t)0x00008000) /* Fast Lock */ -#define FLASH_CTLR_FTPG ((uint32_t)0x00010000) /* Fast Program */ -#define FLASH_CTLR_FTER ((uint32_t)0x00020000) /* Fast Erase */ -#define FLASH_CTLR_BUFLOAD ((uint32_t)0x00040000) /* BUF Load */ -#define FLASH_CTLR_BUFRST ((uint32_t)0x00080000) /* BUF Reset */ -#define FLASH_CTLR_BER32 ((uint32_t)0x00800000) /* Block Erase 32K */ - -#define FLASH_CTLR_PAGE_PG FLASH_CTLR_FTPG /* Page Programming 64Byte */ -#define FLASH_CTLR_PAGE_ER FLASH_CTLR_FTER /* Page Erase 64Byte */ - -/******************* Bit definition for FLASH_ADDR register *******************/ -#define FLASH_ADDR_FAR ((uint32_t)0xFFFFFFFF) /* Flash Address */ - -/****************** Bit definition for FLASH_OBR register *******************/ -#define FLASH_OBR_OPTERR ((uint16_t)0x0001) /* Option Byte Error */ -#define FLASH_OBR_RDPRT ((uint16_t)0x0002) /* Read protection */ - -#define FLASH_OBR_USER ((uint16_t)0x03FC) /* User Option Bytes */ -#define FLASH_OBR_WDG_SW ((uint16_t)0x0004) /* WDG_SW */ -#define FLASH_OBR_nRST_STOP ((uint16_t)0x0008) /* nRST_STOP */ -#define FLASH_OBR_nRST_STDBY ((uint16_t)0x0010) /* nRST_STDBY */ -#define FLASH_OBR_RST_MODE ((uint16_t)0x0060) /* RST_MODE */ -#define FLASH_OBR_CFGRSTT FLASH_OBR_RST_MODE /* Config Reset delay time */ - -#define FLASH_OBR_FIX_11 ((uint16_t)0x0300) /* fix 11 */ -#define FLASH_OBR_DATA0 ((uint32_t)0x0003FC00) /* Data byte0 */ -#define FLASH_OBR_DATA1 ((uint32_t)0x03FC0000) /* Data byte1 */ - -/****************** Bit definition for FLASH_WPR register ******************/ -#define FLASH_WPR_WRP ((uint32_t)0xFFFFFFFF) /* Write Protect */ - -/****************** Bit definition for FLASH_MODEKEYR register ******************/ -#define FLASH_MODEKEYR_MODEKEYR ((uint32_t)0xFFFFFFFF) /* Open fast program /erase */ -#define FLASH_MODEKEYR_MODEKEYR1 ((uint32_t)0x45670123) -#define FLASH_MODEKEYR_MODEKEYR2 ((uint32_t)0xCDEF89AB) - -/****************** Bit definition for BOOT_MODEKEYP register ******************/ -#define BOOT_MODEKEYP_MODEKEYR ((uint32_t)0xFFFFFFFF) /* Open Boot section */ -#define BOOT_MODEKEYP_MODEKEYR1 ((uint32_t)0x45670123) -#define BOOT_MODEKEYP_MODEKEYR2 ((uint32_t)0xCDEF89AB) - -/****************** Bit definition for FLASH_RDPR register *******************/ -#define FLASH_RDPR_RDPR ((uint32_t)0x000000FF) /* Read protection option byte */ -#define FLASH_RDPR_nRDPR ((uint32_t)0x0000FF00) /* Read protection complemented option byte */ - -/****************** Bit definition for FLASH_USER register ******************/ -#define FLASH_USER_USER ((uint32_t)0x00FF0000) /* User option byte */ -#define FLASH_USER_nUSER ((uint32_t)0xFF000000) /* User complemented option byte */ - -/****************** Bit definition for FLASH_Data0 register *****************/ -#define FLASH_Data0_Data0 ((uint32_t)0x000000FF) /* User data storage option byte */ -#define FLASH_Data0_nData0 ((uint32_t)0x0000FF00) /* User data storage complemented option byte */ - -/****************** Bit definition for FLASH_Data1 register *****************/ -#define FLASH_Data1_Data1 ((uint32_t)0x00FF0000) /* User data storage option byte */ -#define FLASH_Data1_nData1 ((uint32_t)0xFF000000) /* User data storage complemented option byte */ - -/****************** Bit definition for FLASH_WRPR0 register ******************/ -#define FLASH_WRPR0_WRPR0 ((uint32_t)0x000000FF) /* Flash memory write protection option bytes */ -#define FLASH_WRPR0_nWRPR0 ((uint32_t)0x0000FF00) /* Flash memory write protection complemented option bytes */ - -/****************** Bit definition for FLASH_WRPR1 register ******************/ -#define FLASH_WRPR1_WRPR1 ((uint32_t)0x00FF0000) /* Flash memory write protection option bytes */ -#define FLASH_WRPR1_nWRPR1 ((uint32_t)0xFF000000) /* Flash memory write protection complemented option bytes */ - -/****************** Bit definition for FLASH_WRPR2 register ******************/ -#define FLASH_WRPR2_WRPR2 ((uint32_t)0x000000FF) /* Flash memory write protection option bytes */ -#define FLASH_WRPR2_nWRPR2 ((uint32_t)0x0000FF00) /* Flash memory write protection complemented option bytes */ - -/****************** Bit definition for FLASH_WRPR3 register ******************/ -#define FLASH_WRPR3_WRPR3 ((uint32_t)0x00FF0000) /* Flash memory write protection option bytes */ -#define FLASH_WRPR3_nWRPR3 ((uint32_t)0xFF000000) /* Flash memory write protection complemented option bytes */ - -/******************************************************************************/ -/* General Purpose and Alternate Function I/O */ -/******************************************************************************/ - -/******************* Bit definition for GPIO_CFGLR register *******************/ -#define GPIO_CFGLR_MODE ((uint32_t)0x33333333) /* Port x mode bits */ - -#define GPIO_CFGLR_MODE0 ((uint32_t)0x00000003) /* MODE0[1:0] bits (Port x mode bits, pin 0) */ -#define GPIO_CFGLR_MODE0_0 ((uint32_t)0x00000001) /* Bit 0 */ -#define GPIO_CFGLR_MODE0_1 ((uint32_t)0x00000002) /* Bit 1 */ - -#define GPIO_CFGLR_MODE1 ((uint32_t)0x00000030) /* MODE1[1:0] bits (Port x mode bits, pin 1) */ -#define GPIO_CFGLR_MODE1_0 ((uint32_t)0x00000010) /* Bit 0 */ -#define GPIO_CFGLR_MODE1_1 ((uint32_t)0x00000020) /* Bit 1 */ - -#define GPIO_CFGLR_MODE2 ((uint32_t)0x00000300) /* MODE2[1:0] bits (Port x mode bits, pin 2) */ -#define GPIO_CFGLR_MODE2_0 ((uint32_t)0x00000100) /* Bit 0 */ -#define GPIO_CFGLR_MODE2_1 ((uint32_t)0x00000200) /* Bit 1 */ - -#define GPIO_CFGLR_MODE3 ((uint32_t)0x00003000) /* MODE3[1:0] bits (Port x mode bits, pin 3) */ -#define GPIO_CFGLR_MODE3_0 ((uint32_t)0x00001000) /* Bit 0 */ -#define GPIO_CFGLR_MODE3_1 ((uint32_t)0x00002000) /* Bit 1 */ - -#define GPIO_CFGLR_MODE4 ((uint32_t)0x00030000) /* MODE4[1:0] bits (Port x mode bits, pin 4) */ -#define GPIO_CFGLR_MODE4_0 ((uint32_t)0x00010000) /* Bit 0 */ -#define GPIO_CFGLR_MODE4_1 ((uint32_t)0x00020000) /* Bit 1 */ - -#define GPIO_CFGLR_MODE5 ((uint32_t)0x00300000) /* MODE5[1:0] bits (Port x mode bits, pin 5) */ -#define GPIO_CFGLR_MODE5_0 ((uint32_t)0x00100000) /* Bit 0 */ -#define GPIO_CFGLR_MODE5_1 ((uint32_t)0x00200000) /* Bit 1 */ - -#define GPIO_CFGLR_MODE6 ((uint32_t)0x03000000) /* MODE6[1:0] bits (Port x mode bits, pin 6) */ -#define GPIO_CFGLR_MODE6_0 ((uint32_t)0x01000000) /* Bit 0 */ -#define GPIO_CFGLR_MODE6_1 ((uint32_t)0x02000000) /* Bit 1 */ - -#define GPIO_CFGLR_MODE7 ((uint32_t)0x30000000) /* MODE7[1:0] bits (Port x mode bits, pin 7) */ -#define GPIO_CFGLR_MODE7_0 ((uint32_t)0x10000000) /* Bit 0 */ -#define GPIO_CFGLR_MODE7_1 ((uint32_t)0x20000000) /* Bit 1 */ - -#define GPIO_CFGLR_CNF ((uint32_t)0xCCCCCCCC) /* Port x configuration bits */ - -#define GPIO_CFGLR_CNF0 ((uint32_t)0x0000000C) /* CNF0[1:0] bits (Port x configuration bits, pin 0) */ -#define GPIO_CFGLR_CNF0_0 ((uint32_t)0x00000004) /* Bit 0 */ -#define GPIO_CFGLR_CNF0_1 ((uint32_t)0x00000008) /* Bit 1 */ - -#define GPIO_CFGLR_CNF1 ((uint32_t)0x000000C0) /* CNF1[1:0] bits (Port x configuration bits, pin 1) */ -#define GPIO_CFGLR_CNF1_0 ((uint32_t)0x00000040) /* Bit 0 */ -#define GPIO_CFGLR_CNF1_1 ((uint32_t)0x00000080) /* Bit 1 */ - -#define GPIO_CFGLR_CNF2 ((uint32_t)0x00000C00) /* CNF2[1:0] bits (Port x configuration bits, pin 2) */ -#define GPIO_CFGLR_CNF2_0 ((uint32_t)0x00000400) /* Bit 0 */ -#define GPIO_CFGLR_CNF2_1 ((uint32_t)0x00000800) /* Bit 1 */ - -#define GPIO_CFGLR_CNF3 ((uint32_t)0x0000C000) /* CNF3[1:0] bits (Port x configuration bits, pin 3) */ -#define GPIO_CFGLR_CNF3_0 ((uint32_t)0x00004000) /* Bit 0 */ -#define GPIO_CFGLR_CNF3_1 ((uint32_t)0x00008000) /* Bit 1 */ - -#define GPIO_CFGLR_CNF4 ((uint32_t)0x000C0000) /* CNF4[1:0] bits (Port x configuration bits, pin 4) */ -#define GPIO_CFGLR_CNF4_0 ((uint32_t)0x00040000) /* Bit 0 */ -#define GPIO_CFGLR_CNF4_1 ((uint32_t)0x00080000) /* Bit 1 */ - -#define GPIO_CFGLR_CNF5 ((uint32_t)0x00C00000) /* CNF5[1:0] bits (Port x configuration bits, pin 5) */ -#define GPIO_CFGLR_CNF5_0 ((uint32_t)0x00400000) /* Bit 0 */ -#define GPIO_CFGLR_CNF5_1 ((uint32_t)0x00800000) /* Bit 1 */ - -#define GPIO_CFGLR_CNF6 ((uint32_t)0x0C000000) /* CNF6[1:0] bits (Port x configuration bits, pin 6) */ -#define GPIO_CFGLR_CNF6_0 ((uint32_t)0x04000000) /* Bit 0 */ -#define GPIO_CFGLR_CNF6_1 ((uint32_t)0x08000000) /* Bit 1 */ - -#define GPIO_CFGLR_CNF7 ((uint32_t)0xC0000000) /* CNF7[1:0] bits (Port x configuration bits, pin 7) */ -#define GPIO_CFGLR_CNF7_0 ((uint32_t)0x40000000) /* Bit 0 */ -#define GPIO_CFGLR_CNF7_1 ((uint32_t)0x80000000) /* Bit 1 */ - -/******************* Bit definition for GPIO_CFGHR register *******************/ -#define GPIO_CFGHR_MODE ((uint32_t)0x33333333) /* Port x mode bits */ - -#define GPIO_CFGHR_MODE8 ((uint32_t)0x00000003) /* MODE8[1:0] bits (Port x mode bits, pin 8) */ -#define GPIO_CFGHR_MODE8_0 ((uint32_t)0x00000001) /* Bit 0 */ -#define GPIO_CFGHR_MODE8_1 ((uint32_t)0x00000002) /* Bit 1 */ - -#define GPIO_CFGHR_MODE9 ((uint32_t)0x00000030) /* MODE9[1:0] bits (Port x mode bits, pin 9) */ -#define GPIO_CFGHR_MODE9_0 ((uint32_t)0x00000010) /* Bit 0 */ -#define GPIO_CFGHR_MODE9_1 ((uint32_t)0x00000020) /* Bit 1 */ - -#define GPIO_CFGHR_MODE10 ((uint32_t)0x00000300) /* MODE10[1:0] bits (Port x mode bits, pin 10) */ -#define GPIO_CFGHR_MODE10_0 ((uint32_t)0x00000100) /* Bit 0 */ -#define GPIO_CFGHR_MODE10_1 ((uint32_t)0x00000200) /* Bit 1 */ - -#define GPIO_CFGHR_MODE11 ((uint32_t)0x00003000) /* MODE11[1:0] bits (Port x mode bits, pin 11) */ -#define GPIO_CFGHR_MODE11_0 ((uint32_t)0x00001000) /* Bit 0 */ -#define GPIO_CFGHR_MODE11_1 ((uint32_t)0x00002000) /* Bit 1 */ - -#define GPIO_CFGHR_MODE12 ((uint32_t)0x00030000) /* MODE12[1:0] bits (Port x mode bits, pin 12) */ -#define GPIO_CFGHR_MODE12_0 ((uint32_t)0x00010000) /* Bit 0 */ -#define GPIO_CFGHR_MODE12_1 ((uint32_t)0x00020000) /* Bit 1 */ - -#define GPIO_CFGHR_MODE13 ((uint32_t)0x00300000) /* MODE13[1:0] bits (Port x mode bits, pin 13) */ -#define GPIO_CFGHR_MODE13_0 ((uint32_t)0x00100000) /* Bit 0 */ -#define GPIO_CFGHR_MODE13_1 ((uint32_t)0x00200000) /* Bit 1 */ - -#define GPIO_CFGHR_MODE14 ((uint32_t)0x03000000) /* MODE14[1:0] bits (Port x mode bits, pin 14) */ -#define GPIO_CFGHR_MODE14_0 ((uint32_t)0x01000000) /* Bit 0 */ -#define GPIO_CFGHR_MODE14_1 ((uint32_t)0x02000000) /* Bit 1 */ - -#define GPIO_CFGHR_MODE15 ((uint32_t)0x30000000) /* MODE15[1:0] bits (Port x mode bits, pin 15) */ -#define GPIO_CFGHR_MODE15_0 ((uint32_t)0x10000000) /* Bit 0 */ -#define GPIO_CFGHR_MODE15_1 ((uint32_t)0x20000000) /* Bit 1 */ - -#define GPIO_CFGHR_CNF ((uint32_t)0xCCCCCCCC) /* Port x configuration bits */ - -#define GPIO_CFGHR_CNF8 ((uint32_t)0x0000000C) /* CNF8[1:0] bits (Port x configuration bits, pin 8) */ -#define GPIO_CFGHR_CNF8_0 ((uint32_t)0x00000004) /* Bit 0 */ -#define GPIO_CFGHR_CNF8_1 ((uint32_t)0x00000008) /* Bit 1 */ - -#define GPIO_CFGHR_CNF9 ((uint32_t)0x000000C0) /* CNF9[1:0] bits (Port x configuration bits, pin 9) */ -#define GPIO_CFGHR_CNF9_0 ((uint32_t)0x00000040) /* Bit 0 */ -#define GPIO_CFGHR_CNF9_1 ((uint32_t)0x00000080) /* Bit 1 */ - -#define GPIO_CFGHR_CNF10 ((uint32_t)0x00000C00) /* CNF10[1:0] bits (Port x configuration bits, pin 10) */ -#define GPIO_CFGHR_CNF10_0 ((uint32_t)0x00000400) /* Bit 0 */ -#define GPIO_CFGHR_CNF10_1 ((uint32_t)0x00000800) /* Bit 1 */ - -#define GPIO_CFGHR_CNF11 ((uint32_t)0x0000C000) /* CNF11[1:0] bits (Port x configuration bits, pin 11) */ -#define GPIO_CFGHR_CNF11_0 ((uint32_t)0x00004000) /* Bit 0 */ -#define GPIO_CFGHR_CNF11_1 ((uint32_t)0x00008000) /* Bit 1 */ - -#define GPIO_CFGHR_CNF12 ((uint32_t)0x000C0000) /* CNF12[1:0] bits (Port x configuration bits, pin 12) */ -#define GPIO_CFGHR_CNF12_0 ((uint32_t)0x00040000) /* Bit 0 */ -#define GPIO_CFGHR_CNF12_1 ((uint32_t)0x00080000) /* Bit 1 */ - -#define GPIO_CFGHR_CNF13 ((uint32_t)0x00C00000) /* CNF13[1:0] bits (Port x configuration bits, pin 13) */ -#define GPIO_CFGHR_CNF13_0 ((uint32_t)0x00400000) /* Bit 0 */ -#define GPIO_CFGHR_CNF13_1 ((uint32_t)0x00800000) /* Bit 1 */ - -#define GPIO_CFGHR_CNF14 ((uint32_t)0x0C000000) /* CNF14[1:0] bits (Port x configuration bits, pin 14) */ -#define GPIO_CFGHR_CNF14_0 ((uint32_t)0x04000000) /* Bit 0 */ -#define GPIO_CFGHR_CNF14_1 ((uint32_t)0x08000000) /* Bit 1 */ - -#define GPIO_CFGHR_CNF15 ((uint32_t)0xC0000000) /* CNF15[1:0] bits (Port x configuration bits, pin 15) */ -#define GPIO_CFGHR_CNF15_0 ((uint32_t)0x40000000) /* Bit 0 */ -#define GPIO_CFGHR_CNF15_1 ((uint32_t)0x80000000) /* Bit 1 */ - -/******************* Bit definition for GPIO_INDR register *******************/ -#define GPIO_INDR_IDR0 ((uint16_t)0x0001) /* Port input data, bit 0 */ -#define GPIO_INDR_IDR1 ((uint16_t)0x0002) /* Port input data, bit 1 */ -#define GPIO_INDR_IDR2 ((uint16_t)0x0004) /* Port input data, bit 2 */ -#define GPIO_INDR_IDR3 ((uint16_t)0x0008) /* Port input data, bit 3 */ -#define GPIO_INDR_IDR4 ((uint16_t)0x0010) /* Port input data, bit 4 */ -#define GPIO_INDR_IDR5 ((uint16_t)0x0020) /* Port input data, bit 5 */ -#define GPIO_INDR_IDR6 ((uint16_t)0x0040) /* Port input data, bit 6 */ -#define GPIO_INDR_IDR7 ((uint16_t)0x0080) /* Port input data, bit 7 */ -#define GPIO_INDR_IDR8 ((uint16_t)0x0100) /* Port input data, bit 8 */ -#define GPIO_INDR_IDR9 ((uint16_t)0x0200) /* Port input data, bit 9 */ -#define GPIO_INDR_IDR10 ((uint16_t)0x0400) /* Port input data, bit 10 */ -#define GPIO_INDR_IDR11 ((uint16_t)0x0800) /* Port input data, bit 11 */ -#define GPIO_INDR_IDR12 ((uint16_t)0x1000) /* Port input data, bit 12 */ -#define GPIO_INDR_IDR13 ((uint16_t)0x2000) /* Port input data, bit 13 */ -#define GPIO_INDR_IDR14 ((uint16_t)0x4000) /* Port input data, bit 14 */ -#define GPIO_INDR_IDR15 ((uint16_t)0x8000) /* Port input data, bit 15 */ -#define GPIO_INDR_IDR16 ((uint32_t)0x10000) /* Port input data, bit 16 */ -#define GPIO_INDR_IDR17 ((uint32_t)0x20000) /* Port input data, bit 17 */ -#define GPIO_INDR_IDR18 ((uint32_t)0x40000) /* Port input data, bit 18 */ -#define GPIO_INDR_IDR19 ((uint32_t)0x80000) /* Port input data, bit 19 */ -#define GPIO_INDR_IDR20 ((uint32_t)0x100000) /* Port input data, bit 20 */ -#define GPIO_INDR_IDR21 ((uint32_t)0x200000) /* Port input data, bit 21 */ -#define GPIO_INDR_IDR22 ((uint32_t)0x400000) /* Port input data, bit 22 */ -#define GPIO_INDR_IDR23 ((uint32_t)0x800000) /* Port input data, bit 23 */ - -/******************* Bit definition for GPIO_OUTDR register *******************/ -#define GPIO_OUTDR_ODR0 ((uint16_t)0x0001) /* Port output data, bit 0 */ -#define GPIO_OUTDR_ODR1 ((uint16_t)0x0002) /* Port output data, bit 1 */ -#define GPIO_OUTDR_ODR2 ((uint16_t)0x0004) /* Port output data, bit 2 */ -#define GPIO_OUTDR_ODR3 ((uint16_t)0x0008) /* Port output data, bit 3 */ -#define GPIO_OUTDR_ODR4 ((uint16_t)0x0010) /* Port output data, bit 4 */ -#define GPIO_OUTDR_ODR5 ((uint16_t)0x0020) /* Port output data, bit 5 */ -#define GPIO_OUTDR_ODR6 ((uint16_t)0x0040) /* Port output data, bit 6 */ -#define GPIO_OUTDR_ODR7 ((uint16_t)0x0080) /* Port output data, bit 7 */ -#define GPIO_OUTDR_ODR8 ((uint16_t)0x0100) /* Port output data, bit 8 */ -#define GPIO_OUTDR_ODR9 ((uint16_t)0x0200) /* Port output data, bit 9 */ -#define GPIO_OUTDR_ODR10 ((uint16_t)0x0400) /* Port output data, bit 10 */ -#define GPIO_OUTDR_ODR11 ((uint16_t)0x0800) /* Port output data, bit 11 */ -#define GPIO_OUTDR_ODR12 ((uint16_t)0x1000) /* Port output data, bit 12 */ -#define GPIO_OUTDR_ODR13 ((uint16_t)0x2000) /* Port output data, bit 13 */ -#define GPIO_OUTDR_ODR14 ((uint16_t)0x4000) /* Port output data, bit 14 */ -#define GPIO_OUTDR_ODR15 ((uint16_t)0x8000) /* Port output data, bit 15 */ -#define GPIO_OUTDR_ODR16 ((uint32_t)0x10000) /* Port output data, bit 16 */ -#define GPIO_OUTDR_ODR17 ((uint32_t)0x20000) /* Port output data, bit 17 */ -#define GPIO_OUTDR_ODR18 ((uint32_t)0x40000) /* Port output data, bit 18 */ -#define GPIO_OUTDR_ODR19 ((uint32_t)0x80000) /* Port output data, bit 19 */ -#define GPIO_OUTDR_ODR20 ((uint32_t)0x100000) /* Port output data, bit 20 */ -#define GPIO_OUTDR_ODR21 ((uint32_t)0x200000) /* Port output data, bit 21 */ -#define GPIO_OUTDR_ODR22 ((uint32_t)0x400000) /* Port output data, bit 22 */ -#define GPIO_OUTDR_ODR23 ((uint32_t)0x800000) /* Port output data, bit 23 */ - -/****************** Bit definition for GPIO_BSHR register *******************/ -#define GPIO_BSHR_BS0 ((uint32_t)0x00000001) /* Port x Set bit 0 */ -#define GPIO_BSHR_BS1 ((uint32_t)0x00000002) /* Port x Set bit 1 */ -#define GPIO_BSHR_BS2 ((uint32_t)0x00000004) /* Port x Set bit 2 */ -#define GPIO_BSHR_BS3 ((uint32_t)0x00000008) /* Port x Set bit 3 */ -#define GPIO_BSHR_BS4 ((uint32_t)0x00000010) /* Port x Set bit 4 */ -#define GPIO_BSHR_BS5 ((uint32_t)0x00000020) /* Port x Set bit 5 */ -#define GPIO_BSHR_BS6 ((uint32_t)0x00000040) /* Port x Set bit 6 */ -#define GPIO_BSHR_BS7 ((uint32_t)0x00000080) /* Port x Set bit 7 */ -#define GPIO_BSHR_BS8 ((uint32_t)0x00000100) /* Port x Set bit 8 */ -#define GPIO_BSHR_BS9 ((uint32_t)0x00000200) /* Port x Set bit 9 */ -#define GPIO_BSHR_BS10 ((uint32_t)0x00000400) /* Port x Set bit 10 */ -#define GPIO_BSHR_BS11 ((uint32_t)0x00000800) /* Port x Set bit 11 */ -#define GPIO_BSHR_BS12 ((uint32_t)0x00001000) /* Port x Set bit 12 */ -#define GPIO_BSHR_BS13 ((uint32_t)0x00002000) /* Port x Set bit 13 */ -#define GPIO_BSHR_BS14 ((uint32_t)0x00004000) /* Port x Set bit 14 */ -#define GPIO_BSHR_BS15 ((uint32_t)0x00008000) /* Port x Set bit 15 */ - -#define GPIO_BSHR_BR0 ((uint32_t)0x00010000) /* Port x Reset bit 0 */ -#define GPIO_BSHR_BR1 ((uint32_t)0x00020000) /* Port x Reset bit 1 */ -#define GPIO_BSHR_BR2 ((uint32_t)0x00040000) /* Port x Reset bit 2 */ -#define GPIO_BSHR_BR3 ((uint32_t)0x00080000) /* Port x Reset bit 3 */ -#define GPIO_BSHR_BR4 ((uint32_t)0x00100000) /* Port x Reset bit 4 */ -#define GPIO_BSHR_BR5 ((uint32_t)0x00200000) /* Port x Reset bit 5 */ -#define GPIO_BSHR_BR6 ((uint32_t)0x00400000) /* Port x Reset bit 6 */ -#define GPIO_BSHR_BR7 ((uint32_t)0x00800000) /* Port x Reset bit 7 */ -#define GPIO_BSHR_BR8 ((uint32_t)0x01000000) /* Port x Reset bit 8 */ -#define GPIO_BSHR_BR9 ((uint32_t)0x02000000) /* Port x Reset bit 9 */ -#define GPIO_BSHR_BR10 ((uint32_t)0x04000000) /* Port x Reset bit 10 */ -#define GPIO_BSHR_BR11 ((uint32_t)0x08000000) /* Port x Reset bit 11 */ -#define GPIO_BSHR_BR12 ((uint32_t)0x10000000) /* Port x Reset bit 12 */ -#define GPIO_BSHR_BR13 ((uint32_t)0x20000000) /* Port x Reset bit 13 */ -#define GPIO_BSHR_BR14 ((uint32_t)0x40000000) /* Port x Reset bit 14 */ -#define GPIO_BSHR_BR15 ((uint32_t)0x80000000) /* Port x Reset bit 15 */ - -/******************* Bit definition for GPIO_BCR register *******************/ -#define GPIO_BCR_BR0 ((uint16_t)0x0001) /* Port x Reset bit 0 */ -#define GPIO_BCR_BR1 ((uint16_t)0x0002) /* Port x Reset bit 1 */ -#define GPIO_BCR_BR2 ((uint16_t)0x0004) /* Port x Reset bit 2 */ -#define GPIO_BCR_BR3 ((uint16_t)0x0008) /* Port x Reset bit 3 */ -#define GPIO_BCR_BR4 ((uint16_t)0x0010) /* Port x Reset bit 4 */ -#define GPIO_BCR_BR5 ((uint16_t)0x0020) /* Port x Reset bit 5 */ -#define GPIO_BCR_BR6 ((uint16_t)0x0040) /* Port x Reset bit 6 */ -#define GPIO_BCR_BR7 ((uint16_t)0x0080) /* Port x Reset bit 7 */ -#define GPIO_BCR_BR8 ((uint16_t)0x0100) /* Port x Reset bit 8 */ -#define GPIO_BCR_BR9 ((uint16_t)0x0200) /* Port x Reset bit 9 */ -#define GPIO_BCR_BR10 ((uint16_t)0x0400) /* Port x Reset bit 10 */ -#define GPIO_BCR_BR11 ((uint16_t)0x0800) /* Port x Reset bit 11 */ -#define GPIO_BCR_BR12 ((uint16_t)0x1000) /* Port x Reset bit 12 */ -#define GPIO_BCR_BR13 ((uint16_t)0x2000) /* Port x Reset bit 13 */ -#define GPIO_BCR_BR14 ((uint16_t)0x4000) /* Port x Reset bit 14 */ -#define GPIO_BCR_BR15 ((uint16_t)0x8000) /* Port x Reset bit 15 */ -#define GPIO_BCR_BR16 ((uint32_t)0x10000) /* Port x Reset bit 16 */ -#define GPIO_BCR_BR17 ((uint32_t)0x20000) /* Port x Reset bit 17 */ -#define GPIO_BCR_BR18 ((uint32_t)0x40000) /* Port x Reset bit 18 */ -#define GPIO_BCR_BR19 ((uint32_t)0x80000) /* Port x Reset bit 19 */ -#define GPIO_BCR_BR20 ((uint32_t)0x100000) /* Port x Reset bit 20 */ -#define GPIO_BCR_BR21 ((uint32_t)0x200000) /* Port x Reset bit 21 */ -#define GPIO_BCR_BR22 ((uint32_t)0x400000) /* Port x Reset bit 22 */ -#define GPIO_BCR_BR23 ((uint32_t)0x800000) /* Port x Reset bit 23 */ - -/****************** Bit definition for GPIO_LCKR register *******************/ -#define GPIO_LCK0 ((uint32_t)0x00000001) /* Port x Lock bit 0 */ -#define GPIO_LCK1 ((uint32_t)0x00000002) /* Port x Lock bit 1 */ -#define GPIO_LCK2 ((uint32_t)0x00000004) /* Port x Lock bit 2 */ -#define GPIO_LCK3 ((uint32_t)0x00000008) /* Port x Lock bit 3 */ -#define GPIO_LCK4 ((uint32_t)0x00000010) /* Port x Lock bit 4 */ -#define GPIO_LCK5 ((uint32_t)0x00000020) /* Port x Lock bit 5 */ -#define GPIO_LCK6 ((uint32_t)0x00000040) /* Port x Lock bit 6 */ -#define GPIO_LCK7 ((uint32_t)0x00000080) /* Port x Lock bit 7 */ -#define GPIO_LCK8 ((uint32_t)0x00000100) /* Port x Lock bit 8 */ -#define GPIO_LCK9 ((uint32_t)0x00000200) /* Port x Lock bit 9 */ -#define GPIO_LCK10 ((uint32_t)0x00000400) /* Port x Lock bit 10 */ -#define GPIO_LCK11 ((uint32_t)0x00000800) /* Port x Lock bit 11 */ -#define GPIO_LCK12 ((uint32_t)0x00001000) /* Port x Lock bit 12 */ -#define GPIO_LCK13 ((uint32_t)0x00002000) /* Port x Lock bit 13 */ -#define GPIO_LCK14 ((uint32_t)0x00004000) /* Port x Lock bit 14 */ -#define GPIO_LCK15 ((uint32_t)0x00008000) /* Port x Lock bit 15 */ -#define GPIO_LCK16 ((uint32_t)0x00010000) /* Port x Lock bit 16 */ -#define GPIO_LCK17 ((uint32_t)0x00020000) /* Port x Lock bit 17 */ -#define GPIO_LCK18 ((uint32_t)0x00040000) /* Port x Lock bit 18 */ -#define GPIO_LCK19 ((uint32_t)0x00080000) /* Port x Lock bit 19 */ -#define GPIO_LCK20 ((uint32_t)0x00100000) /* Port x Lock bit 20 */ -#define GPIO_LCK21 ((uint32_t)0x00200000) /* Port x Lock bit 21 */ -#define GPIO_LCK22 ((uint32_t)0x00400000) /* Port x Lock bit 22 */ -#define GPIO_LCK23 ((uint32_t)0x00800000) /* Port x Lock bit 23 */ - -#define GPIO_LCKK ((uint32_t)0x01000000) /* Lock key */ - -/******************* Bit definition for GPIO_CFGXR register *******************/ -#define GPIO_CFGXR_MODE ((uint32_t)0x33333333) /* Port x mode bits */ - -#define GPIO_CFGXR_MODE16 ((uint32_t)0x00000003) /* MODE16[1:0] bits (Port x mode bits, pin 0) */ -#define GPIO_CFGXR_MODE16_0 ((uint32_t)0x00000001) /* Bit 0 */ -#define GPIO_CFGXR_MODE16_1 ((uint32_t)0x00000002) /* Bit 1 */ - -#define GPIO_CFGXR_MODE17 ((uint32_t)0x00000030) /* MODE17[1:0] bits (Port x mode bits, pin 1) */ -#define GPIO_CFGXR_MODE17_0 ((uint32_t)0x00000010) /* Bit 0 */ -#define GPIO_CFGXR_MODE17_1 ((uint32_t)0x00000020) /* Bit 1 */ - -#define GPIO_CFGXR_MODE18 ((uint32_t)0x00000300) /* MODE18[1:0] bits (Port x mode bits, pin 2) */ -#define GPIO_CFGXR_MODE18_0 ((uint32_t)0x00000100) /* Bit 0 */ -#define GPIO_CFGXR_MODE18_1 ((uint32_t)0x00000200) /* Bit 1 */ - -#define GPIO_CFGXR_MODE19 ((uint32_t)0x00003000) /* MODE19[1:0] bits (Port x mode bits, pin 3) */ -#define GPIO_CFGXR_MODE19_0 ((uint32_t)0x00001000) /* Bit 0 */ -#define GPIO_CFGXR_MODE19_1 ((uint32_t)0x00002000) /* Bit 1 */ - -#define GPIO_CFGXR_MODE20 ((uint32_t)0x00030000) /* MODE20[1:0] bits (Port x mode bits, pin 4) */ -#define GPIO_CFGXR_MODE20_0 ((uint32_t)0x00010000) /* Bit 0 */ -#define GPIO_CFGXR_MODE20_1 ((uint32_t)0x00020000) /* Bit 1 */ - -#define GPIO_CFGXR_MODE21 ((uint32_t)0x00300000) /* MODE21[1:0] bits (Port x mode bits, pin 5) */ -#define GPIO_CFGXR_MODE21_0 ((uint32_t)0x00100000) /* Bit 0 */ -#define GPIO_CFGXR_MODE21_1 ((uint32_t)0x00200000) /* Bit 1 */ - -#define GPIO_CFGXR_MODE22 ((uint32_t)0x03000000) /* MODE22[1:0] bits (Port x mode bits, pin 6) */ -#define GPIO_CFGXR_MODE22_0 ((uint32_t)0x01000000) /* Bit 0 */ -#define GPIO_CFGXR_MODE22_1 ((uint32_t)0x02000000) /* Bit 1 */ - -#define GPIO_CFGXR_MODE23 ((uint32_t)0x30000000) /* MODE23[1:0] bits (Port x mode bits, pin 7) */ -#define GPIO_CFGXR_MODE23_0 ((uint32_t)0x10000000) /* Bit 0 */ -#define GPIO_CFGXR_MODE23_1 ((uint32_t)0x20000000) /* Bit 1 */ - -#define GPIO_CFGXR_CNF ((uint32_t)0xCCCCCCCC) /* Port x configuration bits */ - -#define GPIO_CFGXR_CNF16 ((uint32_t)0x0000000C) /* CNF16[1:0] bits (Port x configuration bits, pin 0) */ -#define GPIO_CFGXR_CNF16_0 ((uint32_t)0x00000004) /* Bit 0 */ -#define GPIO_CFGXR_CNF16_1 ((uint32_t)0x00000008) /* Bit 1 */ - -#define GPIO_CFGXR_CNF17 ((uint32_t)0x000000C0) /* CNF17[1:0] bits (Port x configuration bits, pin 1) */ -#define GPIO_CFGXR_CNF17_0 ((uint32_t)0x00000040) /* Bit 0 */ -#define GPIO_CFGXR_CNF17_1 ((uint32_t)0x00000080) /* Bit 1 */ - -#define GPIO_CFGXR_CNF18 ((uint32_t)0x00000C00) /* CNF18[1:0] bits (Port x configuration bits, pin 2) */ -#define GPIO_CFGXR_CNF18_0 ((uint32_t)0x00000400) /* Bit 0 */ -#define GPIO_CFGXR_CNF18_1 ((uint32_t)0x00000800) /* Bit 1 */ - -#define GPIO_CFGXR_CNF19 ((uint32_t)0x0000C000) /* CNF19[1:0] bits (Port x configuration bits, pin 3) */ -#define GPIO_CFGXR_CNF19_0 ((uint32_t)0x00004000) /* Bit 0 */ -#define GPIO_CFGXR_CNF19_1 ((uint32_t)0x00008000) /* Bit 1 */ - -#define GPIO_CFGXR_CNF20 ((uint32_t)0x000C0000) /* CNF20[1:0] bits (Port x configuration bits, pin 4) */ -#define GPIO_CFGXR_CNF20_0 ((uint32_t)0x00040000) /* Bit 0 */ -#define GPIO_CFGXR_CNF20_1 ((uint32_t)0x00080000) /* Bit 1 */ - -#define GPIO_CFGXR_CNF21 ((uint32_t)0x00C00000) /* CNF21[1:0] bits (Port x configuration bits, pin 5) */ -#define GPIO_CFGXR_CNF21_0 ((uint32_t)0x00400000) /* Bit 0 */ -#define GPIO_CFGXR_CNF21_1 ((uint32_t)0x00800000) /* Bit 1 */ - -#define GPIO_CFGXR_CNF22 ((uint32_t)0x0C000000) /* CNF22[1:0] bits (Port x configuration bits, pin 6) */ -#define GPIO_CFGXR_CNF22_0 ((uint32_t)0x04000000) /* Bit 0 */ -#define GPIO_CFGXR_CNF22_1 ((uint32_t)0x08000000) /* Bit 1 */ - -#define GPIO_CFGXR_CNF23 ((uint32_t)0xC0000000) /* CNF23[1:0] bits (Port x configuration bits, pin 7) */ -#define GPIO_CFGXR_CNF23_0 ((uint32_t)0x40000000) /* Bit 0 */ -#define GPIO_CFGXR_CNF23_1 ((uint32_t)0x80000000) /* Bit 1 */ - -/****************** Bit definition for GPIO_BSXR register *******************/ -#define GPIO_BSXR_BS16 ((uint32_t)0x00000001) /* Port x Set bit 0 */ -#define GPIO_BSXR_BS17 ((uint32_t)0x00000002) /* Port x Set bit 1 */ -#define GPIO_BSXR_BS18 ((uint32_t)0x00000004) /* Port x Set bit 2 */ -#define GPIO_BSXR_BS19 ((uint32_t)0x00000008) /* Port x Set bit 3 */ -#define GPIO_BSXR_BS20 ((uint32_t)0x00000010) /* Port x Set bit 4 */ -#define GPIO_BSXR_BS21 ((uint32_t)0x00000020) /* Port x Set bit 5 */ -#define GPIO_BSXR_BS22 ((uint32_t)0x00000040) /* Port x Set bit 6 */ -#define GPIO_BSXR_BS23 ((uint32_t)0x00000080) /* Port x Set bit 7 */ - -#define GPIO_BSXR_BR16 ((uint32_t)0x00010000) /* Port x Reset bit 0 */ -#define GPIO_BSXR_BR17 ((uint32_t)0x00020000) /* Port x Reset bit 1 */ -#define GPIO_BSXR_BR18 ((uint32_t)0x00040000) /* Port x Reset bit 2 */ -#define GPIO_BSXR_BR19 ((uint32_t)0x00080000) /* Port x Reset bit 3 */ -#define GPIO_BSXR_BR20 ((uint32_t)0x00100000) /* Port x Reset bit 4 */ -#define GPIO_BSXR_BR21 ((uint32_t)0x00200000) /* Port x Reset bit 5 */ -#define GPIO_BSXR_BR22 ((uint32_t)0x00400000) /* Port x Reset bit 6 */ -#define GPIO_BSXR_BR23 ((uint32_t)0x00800000) /* Port x Reset bit 7 */ - -/****************** Bit definition for AFIO_PCFR1register *******************/ -#define AFIO_PCFR1_SPI1_REMAP ((uint32_t)0x00000003) /* SPI1_REMAP[1:0] bits (SPI1 remapping) */ -#define AFIO_PCFR1_SPI1_REMAP_0 ((uint32_t)0x00000001) /* Bit 0 */ -#define AFIO_PCFR1_SPI1_REMAP_1 ((uint32_t)0x00000002) /* Bit 1 */ - -#define AFIO_PCFR1_I2C1_REMAP ((uint32_t)0x0000001C) /* I2C1_REMAP[4:2] bits (I2C1 remapping) */ -#define AFIO_PCFR1_I2C1_REMAP_0 ((uint32_t)0x00000004) /* Bit 0 */ -#define AFIO_PCFR1_I2C1_REMAP_1 ((uint32_t)0x00000008) /* Bit 1 */ -#define AFIO_PCFR1_I2C1_REMAP_2 ((uint32_t)0x00000010) /* Bit 2 */ - -#define AFIO_PCFR1_USART1_REMAP ((uint32_t)0x00000060) /* USART1_REMAP[6:5] bits (USART1 remapping) */ -#define AFIO_PCFR1_USART1_REMAP_0 ((uint32_t)0x00000020) /* Bit 0 */ -#define AFIO_PCFR1_USART1_REMAP_1 ((uint32_t)0x00000040) /* Bit 1 */ - -#define AFIO_PCFR1_USART2_REMAP ((uint32_t)0x00000380) /* USART2_REMAP[9:7] bits (USART2 remapping) */ -#define AFIO_PCFR1_USART2_REMAP_0 ((uint32_t)0x00000080) /* Bit 0 */ -#define AFIO_PCFR1_USART2_REMAP_1 ((uint32_t)0x00000100) /* Bit 1 */ -#define AFIO_PCFR1_USART2_REMAP_2 ((uint32_t)0x00000200) /* Bit 2 */ - -#define AFIO_PCFR1_USART3_REMAP ((uint32_t)0x00000C00) /* USART3_REMAP[11:10] bits (USART3 remapping) */ -#define AFIO_PCFR1_USART3_REMAP_0 ((uint32_t)0x00000400) /* Bit 0 */ -#define AFIO_PCFR1_USART3_REMAP_1 ((uint32_t)0x00000800) /* Bit 1 */ - -#define AFIO_PCFR1_USART4_REMAP ((uint32_t)0x00007000) /* USART4_REMAP[14:12] bits (USART4 remapping) */ -#define AFIO_PCFR1_USART4_REMAP_0 ((uint32_t)0x00001000) /* Bit 0 */ -#define AFIO_PCFR1_USART4_REMAP_1 ((uint32_t)0x00002000) /* Bit 1 */ -#define AFIO_PCFR1_USART4_REMAP_2 ((uint32_t)0x00004000) /* Bit 2 */ - -#define AFIO_PCFR1_TIM1_REMAP ((uint32_t)0x00038000) /* TIM1_REMAP[17:15] bits (TIM1 remapping) */ -#define AFIO_PCFR1_TIM1_REMAP_0 ((uint32_t)0x00008000) /* Bit 0 */ -#define AFIO_PCFR1_TIM1_REMAP_1 ((uint32_t)0x00010000) /* Bit 1 */ -#define AFIO_PCFR1_TIM1_REMAP_2 ((uint32_t)0x00020000) /* Bit 2 */ - -#define AFIO_PCFR1_TIM2_REMAP ((uint32_t)0x001C0000) /* TIM2_REMAP[20:18] bits (TIM2 remapping) */ -#define AFIO_PCFR1_TIM2_REMAP_0 ((uint32_t)0x00040000) /* Bit 0 */ -#define AFIO_PCFR1_TIM2_REMAP_1 ((uint32_t)0x00080000) /* Bit 1 */ -#define AFIO_PCFR1_TIM2_REMAP_2 ((uint32_t)0x00100000) /* Bit 2 */ - -#define AFIO_PCFR1_TIM3_REMAP ((uint32_t)0x00600000) /* TIM3_REMAP[22:21] bits (TIM3 remapping) */ -#define AFIO_PCFR1_TIM3_REMAP_0 ((uint32_t)0x00200000) /* Bit 0 */ -#define AFIO_PCFR1_TIM3_REMAP_1 ((uint32_t)0x00400000) /* Bit 1 */ - -#define AFIO_PCFR1_PIOC_REMAP ((uint32_t)0x00800000) /* PIOC[23] bits (PIOC remapping) */ - -#define AFIO_PCFR1_SWJ_CFG ((uint32_t)0x07000000) /* SWJ_CFG[2:0] bits (Serial Wire JTAG configuration) */ -#define AFIO_PCFR1_SWJ_CFG_0 ((uint32_t)0x01000000) /* Bit 0 */ -#define AFIO_PCFR1_SWJ_CFG_1 ((uint32_t)0x02000000) /* Bit 1 */ -#define AFIO_PCFR1_SWJ_CFG_2 ((uint32_t)0x04000000) /* Bit 2 */ - -#define AFIO_PCFR1_SWJ_CFG_RESET ((uint32_t)0x00000000) /* Full SWJ (JTAG-DP + SW-DP) : Reset State */ -#define AFIO_PCFR1_SWJ_CFG_NOJNTRST ((uint32_t)0x01000000) /* Full SWJ (JTAG-DP + SW-DP) but without JNTRST */ -#define AFIO_PCFR1_SWJ_CFG_JTAGDISABLE ((uint32_t)0x02000000) /* JTAG-DP Disabled and SW-DP Enabled */ -#define AFIO_PCFR1_SWJ_CFG_DISABLE ((uint32_t)0x04000000) /* JTAG-DP Disabled and SW-DP Disabled */ - -/***************** Bit definition for AFIO_EXTICR1 register *****************/ -#define AFIO_EXTICR1_EXTI0 ((uint32_t)0x00000003) /* EXTI 0 configuration */ -#define AFIO_EXTICR1_EXTI1 ((uint32_t)0x0000000C) /* EXTI 1 configuration */ -#define AFIO_EXTICR1_EXTI2 ((uint32_t)0x00000030) /* EXTI 2 configuration */ -#define AFIO_EXTICR1_EXTI3 ((uint32_t)0x000000C0) /* EXTI 3 configuration */ -#define AFIO_EXTICR1_EXTI4 ((uint32_t)0x00000300) /* EXTI 4 configuration */ -#define AFIO_EXTICR1_EXTI5 ((uint32_t)0x00000C00) /* EXTI 5 configuration */ -#define AFIO_EXTICR1_EXTI6 ((uint32_t)0x00003000) /* EXTI 6 configuration */ -#define AFIO_EXTICR1_EXTI7 ((uint32_t)0x0000C000) /* EXTI 7 configuration */ -#define AFIO_EXTICR1_EXTI8 ((uint32_t)0x00030000) /* EXTI 8 configuration */ -#define AFIO_EXTICR1_EXTI9 ((uint32_t)0x000C0000) /* EXTI 9 configuration */ -#define AFIO_EXTICR1_EXTI10 ((uint32_t)0x00300000) /* EXTI 10 configuration */ -#define AFIO_EXTICR1_EXTI11 ((uint32_t)0x00C00000) /* EXTI 11 configuration */ -#define AFIO_EXTICR1_EXTI12 ((uint32_t)0x03000000) /* EXTI 12 configuration */ -#define AFIO_EXTICR1_EXTI13 ((uint32_t)0x0C000000) /* EXTI 13 configuration */ -#define AFIO_EXTICR1_EXTI14 ((uint32_t)0x30000000) /* EXTI 14 configuration */ -#define AFIO_EXTICR1_EXTI15 ((uint32_t)0xC0000000) /* EXTI 15 configuration */ - -#define AFIO_EXTICR1_EXTI0_PA ((uint32_t)0x00000000) /* PA[0] pin */ -#define AFIO_EXTICR1_EXTI0_PB ((uint32_t)0x00000001) /* PB[0] pin */ -#define AFIO_EXTICR1_EXTI0_PC ((uint32_t)0x00000002) /* PC[0] pin */ - -#define AFIO_EXTICR1_EXTI1_PA ((uint32_t)0x00000000) /* PA[1] pin */ -#define AFIO_EXTICR1_EXTI1_PB ((uint32_t)0x00000004) /* PB[1] pin */ -#define AFIO_EXTICR1_EXTI1_PC ((uint32_t)0x00000008) /* PC[1] pin */ - -#define AFIO_EXTICR1_EXTI2_PA ((uint32_t)0x00000000) /* PA[2] pin */ -#define AFIO_EXTICR1_EXTI2_PB ((uint32_t)0x00000010) /* PB[2] pin */ -#define AFIO_EXTICR1_EXTI2_PC ((uint32_t)0x00000020) /* PC[2] pin */ - -#define AFIO_EXTICR1_EXTI3_PA ((uint32_t)0x00000000) /* PA[3] pin */ -#define AFIO_EXTICR1_EXTI3_PB ((uint32_t)0x00000040) /* PB[3] pin */ -#define AFIO_EXTICR1_EXTI3_PC ((uint32_t)0x00000080) /* PC[3] pin */ - -#define AFIO_EXTICR1_EXTI4_PA ((uint32_t)0x00000000) /* PA[4] pin */ -#define AFIO_EXTICR1_EXTI4_PB ((uint32_t)0x00000100) /* PB[4] pin */ -#define AFIO_EXTICR1_EXTI4_PC ((uint32_t)0x00000200) /* PC[4] pin */ - -#define AFIO_EXTICR1_EXTI5_PA ((uint32_t)0x00000000) /* PA[5] pin */ -#define AFIO_EXTICR1_EXTI5_PB ((uint32_t)0x00000400) /* PB[5] pin */ -#define AFIO_EXTICR1_EXTI5_PC ((uint32_t)0x00000800) /* PC[5] pin */ - -#define AFIO_EXTICR1_EXTI6_PA ((uint32_t)0x00000000) /* PA[6] pin */ -#define AFIO_EXTICR1_EXTI6_PB ((uint32_t)0x00001000) /* PB[6] pin */ -#define AFIO_EXTICR1_EXTI6_PC ((uint32_t)0x00002000) /* PC[6] pin */ - -#define AFIO_EXTICR1_EXTI7_PA ((uint32_t)0x00000000) /* PA[7] pin */ -#define AFIO_EXTICR1_EXTI7_PB ((uint32_t)0x00004000) /* PB[7] pin */ -#define AFIO_EXTICR1_EXTI7_PC ((uint32_t)0x00008000) /* PC[7] pin */ - -#define AFIO_EXTICR1_EXTI8_PA ((uint32_t)0x00000000) /* PA[8] pin */ -#define AFIO_EXTICR1_EXTI8_PB ((uint32_t)0x00010000) /* PB[8] pin */ -#define AFIO_EXTICR1_EXTI8_PC ((uint32_t)0x00020000) /* PC[8] pin */ - -#define AFIO_EXTICR1_EXTI9_PA ((uint32_t)0x00000000) /* PA[9] pin */ -#define AFIO_EXTICR1_EXTI9_PB ((uint32_t)0x00040000) /* PB[9] pin */ -#define AFIO_EXTICR1_EXTI9_PC ((uint32_t)0x00080000) /* PC[9] pin */ - -#define AFIO_EXTICR1_EXTI10_PA ((uint32_t)0x00000000) /* PA[10] pin */ -#define AFIO_EXTICR1_EXTI10_PB ((uint32_t)0x00100000) /* PB[10] pin */ -#define AFIO_EXTICR1_EXTI10_PC ((uint32_t)0x00200000) /* PC[10] pin */ - -#define AFIO_EXTICR1_EXTI11_PA ((uint32_t)0x00000000) /* PA[11] pin */ -#define AFIO_EXTICR1_EXTI11_PB ((uint32_t)0x00400000) /* PB[11] pin */ -#define AFIO_EXTICR1_EXTI11_PC ((uint32_t)0x00800000) /* PC[11] pin */ - -#define AFIO_EXTICR1_EXTI12_PA ((uint32_t)0x00000000) /* PA[12] pin */ -#define AFIO_EXTICR1_EXTI12_PB ((uint32_t)0x01000000) /* PB[12] pin */ -#define AFIO_EXTICR1_EXTI12_PC ((uint32_t)0x02000000) /* PC[12] pin */ - -#define AFIO_EXTICR1_EXTI13_PA ((uint32_t)0x00000000) /* PA[13] pin */ -#define AFIO_EXTICR1_EXTI13_PB ((uint32_t)0x04000000) /* PB[13] pin */ -#define AFIO_EXTICR1_EXTI13_PC ((uint32_t)0x08000000) /* PC[13] pin */ - -#define AFIO_EXTICR1_EXTI14_PA ((uint32_t)0x00000000) /* PA[14] pin */ -#define AFIO_EXTICR1_EXTI14_PB ((uint32_t)0x10000000) /* PB[14] pin */ -#define AFIO_EXTICR1_EXTI14_PC ((uint32_t)0x20000000) /* PC[14] pin */ - -#define AFIO_EXTICR1_EXTI15_PA ((uint32_t)0x00000000) /* PA[15] pin */ -#define AFIO_EXTICR1_EXTI15_PB ((uint32_t)0x40000000) /* PB[15] pin */ -#define AFIO_EXTICR1_EXTI15_PC ((uint32_t)0x80000000) /* PC[15] pin */ - -/***************** Bit definition for AFIO_EXTICR2 register *****************/ -#define AFIO_EXTICR2_EXTI16 ((uint16_t)0x00000003) /* EXTI 16 configuration */ -#define AFIO_EXTICR2_EXTI17 ((uint16_t)0x0000000C) /* EXTI 17 configuration */ -#define AFIO_EXTICR2_EXTI18 ((uint16_t)0x00000030) /* EXTI 18 configuration */ -#define AFIO_EXTICR2_EXTI19 ((uint16_t)0x000000C0) /* EXTI 19 configuration */ -#define AFIO_EXTICR2_EXTI20 ((uint16_t)0x00000300) /* EXTI 20 configuration */ -#define AFIO_EXTICR2_EXTI21 ((uint16_t)0x00000C00) /* EXTI 21 configuration */ -#define AFIO_EXTICR2_EXTI22 ((uint16_t)0x00003000) /* EXTI 22 configuration */ -#define AFIO_EXTICR2_EXTI23 ((uint16_t)0x0000C000) /* EXTI 23 configuration */ - -#define AFIO_EXTICR2_EXTI16_PA ((uint16_t)0x00000000) /* PA[16] pin */ -#define AFIO_EXTICR2_EXTI16_PB ((uint16_t)0x00000001) /* PB[16] pin */ -#define AFIO_EXTICR2_EXTI16_PC ((uint16_t)0x00000002) /* PC[16] pin */ - -#define AFIO_EXTICR2_EXTI17_PA ((uint16_t)0x00000000) /* PA[17] pin */ -#define AFIO_EXTICR2_EXTI17_PB ((uint16_t)0x00000004) /* PB[17] pin */ -#define AFIO_EXTICR2_EXTI17_PC ((uint16_t)0x00000008) /* PC[17] pin */ - -#define AFIO_EXTICR2_EXTI18_PA ((uint16_t)0x00000000) /* PA[18] pin */ -#define AFIO_EXTICR2_EXTI18_PB ((uint16_t)0x00000010) /* PB[18] pin */ -#define AFIO_EXTICR2_EXTI18_PC ((uint16_t)0x00000020) /* PC[18] pin */ - -#define AFIO_EXTICR2_EXTI19_PA ((uint16_t)0x00000000) /* PA[19] pin */ -#define AFIO_EXTICR2_EXTI19_PB ((uint16_t)0x00000040) /* PB[19] pin */ -#define AFIO_EXTICR2_EXTI19_PC ((uint16_t)0x00000080) /* PC[19] pin */ - -#define AFIO_EXTICR2_EXTI20_PA ((uint16_t)0x00000000) /* PA[20] pin */ -#define AFIO_EXTICR2_EXTI20_PB ((uint16_t)0x00000100) /* PB[20] pin */ -#define AFIO_EXTICR2_EXTI20_PC ((uint16_t)0x00000200) /* PC[20] pin */ - -#define AFIO_EXTICR2_EXTI21_PA ((uint16_t)0x00000000) /* PA[21] pin */ -#define AFIO_EXTICR2_EXTI21_PB ((uint16_t)0x00000400) /* PB[21] pin */ -#define AFIO_EXTICR2_EXTI21_PC ((uint16_t)0x00000800) /* PC[21] pin */ - -#define AFIO_EXTICR2_EXTI22_PA ((uint16_t)0x00000000) /* PA[22] pin */ -#define AFIO_EXTICR2_EXTI22_PB ((uint16_t)0x00001000) /* PB[22] pin */ -#define AFIO_EXTICR2_EXTI22_PC ((uint16_t)0x00002000) /* PC[22] pin */ - -#define AFIO_EXTICR2_EXTI23_PA ((uint16_t)0x00000000) /* PA[23] pin */ -#define AFIO_EXTICR2_EXTI23_PB ((uint16_t)0x00004000) /* PB[23] pin */ -#define AFIO_EXTICR2_EXTI23_PC ((uint16_t)0x00008000) /* PC[23] pin */ - -/******************* Bit definition for AFIO_CTLR register ********************/ -#define AFIO_CTLR_UDM_PUE ((uint32_t)0x00000003) /* PC16/UDM Pin pull-up Mode*/ -#define AFIO_CTLR_UDM_PUE_0 ((uint32_t)0x00000001) /* bit[0] */ -#define AFIO_CTLR_UDM_PUE_1 ((uint32_t)0x00000002) /* bit[1] */ - -#define AFIO_CTLR_UDP_PUE ((uint32_t)0x0000000C) /* PC17/UDP Pin pull-up Mode*/ -#define AFIO_CTLR_UDP_PUE_0 ((uint32_t)0x00000004) /* bit[2] */ -#define AFIO_CTLR_UDP_PUE_1 ((uint32_t)0x00000008) /* bit[3] */ - -#define AFIO_CTLR_USB_PHY_V33 ((uint32_t)0x00000040) /* USB transceiver PHY output and pull-up limiter configuration */ -#define AFIO_CTLR_USB_IOEN ((uint32_t)0x00000080) /* USB Remap pin enable */ -#define AFIO_CTLR_USBPD_PHY_V33 ((uint32_t)0x00000100) /* USBPD transceiver PHY output and pull-up limiter configuration */ -#define AFIO_CTLR_USBPD_IN_HVT ((uint32_t)0x00000200) /* PD pin PC14/PC15 high threshold input mode */ -#define AFIO_CTLR_UDP_BC_VSRC ((uint32_t)0x00010000) /* PC17/UDP pin BC protocol source voltage enable */ -#define AFIO_CTLR_UDM_BC_VSRC ((uint32_t)0x00020000) /* PC16/UDM pin BC protocol source voltage enable */ -#define AFIO_CTLR_UDP_BC_CMPO ((uint32_t)0x00040000) /* PC17/UDP pin BC protocol comparator status */ -#define AFIO_CTLR_UDM_BC_CMPO ((uint32_t)0x00080000) /* PC16/UDM pin BC protocol comparator status */ -#define AFIO_CTLR_PA3_FILT_EN ((uint32_t)0x01000000) /* Controls the input filtering of the PA3 pin */ -#define AFIO_CTLR_PA4_FILT_EN ((uint32_t)0x02000000) /* Controls the input filtering of the PA4 pin */ -#define AFIO_CTLR_PB5_FILT_EN ((uint32_t)0x04000000) /* Controls the input filtering of the PB5 pin */ -#define AFIO_CTLR_PB6_FILT_EN ((uint32_t)0x08000000) /* Controls the input filtering of the PB6 pin */ - -/******************************************************************************/ -/* Independent WATCHDOG */ -/******************************************************************************/ - -/******************* Bit definition for IWDG_CTLR register ********************/ -#define IWDG_KEY ((uint16_t)0xFFFF) /* Key value (write only, read 0000h) */ - -/******************* Bit definition for IWDG_PSCR register ********************/ -#define IWDG_PR ((uint8_t)0x07) /* PR[2:0] (Prescaler divider) */ -#define IWDG_PR_0 ((uint8_t)0x01) /* Bit 0 */ -#define IWDG_PR_1 ((uint8_t)0x02) /* Bit 1 */ -#define IWDG_PR_2 ((uint8_t)0x04) /* Bit 2 */ - -/******************* Bit definition for IWDG_RLDR register *******************/ -#define IWDG_RL ((uint16_t)0x0FFF) /* Watchdog counter reload value */ - -/******************* Bit definition for IWDG_STATR register ********************/ -#define IWDG_PVU ((uint8_t)0x01) /* Watchdog prescaler value update */ -#define IWDG_RVU ((uint8_t)0x02) /* Watchdog counter reload value update */ - -/******************************************************************************/ -/* Inter-integrated Circuit Interface */ -/******************************************************************************/ - -/******************* Bit definition for I2C_CTLR1 register ********************/ -#define I2C_CTLR1_PE ((uint16_t)0x0001) /* Peripheral Enable */ -#define I2C_CTLR1_SMBUS ((uint16_t)0x0002) /* SMBus Mode */ -#define I2C_CTLR1_SMBTYPE ((uint16_t)0x0008) /* SMBus Type */ -#define I2C_CTLR1_ENARP ((uint16_t)0x0010) /* ARP Enable */ -#define I2C_CTLR1_ENPEC ((uint16_t)0x0020) /* PEC Enable */ -#define I2C_CTLR1_ENGC ((uint16_t)0x0040) /* General Call Enable */ -#define I2C_CTLR1_NOSTRETCH ((uint16_t)0x0080) /* Clock Stretching Disable (Slave mode) */ -#define I2C_CTLR1_START ((uint16_t)0x0100) /* Start Generation */ -#define I2C_CTLR1_STOP ((uint16_t)0x0200) /* Stop Generation */ -#define I2C_CTLR1_ACK ((uint16_t)0x0400) /* Acknowledge Enable */ -#define I2C_CTLR1_POS ((uint16_t)0x0800) /* Acknowledge/PEC Position (for data reception) */ -#define I2C_CTLR1_PEC ((uint16_t)0x1000) /* Packet Error Checking */ -#define I2C_CTLR1_ALERT ((uint16_t)0x2000) /* SMBus Alert */ -#define I2C_CTLR1_SWRST ((uint16_t)0x8000) /* Software Reset */ - -/******************* Bit definition for I2C_CTLR2 register ********************/ -#define I2C_CTLR2_FREQ ((uint16_t)0x003F) /* FREQ[5:0] bits (Peripheral Clock Frequency) */ -#define I2C_CTLR2_FREQ_0 ((uint16_t)0x0001) /* Bit 0 */ -#define I2C_CTLR2_FREQ_1 ((uint16_t)0x0002) /* Bit 1 */ -#define I2C_CTLR2_FREQ_2 ((uint16_t)0x0004) /* Bit 2 */ -#define I2C_CTLR2_FREQ_3 ((uint16_t)0x0008) /* Bit 3 */ -#define I2C_CTLR2_FREQ_4 ((uint16_t)0x0010) /* Bit 4 */ -#define I2C_CTLR2_FREQ_5 ((uint16_t)0x0020) /* Bit 5 */ - -#define I2C_CTLR2_ITERREN ((uint16_t)0x0100) /* Error Interrupt Enable */ -#define I2C_CTLR2_ITEVTEN ((uint16_t)0x0200) /* Event Interrupt Enable */ -#define I2C_CTLR2_ITBUFEN ((uint16_t)0x0400) /* Buffer Interrupt Enable */ -#define I2C_CTLR2_DMAEN ((uint16_t)0x0800) /* DMA Requests Enable */ -#define I2C_CTLR2_LAST ((uint16_t)0x1000) /* DMA Last Transfer */ - -/******************* Bit definition for I2C_OADDR1 register *******************/ -#define I2C_OADDR1_ADD1_7 ((uint16_t)0x00FE) /* Interface Address */ -#define I2C_OADDR1_ADD8_9 ((uint16_t)0x0300) /* Interface Address */ - -#define I2C_OADDR1_ADD0 ((uint16_t)0x0001) /* Bit 0 */ -#define I2C_OADDR1_ADD1 ((uint16_t)0x0002) /* Bit 1 */ -#define I2C_OADDR1_ADD2 ((uint16_t)0x0004) /* Bit 2 */ -#define I2C_OADDR1_ADD3 ((uint16_t)0x0008) /* Bit 3 */ -#define I2C_OADDR1_ADD4 ((uint16_t)0x0010) /* Bit 4 */ -#define I2C_OADDR1_ADD5 ((uint16_t)0x0020) /* Bit 5 */ -#define I2C_OADDR1_ADD6 ((uint16_t)0x0040) /* Bit 6 */ -#define I2C_OADDR1_ADD7 ((uint16_t)0x0080) /* Bit 7 */ -#define I2C_OADDR1_ADD8 ((uint16_t)0x0100) /* Bit 8 */ -#define I2C_OADDR1_ADD9 ((uint16_t)0x0200) /* Bit 9 */ - -#define I2C_OADDR1_ADDMODE ((uint16_t)0x8000) /* Addressing Mode (Slave mode) */ - -/******************* Bit definition for I2C_OADDR2 register *******************/ -#define I2C_OADDR2_ENDUAL ((uint8_t)0x01) /* Dual addressing mode enable */ -#define I2C_OADDR2_ADD2 ((uint8_t)0xFE) /* Interface address */ - -/******************** Bit definition for I2C_DATAR register ********************/ -#define I2C_DR_DATAR ((uint8_t)0xFF) /* 8-bit Data Register */ - -/******************* Bit definition for I2C_STAR1 register ********************/ -#define I2C_STAR1_SB ((uint16_t)0x0001) /* Start Bit (Master mode) */ -#define I2C_STAR1_ADDR ((uint16_t)0x0002) /* Address sent (master mode)/matched (slave mode) */ -#define I2C_STAR1_BTF ((uint16_t)0x0004) /* Byte Transfer Finished */ -#define I2C_STAR1_ADD10 ((uint16_t)0x0008) /* 10-bit header sent (Master mode) */ -#define I2C_STAR1_STOPF ((uint16_t)0x0010) /* Stop detection (Slave mode) */ -#define I2C_STAR1_RXNE ((uint16_t)0x0040) /* Data Register not Empty (receivers) */ -#define I2C_STAR1_TXE ((uint16_t)0x0080) /* Data Register Empty (transmitters) */ -#define I2C_STAR1_BERR ((uint16_t)0x0100) /* Bus Error */ -#define I2C_STAR1_ARLO ((uint16_t)0x0200) /* Arbitration Lost (master mode) */ -#define I2C_STAR1_AF ((uint16_t)0x0400) /* Acknowledge Failure */ -#define I2C_STAR1_OVR ((uint16_t)0x0800) /* Overrun/Underrun */ -#define I2C_STAR1_PECERR ((uint16_t)0x1000) /* PEC Error in reception */ -#define I2C_STAR1_TIMEOUT ((uint16_t)0x4000) /* Timeout or Tlow Error */ -#define I2C_STAR1_SMBALERT ((uint16_t)0x8000) /* SMBus Alert */ - -/******************* Bit definition for I2C_STAR2 register ********************/ -#define I2C_STAR2_MSL ((uint16_t)0x0001) /* Master/Slave */ -#define I2C_STAR2_BUSY ((uint16_t)0x0002) /* Bus Busy */ -#define I2C_STAR2_TRA ((uint16_t)0x0004) /* Transmitter/Receiver */ -#define I2C_STAR2_GENCALL ((uint16_t)0x0010) /* General Call Address (Slave mode) */ -#define I2C_STAR2_SMBDEFAULT ((uint16_t)0x0020) /* SMBus Device Default Address (Slave mode) */ -#define I2C_STAR2_SMBHOST ((uint16_t)0x0040) /* SMBus Host Header (Slave mode) */ -#define I2C_STAR2_DUALF ((uint16_t)0x0080) /* Dual Flag (Slave mode) */ -#define I2C_STAR2_PEC ((uint16_t)0xFF00) /* Packet Error Checking Register */ - -/******************* Bit definition for I2C_CKCFGR register ********************/ -#define I2C_CKCFGR_CCR ((uint16_t)0x0FFF) /* Clock Control Register in Fast/Standard mode (Master mode) */ -#define I2C_CKCFGR_DUTY ((uint16_t)0x4000) /* Fast Mode Duty Cycle */ -#define I2C_CKCFGR_FS ((uint16_t)0x8000) /* I2C Master Mode Selection */ - -/******************************************************************************/ -/* Power Control */ -/******************************************************************************/ - -/******************** Bit definition for PWR_CTLR register ********************/ -#define PWR_CTLR_LPDS ((uint16_t)0x0001) /* Low-Power Deepsleep */ -#define PWR_CTLR_PDDS ((uint16_t)0x0002) /* Power Down Deepsleep */ -#define PWR_CTLR_CWUF ((uint16_t)0x0004) /* Clear Wakeup Flag */ -#define PWR_CTLR_CSBF ((uint16_t)0x0008) /* Clear Standby Flag */ -#define PWR_CTLR_PVDE ((uint16_t)0x0010) /* Power Voltage Detector Enable */ - -#define PWR_CTLR_PLS ((uint16_t)0x00E0) /* PLS[2:0] bits (PVD Level Selection) */ -#define PWR_CTLR_PLS_0 ((uint16_t)0x0020) /* Bit 0 */ -#define PWR_CTLR_PLS_1 ((uint16_t)0x0040) /* Bit 1 */ -#define PWR_CTLR_PLS_2 ((uint16_t)0x0080) /* Bit 2 */ - -#define PWR_CTLR_PLS_MODE0 ((uint16_t)0x0000) /* PVD level 0 */ -#define PWR_CTLR_PLS_MODE1 ((uint16_t)0x0020) /* PVD level 1 */ -#define PWR_CTLR_PLS_MODE2 ((uint16_t)0x0040) /* PVD level 2 */ -#define PWR_CTLR_PLS_MODE3 ((uint16_t)0x0060) /* PVD level 3 */ - -#define PWR_CTLR_DBP ((uint16_t)0x0100) /* Disable Backup Domain write protection */ - -#define PWR_CTLR_LP_REG ((uint16_t)0x0200) /* Software configure flash into lower energy mode */ -#define PWR_CTLR_LP ((uint16_t)0x0C00) /* Software configure flash Status */ -#define PWR_CTLR_LP_0 ((uint16_t)0x0400) -#define PWR_CTLR_LP_1 ((uint16_t)0x0800) - -/******************* Bit definition for PWR_CSR register ********************/ -#define PWR_CSR_WUF ((uint16_t)0x0001) /* Wakeup Flag */ -#define PWR_CSR_SBF ((uint16_t)0x0002) /* Standby Flag */ -#define PWR_CSR_PVDO ((uint16_t)0x0004) /* PVD Output */ -#define PWR_CSR_EWUP ((uint16_t)0x0100) /* Enable WKUP pin */ -#define PWR_CSR_Flash_ack ((uint16_t)0x0200) /* Flash Status */ - -/******************************************************************************/ -/* Reset and Clock Control */ -/******************************************************************************/ - -/******************** Bit definition for RCC_CTLR register ********************/ -#define RCC_HSION ((uint32_t)0x00000001) /* Internal High Speed clock enable */ -#define RCC_HSIRDY ((uint32_t)0x00000002) /* Internal High Speed clock ready flag */ -#define RCC_HSITRIM ((uint32_t)0x000000F8) /* Internal High Speed clock trimming */ -#define RCC_HSICAL ((uint32_t)0x0000FF00) /* Internal High Speed clock Calibration */ -#define RCC_HSEON ((uint32_t)0x00010000) /* External High Speed clock enable */ -#define RCC_HSERDY ((uint32_t)0x00020000) /* External High Speed clock ready flag */ -#define RCC_HSEBYP ((uint32_t)0x00040000) /* External High Speed clock Bypass */ -#define RCC_CSSON ((uint32_t)0x00080000) /* Clock Security System enable */ -#define RCC_PLLON ((uint32_t)0x01000000) /* PLL enable */ -#define RCC_PLLRDY ((uint32_t)0x02000000) /* PLL clock ready flag */ - -/******************* Bit definition for RCC_CFGR0 register *******************/ -#define RCC_SW ((uint32_t)0x00000003) /* SW[1:0] bits (System clock Switch) */ -#define RCC_SW_0 ((uint32_t)0x00000001) /* Bit 0 */ -#define RCC_SW_1 ((uint32_t)0x00000002) /* Bit 1 */ - -#define RCC_SW_HSI ((uint32_t)0x00000000) /* HSI selected as system clock */ -#define RCC_SW_HSE ((uint32_t)0x00000001) /* HSE selected as system clock */ -#define RCC_SW_PLL ((uint32_t)0x00000002) /* PLL selected as system clock */ - -#define RCC_SWS ((uint32_t)0x0000000C) /* SWS[1:0] bits (System Clock Switch Status) */ -#define RCC_SWS_0 ((uint32_t)0x00000004) /* Bit 0 */ -#define RCC_SWS_1 ((uint32_t)0x00000008) /* Bit 1 */ - -#define RCC_SWS_HSI ((uint32_t)0x00000000) /* HSI oscillator used as system clock */ -#define RCC_SWS_HSE ((uint32_t)0x00000004) /* HSE oscillator used as system clock */ -#define RCC_SWS_PLL ((uint32_t)0x00000008) /* PLL used as system clock */ - -#define RCC_HPRE ((uint32_t)0x000000F0) /* HPRE[3:0] bits (AHB prescaler) */ -#define RCC_HPRE_0 ((uint32_t)0x00000010) /* Bit 0 */ -#define RCC_HPRE_1 ((uint32_t)0x00000020) /* Bit 1 */ -#define RCC_HPRE_2 ((uint32_t)0x00000040) /* Bit 2 */ -#define RCC_HPRE_3 ((uint32_t)0x00000080) /* Bit 3 */ - -#define RCC_HPRE_DIV1 ((uint32_t)0x00000000) /* SYSCLK not divided */ -#define RCC_HPRE_DIV2 ((uint32_t)0x00000010) /* SYSCLK divided by 2 */ -#define RCC_HPRE_DIV3 ((uint32_t)0x00000020) /* SYSCLK divided by 3 */ -#define RCC_HPRE_DIV4 ((uint32_t)0x00000030) /* SYSCLK divided by 4 */ -#define RCC_HPRE_DIV5 ((uint32_t)0x00000040) /* SYSCLK divided by 5 */ -#define RCC_HPRE_DIV6 ((uint32_t)0x00000050) /* SYSCLK divided by 6 */ -#define RCC_HPRE_DIV7 ((uint32_t)0x00000060) /* SYSCLK divided by 7 */ -#define RCC_HPRE_DIV8 ((uint32_t)0x00000070) /* SYSCLK divided by 8 */ -#define RCC_HPRE_DIV16 ((uint32_t)0x000000B0) /* SYSCLK divided by 16 */ -#define RCC_HPRE_DIV32 ((uint32_t)0x000000C0) /* SYSCLK divided by 32 */ -#define RCC_HPRE_DIV64 ((uint32_t)0x000000D0) /* SYSCLK divided by 64 */ -#define RCC_HPRE_DIV128 ((uint32_t)0x000000E0) /* SYSCLK divided by 128 */ -#define RCC_HPRE_DIV256 ((uint32_t)0x000000F0) /* SYSCLK divided by 256 */ - -#define RCC_PPRE1 ((uint32_t)0x00000700) /* PRE1[2:0] bits (APB1 prescaler) */ -#define RCC_PPRE1_0 ((uint32_t)0x00000100) /* Bit 0 */ -#define RCC_PPRE1_1 ((uint32_t)0x00000200) /* Bit 1 */ -#define RCC_PPRE1_2 ((uint32_t)0x00000400) /* Bit 2 */ - -#define RCC_PPRE1_DIV1 ((uint32_t)0x00000000) /* HCLK not divided */ -#define RCC_PPRE1_DIV2 ((uint32_t)0x00000400) /* HCLK divided by 2 */ -#define RCC_PPRE1_DIV4 ((uint32_t)0x00000500) /* HCLK divided by 4 */ -#define RCC_PPRE1_DIV8 ((uint32_t)0x00000600) /* HCLK divided by 8 */ -#define RCC_PPRE1_DIV16 ((uint32_t)0x00000700) /* HCLK divided by 16 */ - -#define RCC_PPRE2 ((uint32_t)0x00003800) /* PRE2[2:0] bits (APB2 prescaler) */ -#define RCC_PPRE2_0 ((uint32_t)0x00000800) /* Bit 0 */ -#define RCC_PPRE2_1 ((uint32_t)0x00001000) /* Bit 1 */ -#define RCC_PPRE2_2 ((uint32_t)0x00002000) /* Bit 2 */ - -#define RCC_PPRE2_DIV1 ((uint32_t)0x00000000) /* HCLK not divided */ -#define RCC_PPRE2_DIV2 ((uint32_t)0x00002000) /* HCLK divided by 2 */ -#define RCC_PPRE2_DIV4 ((uint32_t)0x00002800) /* HCLK divided by 4 */ -#define RCC_PPRE2_DIV8 ((uint32_t)0x00003000) /* HCLK divided by 8 */ -#define RCC_PPRE2_DIV16 ((uint32_t)0x00003800) /* HCLK divided by 16 */ - -#define RCC_ADCPRE ((uint32_t)0x0000C000) /* ADCPRE[1:0] bits (ADC prescaler) */ -#define RCC_ADCPRE_0 ((uint32_t)0x00004000) /* Bit 0 */ -#define RCC_ADCPRE_1 ((uint32_t)0x00008000) /* Bit 1 */ - -#define RCC_ADCPRE_DIV2 ((uint32_t)0x00000000) /* PCLK2 divided by 2 */ -#define RCC_ADCPRE_DIV4 ((uint32_t)0x00004000) /* PCLK2 divided by 4 */ -#define RCC_ADCPRE_DIV6 ((uint32_t)0x00008000) /* PCLK2 divided by 6 */ -#define RCC_ADCPRE_DIV8 ((uint32_t)0x0000C000) /* PCLK2 divided by 8 */ - -#define RCC_PLLSRC ((uint32_t)0x00010000) /* PLL entry clock source */ - -#define RCC_PLLXTPRE ((uint32_t)0x00020000) /* HSE divider for PLL entry */ - -#define RCC_PLLMULL ((uint32_t)0x003C0000) /* PLLMUL[3:0] bits (PLL multiplication factor) */ -#define RCC_PLLMULL_0 ((uint32_t)0x00040000) /* Bit 0 */ -#define RCC_PLLMULL_1 ((uint32_t)0x00080000) /* Bit 1 */ -#define RCC_PLLMULL_2 ((uint32_t)0x00100000) /* Bit 2 */ -#define RCC_PLLMULL_3 ((uint32_t)0x00200000) /* Bit 3 */ - -#define RCC_PLLXTPRE_HSE ((uint32_t)0x00000000) /* HSE clock not divided for PLL entry */ -#define RCC_PLLXTPRE_HSE_Div2 ((uint32_t)0x00020000) /* HSE clock divided by 2 for PLL entry */ - -#define RCC_PLLMULL2 ((uint32_t)0x00000000) /* PLL input clock*2 */ -#define RCC_PLLMULL3 ((uint32_t)0x00040000) /* PLL input clock*3 */ -#define RCC_PLLMULL4 ((uint32_t)0x00080000) /* PLL input clock*4 */ -#define RCC_PLLMULL5 ((uint32_t)0x000C0000) /* PLL input clock*5 */ -#define RCC_PLLMULL6 ((uint32_t)0x00100000) /* PLL input clock*6 */ -#define RCC_PLLMULL7 ((uint32_t)0x00140000) /* PLL input clock*7 */ -#define RCC_PLLMULL8 ((uint32_t)0x00180000) /* PLL input clock*8 */ -#define RCC_PLLMULL9 ((uint32_t)0x001C0000) /* PLL input clock*9 */ -#define RCC_PLLMULL10 ((uint32_t)0x00200000) /* PLL input clock10 */ -#define RCC_PLLMULL11 ((uint32_t)0x00240000) /* PLL input clock*11 */ -#define RCC_PLLMULL12 ((uint32_t)0x00280000) /* PLL input clock*12 */ -#define RCC_PLLMULL13 ((uint32_t)0x002C0000) /* PLL input clock*13 */ -#define RCC_PLLMULL14 ((uint32_t)0x00300000) /* PLL input clock*14 */ -#define RCC_PLLMULL15 ((uint32_t)0x00340000) /* PLL input clock*15 */ -#define RCC_PLLMULL16 ((uint32_t)0x00380000) /* PLL input clock*16 */ - -#define RCC_USBPRE ((uint32_t)0x00400000) /* USB Device prescaler */ - -#define RCC_CFGR0_MCO ((uint32_t)0x07000000) /* MCO[2:0] bits (Microcontroller Clock Output) */ -#define RCC_MCO_0 ((uint32_t)0x01000000) /* Bit 0 */ -#define RCC_MCO_1 ((uint32_t)0x02000000) /* Bit 1 */ -#define RCC_MCO_2 ((uint32_t)0x04000000) /* Bit 2 */ - -#define RCC_MCO_NOCLOCK ((uint32_t)0x00000000) /* No clock */ -#define RCC_CFGR0_MCO_SYSCLK ((uint32_t)0x04000000) /* System clock selected as MCO source */ -#define RCC_CFGR0_MCO_HSI ((uint32_t)0x05000000) /* HSI clock selected as MCO source */ -#define RCC_CFGR0_MCO_HSE ((uint32_t)0x06000000) /* HSE clock selected as MCO source */ -#define RCC_CFGR0_MCO_PLL ((uint32_t)0x07000000) /* PLL clock divided by 2 selected as MCO source */ - -/******************* Bit definition for RCC_CFGR2 register *******************/ - -/******************* Bit definition for RCC_INTR register ********************/ -#define RCC_LSIRDYF ((uint32_t)0x00000001) /* LSI Ready Interrupt flag */ -#define RCC_LSERDYF ((uint32_t)0x00000002) /* LSE Ready Interrupt flag */ -#define RCC_HSIRDYF ((uint32_t)0x00000004) /* HSI Ready Interrupt flag */ -#define RCC_HSERDYF ((uint32_t)0x00000008) /* HSE Ready Interrupt flag */ -#define RCC_PLLRDYF ((uint32_t)0x00000010) /* PLL Ready Interrupt flag */ -#define RCC_CSSF ((uint32_t)0x00000080) /* Clock Security System Interrupt flag */ -#define RCC_LSIRDYIE ((uint32_t)0x00000100) /* LSI Ready Interrupt Enable */ -#define RCC_LSERDYIE ((uint32_t)0x00000200) /* LSE Ready Interrupt Enable */ -#define RCC_HSIRDYIE ((uint32_t)0x00000400) /* HSI Ready Interrupt Enable */ -#define RCC_HSERDYIE ((uint32_t)0x00000800) /* HSE Ready Interrupt Enable */ -#define RCC_PLLRDYIE ((uint32_t)0x00001000) /* PLL Ready Interrupt Enable */ -#define RCC_LSIRDYC ((uint32_t)0x00010000) /* LSI Ready Interrupt Clear */ -#define RCC_LSERDYC ((uint32_t)0x00020000) /* LSE Ready Interrupt Clear */ -#define RCC_HSIRDYC ((uint32_t)0x00040000) /* HSI Ready Interrupt Clear */ -#define RCC_HSERDYC ((uint32_t)0x00080000) /* HSE Ready Interrupt Clear */ -#define RCC_PLLRDYC ((uint32_t)0x00100000) /* PLL Ready Interrupt Clear */ -#define RCC_CSSC ((uint32_t)0x00800000) /* Clock Security System Interrupt Clear */ - -/***************** Bit definition for RCC_APB2PRSTR register *****************/ -#define RCC_AFIORST ((uint32_t)0x00000001) /* Alternate Function I/O reset */ -#define RCC_IOPARST ((uint32_t)0x00000004) /* I/O port A reset */ -#define RCC_IOPBRST ((uint32_t)0x00000008) /* I/O port B reset */ -#define RCC_IOPCRST ((uint32_t)0x00000010) /* I/O port C reset */ -#define RCC_IOPDRST ((uint32_t)0x00000020) /* I/O port D reset */ -#define RCC_ADC1RST ((uint32_t)0x00000200) /* ADC 1 interface reset */ - -#define RCC_ADC2RST ((uint32_t)0x00000400) /* ADC 2 interface reset */ - -#define RCC_TIM1RST ((uint32_t)0x00000800) /* TIM1 Timer reset */ -#define RCC_SPI1RST ((uint32_t)0x00001000) /* SPI 1 reset */ -#define RCC_USART1RST ((uint32_t)0x00004000) /* USART1 reset */ - -#define RCC_IOPERST ((uint32_t)0x00000040) /* I/O port E reset */ - -/***************** Bit definition for RCC_APB1PRSTR register *****************/ -#define RCC_TIM2RST ((uint32_t)0x00000001) /* Timer 2 reset */ -#define RCC_TIM3RST ((uint32_t)0x00000002) /* Timer 3 reset */ -#define RCC_WWDGRST ((uint32_t)0x00000800) /* Window Watchdog reset */ -#define RCC_USART2RST ((uint32_t)0x00020000) /* USART 2 reset */ -#define RCC_USART3RST ((uint32_t)0x00040000) /* USART 3 reset */ -#define RCC_USART4RST ((uint32_t)0x00080000) /* USART 4 reset */ -#define RCC_I2C1RST ((uint32_t)0x00200000) /* I2C 1 reset */ - -#define RCC_CAN1RST ((uint32_t)0x02000000) /* CAN1 reset */ - -#define RCC_BKPRST ((uint32_t)0x08000000) /* Backup interface reset */ -#define RCC_PWRRST ((uint32_t)0x10000000) /* Power interface reset */ - -#define RCC_TIM4RST ((uint32_t)0x00000004) /* Timer 4 reset */ -#define RCC_SPI2RST ((uint32_t)0x00004000) /* SPI 2 reset */ -#define RCC_USART3RST ((uint32_t)0x00040000) /* USART 3 reset */ -#define RCC_I2C2RST ((uint32_t)0x00400000) /* I2C 2 reset */ - -#define RCC_USBRST ((uint32_t)0x00800000) /* USB Device reset */ - -/****************** Bit definition for RCC_AHBPCENR register ******************/ -#define RCC_DMA1EN ((uint32_t)0x0001) /* DMA1 clock enable */ -#define RCC_SRAMEN ((uint32_t)0x0004) /* SRAM interface clock enable */ -#define RCC_FLITFEN ((uint32_t)0x0010) /* FLITF clock enable */ -#define RCC_CRCEN ((uint32_t)0x0040) /* CRC clock enable */ -#define RCC_USBHD ((uint32_t)0x1000) -#define RCC_USBFS ((uint32_t)0x1000) -#define RCC_USBPD ((uint32_t)0x20000) - -/****************** Bit definition for RCC_APB2PCENR register *****************/ -#define RCC_AFIOEN ((uint32_t)0x00000001) /* Alternate Function I/O clock enable */ -#define RCC_IOPAEN ((uint32_t)0x00000004) /* I/O port A clock enable */ -#define RCC_IOPBEN ((uint32_t)0x00000008) /* I/O port B clock enable */ -#define RCC_IOPCEN ((uint32_t)0x00000010) /* I/O port C clock enable */ -#define RCC_IOPDEN ((uint32_t)0x00000020) /* I/O port D clock enable */ -#define RCC_ADC1EN ((uint32_t)0x00000200) /* ADC 1 interface clock enable */ - -#define RCC_ADC2EN ((uint32_t)0x00000400) /* ADC 2 interface clock enable */ - -#define RCC_TIM1EN ((uint32_t)0x00000800) /* TIM1 Timer clock enable */ -#define RCC_SPI1EN ((uint32_t)0x00001000) /* SPI 1 clock enable */ -#define RCC_USART1EN ((uint32_t)0x00004000) /* USART1 clock enable */ - -/***************** Bit definition for RCC_APB1PCENR register ******************/ -#define RCC_TIM2EN ((uint32_t)0x00000001) /* Timer 2 clock enabled*/ -#define RCC_TIM3EN ((uint32_t)0x00000002) /* Timer 3 clock enable */ -#define RCC_WWDGEN ((uint32_t)0x00000800) /* Window Watchdog clock enable */ -#define RCC_USART2EN ((uint32_t)0x00020000) /* USART 2 clock enable */ -#define RCC_USART3EN ((uint32_t)0x00040000) /* USART 3 clock enable */ -#define RCC_USART4EN ((uint32_t)0x00080000) /* USART 4 clock enable */ -#define RCC_I2C1EN ((uint32_t)0x00200000) /* I2C 1 clock enable */ - -#define RCC_BKPEN ((uint32_t)0x08000000) /* Backup interface clock enable */ -#define RCC_PWREN ((uint32_t)0x10000000) /* Power interface clock enable */ - -#define RCC_USBEN ((uint32_t)0x00800000) /* USB Device clock enable */ - -/******************* Bit definition for RCC_RSTSCKR register ********************/ -#define RCC_LSION ((uint32_t)0x00000001) /* Internal Low Speed oscillator enable */ -#define RCC_LSIRDY ((uint32_t)0x00000002) /* Internal Low Speed oscillator Ready */ -#define RCC_RMVF ((uint32_t)0x01000000) /* Remove reset flag */ -#define RCC_OPARSTF ((uint32_t)0x02000000) /* OPA reset flag */ -#define RCC_PINRSTF ((uint32_t)0x04000000) /* PIN reset flag */ -#define RCC_PORRSTF ((uint32_t)0x08000000) /* POR/PDR reset flag */ -#define RCC_SFTRSTF ((uint32_t)0x10000000) /* Software Reset flag */ -#define RCC_IWDGRSTF ((uint32_t)0x20000000) /* Independent Watchdog reset flag */ -#define RCC_WWDGRSTF ((uint32_t)0x40000000) /* Window watchdog reset flag */ -#define RCC_LPWRRSTF ((uint32_t)0x80000000) /* Low-Power reset flag */ - -/****************** Bit definition for RCC_AHBRSTR register *****************/ -#define RCC_USBFSRST ((uint32_t)0x00001000) /* USBFS reset */ -#define RCC_PIOCRST ((uint32_t)0x00002000) /* PIOC RST */ -#define RCC_USBPDRST ((uint32_t)0x00020000) /* USBPD reset */ - -/******************************************************************************/ -/* Serial Peripheral Interface */ -/******************************************************************************/ - -/******************* Bit definition for SPI_CTLR1 register ********************/ -#define SPI_CTLR1_CPHA ((uint16_t)0x0001) /* Clock Phase */ -#define SPI_CTLR1_CPOL ((uint16_t)0x0002) /* Clock Polarity */ -#define SPI_CTLR1_MSTR ((uint16_t)0x0004) /* Master Selection */ - -#define SPI_CTLR1_BR ((uint16_t)0x0038) /* BR[2:0] bits (Baud Rate Control) */ -#define SPI_CTLR1_BR_0 ((uint16_t)0x0008) /* Bit 0 */ -#define SPI_CTLR1_BR_1 ((uint16_t)0x0010) /* Bit 1 */ -#define SPI_CTLR1_BR_2 ((uint16_t)0x0020) /* Bit 2 */ - -#define SPI_CTLR1_SPE ((uint16_t)0x0040) /* SPI Enable */ -#define SPI_CTLR1_LSBFIRST ((uint16_t)0x0080) /* Frame Format */ -#define SPI_CTLR1_SSI ((uint16_t)0x0100) /* Internal slave select */ -#define SPI_CTLR1_SSM ((uint16_t)0x0200) /* Software slave management */ -#define SPI_CTLR1_RXONLY ((uint16_t)0x0400) /* Receive only */ -#define SPI_CTLR1_DFF ((uint16_t)0x0800) /* Data Frame Format */ -#define SPI_CTLR1_CRCNEXT ((uint16_t)0x1000) /* Transmit CRC next */ -#define SPI_CTLR1_CRCEN ((uint16_t)0x2000) /* Hardware CRC calculation enable */ -#define SPI_CTLR1_BIDIOE ((uint16_t)0x4000) /* Output enable in bidirectional mode */ -#define SPI_CTLR1_BIDIMODE ((uint16_t)0x8000) /* Bidirectional data mode enable */ - -/******************* Bit definition for SPI_CTLR2 register ********************/ -#define SPI_CTLR2_RXDMAEN ((uint8_t)0x01) /* Rx Buffer DMA Enable */ -#define SPI_CTLR2_TXDMAEN ((uint8_t)0x02) /* Tx Buffer DMA Enable */ -#define SPI_CTLR2_SSOE ((uint8_t)0x04) /* SS Output Enable */ -#define SPI_CTLR2_ERRIE ((uint8_t)0x20) /* Error Interrupt Enable */ -#define SPI_CTLR2_RXNEIE ((uint8_t)0x40) /* RX buffer Not Empty Interrupt Enable */ -#define SPI_CTLR2_TXEIE ((uint8_t)0x80) /* Tx buffer Empty Interrupt Enable */ -#define SPI_CTLR2_ODEN ((uint16_t)0x8000) /* SPI OD output Enable */ - -/******************** Bit definition for SPI_STATR register ********************/ -#define SPI_STATR_RXNE ((uint8_t)0x01) /* Receive buffer Not Empty */ -#define SPI_STATR_TXE ((uint8_t)0x02) /* Transmit buffer Empty */ -#define SPI_STATR_CHSIDE ((uint8_t)0x04) /* Channel side */ -#define SPI_STATR_UDR ((uint8_t)0x08) /* Underrun flag */ -#define SPI_STATR_CRCERR ((uint8_t)0x10) /* CRC Error flag */ -#define SPI_STATR_MODF ((uint8_t)0x20) /* Mode fault */ -#define SPI_STATR_OVR ((uint8_t)0x40) /* Overrun flag */ -#define SPI_STATR_BSY ((uint8_t)0x80) /* Busy flag */ - -/******************** Bit definition for SPI_DATAR register ********************/ -#define SPI_DATAR_DR ((uint16_t)0xFFFF) /* Data Register */ - -/******************* Bit definition for SPI_CRCR register ******************/ -#define SPI_CRCR_CRCPOLY ((uint16_t)0xFFFF) /* CRC polynomial register */ - -/****************** Bit definition for SPI_RCRCR register ******************/ -#define SPI_RCRCR_RXCRC ((uint16_t)0xFFFF) /* Rx CRC Register */ - -/****************** Bit definition for SPI_TCRCR register ******************/ -#define SPI_TCRCR_TXCRC ((uint16_t)0xFFFF) /* Tx CRC Register */ - -/****************** Bit definition for SPI_HSCR register *****************/ -#define SPI_HSCR_HSRXEN ((uint16_t)0x0001) /* Read Enable under SPI High speed mode */ - -/******************************************************************************/ -/* TIM */ -/******************************************************************************/ - -/******************* Bit definition for TIM_CTLR1 register ********************/ -#define TIM_CEN ((uint16_t)0x0001) /* Counter enable */ -#define TIM_UDIS ((uint16_t)0x0002) /* Update disable */ -#define TIM_URS ((uint16_t)0x0004) /* Update request source */ -#define TIM_OPM ((uint16_t)0x0008) /* One pulse mode */ -#define TIM_DIR ((uint16_t)0x0010) /* Direction */ - -#define TIM_CMS ((uint16_t)0x0060) /* CMS[1:0] bits (Center-aligned mode selection) */ -#define TIM_CMS_0 ((uint16_t)0x0020) /* Bit 0 */ -#define TIM_CMS_1 ((uint16_t)0x0040) /* Bit 1 */ - -#define TIM_ARPE ((uint16_t)0x0080) /* Auto-reload preload enable */ - -#define TIM_CTLR1_CKD ((uint16_t)0x0300) /* CKD[1:0] bits (clock division) */ -#define TIM_CKD_0 ((uint16_t)0x0100) /* Bit 0 */ -#define TIM_CKD_1 ((uint16_t)0x0200) /* Bit 1 */ - -#define TIM_CMP_BK ((uint16_t)0x1000) /* voltage comparator break enable, TIM1 only */ -#define TIM_CAPOV ((uint16_t)0x4000) /* Cfg mode of capture value */ -#define TIM_CAPLVL ((uint16_t)0x8000) - -/******************* Bit definition for TIM_CTLR2 register ********************/ -#define TIM_CCPC ((uint16_t)0x0001) /* Capture/Compare Preloaded Control */ -#define TIM_CCUS ((uint16_t)0x0004) /* Capture/Compare Control Update Selection */ -#define TIM_CCDS ((uint16_t)0x0008) /* Capture/Compare DMA Selection */ - -#define TIM_MMS ((uint16_t)0x0070) /* MMS[2:0] bits (Master Mode Selection) */ -#define TIM_MMS_0 ((uint16_t)0x0010) /* Bit 0 */ -#define TIM_MMS_1 ((uint16_t)0x0020) /* Bit 1 */ -#define TIM_MMS_2 ((uint16_t)0x0040) /* Bit 2 */ - -#define TIM_TI1S ((uint16_t)0x0080) /* TI1 Selection */ -#define TIM_OIS1 ((uint16_t)0x0100) /* Output Idle state 1 (OC1 output) */ -#define TIM_OIS1N ((uint16_t)0x0200) /* Output Idle state 1 (OC1N output) */ -#define TIM_OIS2 ((uint16_t)0x0400) /* Output Idle state 2 (OC2 output) */ -#define TIM_OIS2N ((uint16_t)0x0800) /* Output Idle state 2 (OC2N output) */ -#define TIM_OIS3 ((uint16_t)0x1000) /* Output Idle state 3 (OC3 output) */ -#define TIM_OIS3N ((uint16_t)0x2000) /* Output Idle state 3 (OC3N output) */ -#define TIM_OIS4 ((uint16_t)0x4000) /* Output Idle state 4 (OC4 output) */ - -/******************* Bit definition for TIM_SMCFGR register *******************/ -#define TIM_SMS ((uint16_t)0x0007) /* SMS[2:0] bits (Slave mode selection) */ -#define TIM_SMS_0 ((uint16_t)0x0001) /* Bit 0 */ -#define TIM_SMS_1 ((uint16_t)0x0002) /* Bit 1 */ -#define TIM_SMS_2 ((uint16_t)0x0004) /* Bit 2 */ - -#define TIM_TS ((uint16_t)0x0070) /* TS[2:0] bits (Trigger selection) */ -#define TIM_TS_0 ((uint16_t)0x0010) /* Bit 0 */ -#define TIM_TS_1 ((uint16_t)0x0020) /* Bit 1 */ -#define TIM_TS_2 ((uint16_t)0x0040) /* Bit 2 */ - -#define TIM_MSM ((uint16_t)0x0080) /* Master/slave mode */ - -#define TIM_ETF ((uint16_t)0x0F00) /* ETF[3:0] bits (External trigger filter) */ -#define TIM_ETF_0 ((uint16_t)0x0100) /* Bit 0 */ -#define TIM_ETF_1 ((uint16_t)0x0200) /* Bit 1 */ -#define TIM_ETF_2 ((uint16_t)0x0400) /* Bit 2 */ -#define TIM_ETF_3 ((uint16_t)0x0800) /* Bit 3 */ - -#define TIM_ETPS ((uint16_t)0x3000) /* ETPS[1:0] bits (External trigger prescaler) */ -#define TIM_ETPS_0 ((uint16_t)0x1000) /* Bit 0 */ -#define TIM_ETPS_1 ((uint16_t)0x2000) /* Bit 1 */ - -#define TIM_ECE ((uint16_t)0x4000) /* External clock enable */ -#define TIM_ETP ((uint16_t)0x8000) /* External trigger polarity */ - -/******************* Bit definition for TIM_DMAINTENR register *******************/ -#define TIM_UIE ((uint16_t)0x0001) /* Update interrupt enable */ -#define TIM_CC1IE ((uint16_t)0x0002) /* Capture/Compare 1 interrupt enable */ -#define TIM_CC2IE ((uint16_t)0x0004) /* Capture/Compare 2 interrupt enable */ -#define TIM_CC3IE ((uint16_t)0x0008) /* Capture/Compare 3 interrupt enable */ -#define TIM_CC4IE ((uint16_t)0x0010) /* Capture/Compare 4 interrupt enable */ -#define TIM_COMIE ((uint16_t)0x0020) /* COM interrupt enable */ -#define TIM_TIE ((uint16_t)0x0040) /* Trigger interrupt enable */ -#define TIM_BIE ((uint16_t)0x0080) /* Break interrupt enable */ -#define TIM_UDE ((uint16_t)0x0100) /* Update DMA request enable */ -#define TIM_CC1DE ((uint16_t)0x0200) /* Capture/Compare 1 DMA request enable */ -#define TIM_CC2DE ((uint16_t)0x0400) /* Capture/Compare 2 DMA request enable */ -#define TIM_CC3DE ((uint16_t)0x0800) /* Capture/Compare 3 DMA request enable */ -#define TIM_CC4DE ((uint16_t)0x1000) /* Capture/Compare 4 DMA request enable */ -#define TIM_COMDE ((uint16_t)0x2000) /* COM DMA request enable */ -#define TIM_TDE ((uint16_t)0x4000) /* Trigger DMA request enable */ - -/******************** Bit definition for TIM_INTFR register ********************/ -#define TIM_UIF ((uint16_t)0x0001) /* Update interrupt Flag */ -#define TIM_CC1IF ((uint16_t)0x0002) /* Capture/Compare 1 interrupt Flag */ -#define TIM_CC2IF ((uint16_t)0x0004) /* Capture/Compare 2 interrupt Flag */ -#define TIM_CC3IF ((uint16_t)0x0008) /* Capture/Compare 3 interrupt Flag */ -#define TIM_CC4IF ((uint16_t)0x0010) /* Capture/Compare 4 interrupt Flag */ -#define TIM_COMIF ((uint16_t)0x0020) /* COM interrupt Flag */ -#define TIM_TIF ((uint16_t)0x0040) /* Trigger interrupt Flag */ -#define TIM_BIF ((uint16_t)0x0080) /* Break interrupt Flag */ -#define TIM_CC1OF ((uint16_t)0x0200) /* Capture/Compare 1 Overcapture Flag */ -#define TIM_CC2OF ((uint16_t)0x0400) /* Capture/Compare 2 Overcapture Flag */ -#define TIM_CC3OF ((uint16_t)0x0800) /* Capture/Compare 3 Overcapture Flag */ -#define TIM_CC4OF ((uint16_t)0x1000) /* Capture/Compare 4 Overcapture Flag */ - -/******************* Bit definition for TIM_SWEVGR register ********************/ -#define TIM_UG ((uint8_t)0x01) /* Update Generation */ -#define TIM_CC1G ((uint8_t)0x02) /* Capture/Compare 1 Generation */ -#define TIM_CC2G ((uint8_t)0x04) /* Capture/Compare 2 Generation */ -#define TIM_CC3G ((uint8_t)0x08) /* Capture/Compare 3 Generation */ -#define TIM_CC4G ((uint8_t)0x10) /* Capture/Compare 4 Generation */ -#define TIM_COMG ((uint8_t)0x20) /* Capture/Compare Control Update Generation */ -#define TIM_TG ((uint8_t)0x40) /* Trigger Generation */ -#define TIM_BG ((uint8_t)0x80) /* Break Generation */ - -/****************** Bit definition for TIM_CHCTLR1 register *******************/ -#define TIM_CC1S ((uint16_t)0x0003) /* CC1S[1:0] bits (Capture/Compare 1 Selection) */ -#define TIM_CC1S_0 ((uint16_t)0x0001) /* Bit 0 */ -#define TIM_CC1S_1 ((uint16_t)0x0002) /* Bit 1 */ - -#define TIM_OC1FE ((uint16_t)0x0004) /* Output Compare 1 Fast enable */ -#define TIM_OC1PE ((uint16_t)0x0008) /* Output Compare 1 Preload enable */ - -#define TIM_OC1M ((uint16_t)0x0070) /* OC1M[2:0] bits (Output Compare 1 Mode) */ -#define TIM_OC1M_0 ((uint16_t)0x0010) /* Bit 0 */ -#define TIM_OC1M_1 ((uint16_t)0x0020) /* Bit 1 */ -#define TIM_OC1M_2 ((uint16_t)0x0040) /* Bit 2 */ - -#define TIM_OC1CE ((uint16_t)0x0080) /* Output Compare 1Clear Enable */ - -#define TIM_CC2S ((uint16_t)0x0300) /* CC2S[1:0] bits (Capture/Compare 2 Selection) */ -#define TIM_CC2S_0 ((uint16_t)0x0100) /* Bit 0 */ -#define TIM_CC2S_1 ((uint16_t)0x0200) /* Bit 1 */ - -#define TIM_OC2FE ((uint16_t)0x0400) /* Output Compare 2 Fast enable */ -#define TIM_OC2PE ((uint16_t)0x0800) /* Output Compare 2 Preload enable */ - -#define TIM_OC2M ((uint16_t)0x7000) /* OC2M[2:0] bits (Output Compare 2 Mode) */ -#define TIM_OC2M_0 ((uint16_t)0x1000) /* Bit 0 */ -#define TIM_OC2M_1 ((uint16_t)0x2000) /* Bit 1 */ -#define TIM_OC2M_2 ((uint16_t)0x4000) /* Bit 2 */ - -#define TIM_OC2CE ((uint16_t)0x8000) /* Output Compare 2 Clear Enable */ - -#define TIM_IC1PSC ((uint16_t)0x000C) /* IC1PSC[1:0] bits (Input Capture 1 Prescaler) */ -#define TIM_IC1PSC_0 ((uint16_t)0x0004) /* Bit 0 */ -#define TIM_IC1PSC_1 ((uint16_t)0x0008) /* Bit 1 */ - -#define TIM_IC1F ((uint16_t)0x00F0) /* IC1F[3:0] bits (Input Capture 1 Filter) */ -#define TIM_IC1F_0 ((uint16_t)0x0010) /* Bit 0 */ -#define TIM_IC1F_1 ((uint16_t)0x0020) /* Bit 1 */ -#define TIM_IC1F_2 ((uint16_t)0x0040) /* Bit 2 */ -#define TIM_IC1F_3 ((uint16_t)0x0080) /* Bit 3 */ - -#define TIM_IC2PSC ((uint16_t)0x0C00) /* IC2PSC[1:0] bits (Input Capture 2 Prescaler) */ -#define TIM_IC2PSC_0 ((uint16_t)0x0400) /* Bit 0 */ -#define TIM_IC2PSC_1 ((uint16_t)0x0800) /* Bit 1 */ - -#define TIM_IC2F ((uint16_t)0xF000) /* IC2F[3:0] bits (Input Capture 2 Filter) */ -#define TIM_IC2F_0 ((uint16_t)0x1000) /* Bit 0 */ -#define TIM_IC2F_1 ((uint16_t)0x2000) /* Bit 1 */ -#define TIM_IC2F_2 ((uint16_t)0x4000) /* Bit 2 */ -#define TIM_IC2F_3 ((uint16_t)0x8000) /* Bit 3 */ - -/****************** Bit definition for TIM_CHCTLR2 register *******************/ -#define TIM_CC3S ((uint16_t)0x0003) /* CC3S[1:0] bits (Capture/Compare 3 Selection) */ -#define TIM_CC3S_0 ((uint16_t)0x0001) /* Bit 0 */ -#define TIM_CC3S_1 ((uint16_t)0x0002) /* Bit 1 */ - -#define TIM_OC3FE ((uint16_t)0x0004) /* Output Compare 3 Fast enable */ -#define TIM_OC3PE ((uint16_t)0x0008) /* Output Compare 3 Preload enable */ - -#define TIM_OC3M ((uint16_t)0x0070) /* OC3M[2:0] bits (Output Compare 3 Mode) */ -#define TIM_OC3M_0 ((uint16_t)0x0010) /* Bit 0 */ -#define TIM_OC3M_1 ((uint16_t)0x0020) /* Bit 1 */ -#define TIM_OC3M_2 ((uint16_t)0x0040) /* Bit 2 */ - -#define TIM_OC3CE ((uint16_t)0x0080) /* Output Compare 3 Clear Enable */ - -#define TIM_CC4S ((uint16_t)0x0300) /* CC4S[1:0] bits (Capture/Compare 4 Selection) */ -#define TIM_CC4S_0 ((uint16_t)0x0100) /* Bit 0 */ -#define TIM_CC4S_1 ((uint16_t)0x0200) /* Bit 1 */ - -#define TIM_OC4FE ((uint16_t)0x0400) /* Output Compare 4 Fast enable */ -#define TIM_OC4PE ((uint16_t)0x0800) /* Output Compare 4 Preload enable */ - -#define TIM_OC4M ((uint16_t)0x7000) /* OC4M[2:0] bits (Output Compare 4 Mode) */ -#define TIM_OC4M_0 ((uint16_t)0x1000) /* Bit 0 */ -#define TIM_OC4M_1 ((uint16_t)0x2000) /* Bit 1 */ -#define TIM_OC4M_2 ((uint16_t)0x4000) /* Bit 2 */ - -#define TIM_OC4CE ((uint16_t)0x8000) /* Output Compare 4 Clear Enable */ - -#define TIM_IC3PSC ((uint16_t)0x000C) /* IC3PSC[1:0] bits (Input Capture 3 Prescaler) */ -#define TIM_IC3PSC_0 ((uint16_t)0x0004) /* Bit 0 */ -#define TIM_IC3PSC_1 ((uint16_t)0x0008) /* Bit 1 */ - -#define TIM_IC3F ((uint16_t)0x00F0) /* IC3F[3:0] bits (Input Capture 3 Filter) */ -#define TIM_IC3F_0 ((uint16_t)0x0010) /* Bit 0 */ -#define TIM_IC3F_1 ((uint16_t)0x0020) /* Bit 1 */ -#define TIM_IC3F_2 ((uint16_t)0x0040) /* Bit 2 */ -#define TIM_IC3F_3 ((uint16_t)0x0080) /* Bit 3 */ - -#define TIM_IC4PSC ((uint16_t)0x0C00) /* IC4PSC[1:0] bits (Input Capture 4 Prescaler) */ -#define TIM_IC4PSC_0 ((uint16_t)0x0400) /* Bit 0 */ -#define TIM_IC4PSC_1 ((uint16_t)0x0800) /* Bit 1 */ - -#define TIM_IC4F ((uint16_t)0xF000) /* IC4F[3:0] bits (Input Capture 4 Filter) */ -#define TIM_IC4F_0 ((uint16_t)0x1000) /* Bit 0 */ -#define TIM_IC4F_1 ((uint16_t)0x2000) /* Bit 1 */ -#define TIM_IC4F_2 ((uint16_t)0x4000) /* Bit 2 */ -#define TIM_IC4F_3 ((uint16_t)0x8000) /* Bit 3 */ - -/******************* Bit definition for TIM_CCER register *******************/ -#define TIM_CC1E ((uint16_t)0x0001) /* Capture/Compare 1 output enable */ -#define TIM_CC1P ((uint16_t)0x0002) /* Capture/Compare 1 output Polarity */ -#define TIM_CC1NE ((uint16_t)0x0004) /* Capture/Compare 1 Complementary output enable */ -#define TIM_CC1NP ((uint16_t)0x0008) /* Capture/Compare 1 Complementary output Polarity */ -#define TIM_CC2E ((uint16_t)0x0010) /* Capture/Compare 2 output enable */ -#define TIM_CC2P ((uint16_t)0x0020) /* Capture/Compare 2 output Polarity */ -#define TIM_CC2NE ((uint16_t)0x0040) /* Capture/Compare 2 Complementary output enable */ -#define TIM_CC2NP ((uint16_t)0x0080) /* Capture/Compare 2 Complementary output Polarity */ -#define TIM_CC3E ((uint16_t)0x0100) /* Capture/Compare 3 output enable */ -#define TIM_CC3P ((uint16_t)0x0200) /* Capture/Compare 3 output Polarity */ -#define TIM_CC3NE ((uint16_t)0x0400) /* Capture/Compare 3 Complementary output enable */ -#define TIM_CC3NP ((uint16_t)0x0800) /* Capture/Compare 3 Complementary output Polarity */ -#define TIM_CC4E ((uint16_t)0x1000) /* Capture/Compare 4 output enable */ -#define TIM_CC4P ((uint16_t)0x2000) /* Capture/Compare 4 output Polarity */ -#define TIM_CC4NP ((uint16_t)0x8000) /* Capture/Compare 4 Complementary output Polarity */ - -/******************* Bit definition for TIM_CNT register ********************/ -#define TIM_CNT ((uint16_t)0xFFFF) /* Counter Value */ - -/******************* Bit definition for TIM_PSC register ********************/ -#define TIM_PSC ((uint16_t)0xFFFF) /* Prescaler Value */ - -/******************* Bit definition for TIM_ATRLR register ********************/ -#define TIM_ARR ((uint16_t)0xFFFF) /* actual auto-reload Value */ - -/******************* Bit definition for TIM_RPTCR register ********************/ -#define TIM_REP ((uint8_t)0xFF) /* Repetition Counter Value */ - -/******************* Bit definition for TIM_CH1CVR register *******************/ -#define TIM_CCR1 ((uint16_t)0xFFFF) /* Capture/Compare 1 Value */ -#define TIM_LEVEL1 ((uint32_t)0x00010000) - -/******************* Bit definition for TIM_CH2CVR register *******************/ -#define TIM_CCR2 ((uint16_t)0xFFFF) /* Capture/Compare 2 Value */ -#define TIM_LEVEL2 ((uint32_t)0x00010000) - -/******************* Bit definition for TIM_CH3CVR register *******************/ -#define TIM_CCR3 ((uint16_t)0xFFFF) /* Capture/Compare 3 Value */ -#define TIM_LEVEL3 ((uint32_t)0x00010000) - -/******************* Bit definition for TIM_CH4CVR register *******************/ -#define TIM_CCR4 ((uint16_t)0xFFFF) /* Capture/Compare 4 Value */ -#define TIM_LEVEL4 ((uint32_t)0x00010000) - -/******************* Bit definition for TIM_BDTR register *******************/ -#define TIM_DTG ((uint16_t)0x00FF) /* DTG[0:7] bits (Dead-Time Generator set-up) */ -#define TIM_DTG_0 ((uint16_t)0x0001) /* Bit 0 */ -#define TIM_DTG_1 ((uint16_t)0x0002) /* Bit 1 */ -#define TIM_DTG_2 ((uint16_t)0x0004) /* Bit 2 */ -#define TIM_DTG_3 ((uint16_t)0x0008) /* Bit 3 */ -#define TIM_DTG_4 ((uint16_t)0x0010) /* Bit 4 */ -#define TIM_DTG_5 ((uint16_t)0x0020) /* Bit 5 */ -#define TIM_DTG_6 ((uint16_t)0x0040) /* Bit 6 */ -#define TIM_DTG_7 ((uint16_t)0x0080) /* Bit 7 */ - -#define TIM_LOCK ((uint16_t)0x0300) /* LOCK[1:0] bits (Lock Configuration) */ -#define TIM_LOCK_0 ((uint16_t)0x0100) /* Bit 0 */ -#define TIM_LOCK_1 ((uint16_t)0x0200) /* Bit 1 */ - -#define TIM_OSSI ((uint16_t)0x0400) /* Off-State Selection for Idle mode */ -#define TIM_OSSR ((uint16_t)0x0800) /* Off-State Selection for Run mode */ -#define TIM_BKE ((uint16_t)0x1000) /* Break enable */ -#define TIM_BKP ((uint16_t)0x2000) /* Break Polarity */ -#define TIM_AOE ((uint16_t)0x4000) /* Automatic Output enable */ -#define TIM_MOE ((uint16_t)0x8000) /* Main Output enable */ - -/******************* Bit definition for TIM_DMACFGR register ********************/ -#define TIM_DBA ((uint16_t)0x001F) /* DBA[4:0] bits (DMA Base Address) */ -#define TIM_DBA_0 ((uint16_t)0x0001) /* Bit 0 */ -#define TIM_DBA_1 ((uint16_t)0x0002) /* Bit 1 */ -#define TIM_DBA_2 ((uint16_t)0x0004) /* Bit 2 */ -#define TIM_DBA_3 ((uint16_t)0x0008) /* Bit 3 */ -#define TIM_DBA_4 ((uint16_t)0x0010) /* Bit 4 */ - -#define TIM_DBL ((uint16_t)0x1F00) /* DBL[4:0] bits (DMA Burst Length) */ -#define TIM_DBL_0 ((uint16_t)0x0100) /* Bit 0 */ -#define TIM_DBL_1 ((uint16_t)0x0200) /* Bit 1 */ -#define TIM_DBL_2 ((uint16_t)0x0400) /* Bit 2 */ -#define TIM_DBL_3 ((uint16_t)0x0800) /* Bit 3 */ -#define TIM_DBL_4 ((uint16_t)0x1000) /* Bit 4 */ - -/******************* Bit definition for TIM_DMAADR register *******************/ -#define TIM_DMAR_DMAB ((uint16_t)0xFFFF) /* DMA register for burst accesses */ - -/******************* Bit definition for TIM_SPEC register *******************/ -#define TIM_SPEC_PWM_EN_1_2 ((uint16_t)0x0001) /* Channel 1 and Channel 2 alternate */ -#define TIM_SPEC_PWM_EN_3_4 ((uint16_t)0x0002) /* Channel 3 and Channel 4 alternate */ -#define TIM_SPEC_PWM_OC1 ((uint16_t)0x0010) /* Channel 1 invalid level under alternate mode */ -#define TIM_SPEC_PWM_OC2 ((uint16_t)0x0020) /* Channel 2 invalid level under alternate mode */ -#define TIM_SPEC_PWM_OC3 ((uint16_t)0x0040) /* Channel 3 invalid level under alternate mode */ -#define TIM_SPEC_PWM_OC4 ((uint16_t)0x0080) /* Channel 4 invalid level under alternate mode */ -#define TIM_SPEC_TOGGLE ((uint16_t)0x8000) /* valid channel indicator */ - -/******************************************************************************/ -/* Universal Synchronous Asynchronous Receiver Transmitter */ -/******************************************************************************/ - -/******************* Bit definition for USART_STATR register *******************/ -#define USART_STATR_PE ((uint16_t)0x0001) /* Parity Error */ -#define USART_STATR_FE ((uint16_t)0x0002) /* Framing Error */ -#define USART_STATR_NE ((uint16_t)0x0004) /* Noise Error Flag */ -#define USART_STATR_ORE ((uint16_t)0x0008) /* OverRun Error */ -#define USART_STATR_IDLE ((uint16_t)0x0010) /* IDLE line detected */ -#define USART_STATR_RXNE ((uint16_t)0x0020) /* Read Data Register Not Empty */ -#define USART_STATR_TC ((uint16_t)0x0040) /* Transmission Complete */ -#define USART_STATR_TXE ((uint16_t)0x0080) /* Transmit Data Register Empty */ -#define USART_STATR_LBD ((uint16_t)0x0100) /* LIN Break Detection Flag */ -#define USART_STATR_CTS ((uint16_t)0x0200) /* CTS Flag */ - -/******************* Bit definition for USART_DATAR register *******************/ -#define USART_DATAR_DR ((uint16_t)0x01FF) /* Data value */ - -/****************** Bit definition for USART_BRR register *******************/ -#define USART_BRR_DIV_Fraction ((uint16_t)0x000F) /* Fraction of USARTDIV */ -#define USART_BRR_DIV_Mantissa ((uint16_t)0xFFF0) /* Mantissa of USARTDIV */ - -/****************** Bit definition for USART_CTLR1 register *******************/ -#define USART_CTLR1_SBK ((uint16_t)0x0001) /* Send Break */ -#define USART_CTLR1_RWU ((uint16_t)0x0002) /* Receiver wakeup */ -#define USART_CTLR1_RE ((uint16_t)0x0004) /* Receiver Enable */ -#define USART_CTLR1_TE ((uint16_t)0x0008) /* Transmitter Enable */ -#define USART_CTLR1_IDLEIE ((uint16_t)0x0010) /* IDLE Interrupt Enable */ -#define USART_CTLR1_RXNEIE ((uint16_t)0x0020) /* RXNE Interrupt Enable */ -#define USART_CTLR1_TCIE ((uint16_t)0x0040) /* Transmission Complete Interrupt Enable */ -#define USART_CTLR1_TXEIE ((uint16_t)0x0080) /* PE Interrupt Enable */ -#define USART_CTLR1_PEIE ((uint16_t)0x0100) /* PE Interrupt Enable */ -#define USART_CTLR1_PS ((uint16_t)0x0200) /* Parity Selection */ -#define USART_CTLR1_PCE ((uint16_t)0x0400) /* Parity Control Enable */ -#define USART_CTLR1_WAKE ((uint16_t)0x0800) /* Wakeup method */ -#define USART_CTLR1_M ((uint16_t)0x1000) /* Word length */ -#define USART_CTLR1_UE ((uint16_t)0x2000) /* USART Enable */ -#define USART_CTLR1_OVER8 ((uint16_t)0x8000) /* USART Oversmapling 8-bits */ - -/****************** Bit definition for USART_CTLR2 register *******************/ -#define USART_CTLR2_ADD ((uint16_t)0x000F) /* Address of the USART node */ -#define USART_CTLR2_LBDL ((uint16_t)0x0020) /* LIN Break Detection Length */ -#define USART_CTLR2_LBDIE ((uint16_t)0x0040) /* LIN Break Detection Interrupt Enable */ -#define USART_CTLR2_LBCL ((uint16_t)0x0100) /* Last Bit Clock pulse */ -#define USART_CTLR2_CPHA ((uint16_t)0x0200) /* Clock Phase */ -#define USART_CTLR2_CPOL ((uint16_t)0x0400) /* Clock Polarity */ -#define USART_CTLR2_CLKEN ((uint16_t)0x0800) /* Clock Enable */ - -#define USART_CTLR2_STOP ((uint16_t)0x3000) /* STOP[1:0] bits (STOP bits) */ -#define USART_CTLR2_STOP_0 ((uint16_t)0x1000) /* Bit 0 */ -#define USART_CTLR2_STOP_1 ((uint16_t)0x2000) /* Bit 1 */ - -#define USART_CTLR2_LINEN ((uint16_t)0x4000) /* LIN mode enable */ - -/****************** Bit definition for USART_CTLR3 register *******************/ -#define USART_CTLR3_EIE ((uint16_t)0x0001) /* Error Interrupt Enable */ -#define USART_CTLR3_IREN ((uint16_t)0x0002) /* IrDA mode Enable */ -#define USART_CTLR3_IRLP ((uint16_t)0x0004) /* IrDA Low-Power */ -#define USART_CTLR3_HDSEL ((uint16_t)0x0008) /* Half-Duplex Selection */ -#define USART_CTLR3_NACK ((uint16_t)0x0010) /* Smartcard NACK enable */ -#define USART_CTLR3_SCEN ((uint16_t)0x0020) /* Smartcard mode enable */ -#define USART_CTLR3_DMAR ((uint16_t)0x0040) /* DMA Enable Receiver */ -#define USART_CTLR3_DMAT ((uint16_t)0x0080) /* DMA Enable Transmitter */ -#define USART_CTLR3_RTSE ((uint16_t)0x0100) /* RTS Enable */ -#define USART_CTLR3_CTSE ((uint16_t)0x0200) /* CTS Enable */ -#define USART_CTLR3_CTSIE ((uint16_t)0x0400) /* CTS Interrupt Enable */ -#define USART_CTLR3_ONEBIT ((uint16_t)0x0800) /* One Bit method */ - -/****************** Bit definition for USART_GPR register ******************/ -#define USART_GPR_PSC ((uint16_t)0x00FF) /* PSC[7:0] bits (Prescaler value) */ -#define USART_GPR_PSC_0 ((uint16_t)0x0001) /* Bit 0 */ -#define USART_GPR_PSC_1 ((uint16_t)0x0002) /* Bit 1 */ -#define USART_GPR_PSC_2 ((uint16_t)0x0004) /* Bit 2 */ -#define USART_GPR_PSC_3 ((uint16_t)0x0008) /* Bit 3 */ -#define USART_GPR_PSC_4 ((uint16_t)0x0010) /* Bit 4 */ -#define USART_GPR_PSC_5 ((uint16_t)0x0020) /* Bit 5 */ -#define USART_GPR_PSC_6 ((uint16_t)0x0040) /* Bit 6 */ -#define USART_GPR_PSC_7 ((uint16_t)0x0080) /* Bit 7 */ - -#define USART_GPR_GT ((uint16_t)0xFF00) /* Guard time value */ - -/******************************************************************************/ -/* Window WATCHDOG */ -/******************************************************************************/ - -/******************* Bit definition for WWDG_CTLR register ********************/ -#define WWDG_CTLR_T ((uint8_t)0x7F) /* T[6:0] bits (7-Bit counter (MSB to LSB)) */ -#define WWDG_CTLR_T0 ((uint8_t)0x01) /* Bit 0 */ -#define WWDG_CTLR_T1 ((uint8_t)0x02) /* Bit 1 */ -#define WWDG_CTLR_T2 ((uint8_t)0x04) /* Bit 2 */ -#define WWDG_CTLR_T3 ((uint8_t)0x08) /* Bit 3 */ -#define WWDG_CTLR_T4 ((uint8_t)0x10) /* Bit 4 */ -#define WWDG_CTLR_T5 ((uint8_t)0x20) /* Bit 5 */ -#define WWDG_CTLR_T6 ((uint8_t)0x40) /* Bit 6 */ - -#define WWDG_CTLR_WDGA ((uint8_t)0x80) /* Activation bit */ - -/******************* Bit definition for WWDG_CFGR register *******************/ -#define WWDG_CFGR_W ((uint16_t)0x007F) /* W[6:0] bits (7-bit window value) */ -#define WWDG_CFGR_W0 ((uint16_t)0x0001) /* Bit 0 */ -#define WWDG_CFGR_W1 ((uint16_t)0x0002) /* Bit 1 */ -#define WWDG_CFGR_W2 ((uint16_t)0x0004) /* Bit 2 */ -#define WWDG_CFGR_W3 ((uint16_t)0x0008) /* Bit 3 */ -#define WWDG_CFGR_W4 ((uint16_t)0x0010) /* Bit 4 */ -#define WWDG_CFGR_W5 ((uint16_t)0x0020) /* Bit 5 */ -#define WWDG_CFGR_W6 ((uint16_t)0x0040) /* Bit 6 */ - -#define WWDG_CFGR_WDGTB ((uint16_t)0x0180) /* WDGTB[1:0] bits (Timer Base) */ -#define WWDG_CFGR_WDGTB0 ((uint16_t)0x0080) /* Bit 0 */ -#define WWDG_CFGR_WDGTB1 ((uint16_t)0x0100) /* Bit 1 */ - -#define WWDG_CFGR_EWI ((uint16_t)0x0200) /* Early Wakeup Interrupt */ - -/******************* Bit definition for WWDG_STATR register ********************/ -#define WWDG_STATR_EWIF ((uint8_t)0x01) /* Early Wakeup Interrupt Flag */ - -/******************************************************************************/ -/* ENHANCED FUNNCTION */ -/******************************************************************************/ - -/**************************** Enhanced register *****************************/ -#define EXTEN_LOCKUP_EN ((uint32_t)0x00000040) /* Bit 5 */ -#define EXTEN_LOCKUP_RSTF ((uint32_t)0x00000080) /* Bit 7 */ - -#define EXTEN_LDO_TRIM ((uint32_t)0x00000400) /* Bit 10 */ - -#ifdef __cplusplus -} -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* ch32v00x_gpio.c -----------------------------------------------------------*/ -/* MASK */ -#define LSB_MASK ((uint16_t)0xFFFF) -#define DBGAFR_POSITION_MASK ((uint32_t)0x000F0000) -#define DBGAFR_SDI_MASK ((uint32_t)0xF8FFFFFF) -#define DBGAFR_LOCATION_MASK ((uint32_t)0x00200000) -#define DBGAFR_NUMBITS_MASK ((uint32_t)0x00100000) - -/* ch32v00x_adc.c ------------------------------------------------------------*/ - -/* ADC DISCNUM mask */ -#define CTLR1_DISCNUM_Reset ((uint32_t)0xFFFF1FFF) - -/* ADC DISCEN mask */ -#define CTLR1_DISCEN_Set ((uint32_t)0x00000800) -#define CTLR1_DISCEN_Reset ((uint32_t)0xFFFFF7FF) - -/* ADC JAUTO mask */ -#define CTLR1_JAUTO_Set ((uint32_t)0x00000400) -#define CTLR1_JAUTO_Reset ((uint32_t)0xFFFFFBFF) - -/* ADC JDISCEN mask */ -#define CTLR1_JDISCEN_Set ((uint32_t)0x00001000) -#define CTLR1_JDISCEN_Reset ((uint32_t)0xFFFFEFFF) - -/* ADC AWDCH mask */ -#define CTLR1_AWDCH_Reset ((uint32_t)0xFFFFFFE0) - -/* ADC Analog watchdog enable mode mask */ -#define CTLR1_AWDMode_Reset ((uint32_t)0xFF3FFDFF) - -///* CTLR1 register Mask */ -// Editor's Note: Overloaded Definition -#define ADC_CTLR1_CLEAR_Mask ((uint32_t)0xFFF0FEFF) - -/* ADC ADON mask */ -#define CTLR2_ADON_Set ((uint32_t)0x00000001) -#define CTLR2_ADON_Reset ((uint32_t)0xFFFFFFFE) - -/* ADC DMA mask */ -#define CTLR2_DMA_Set ((uint32_t)0x00000100) -#define CTLR2_DMA_Reset ((uint32_t)0xFFFFFEFF) - -/* ADC RSTCAL mask */ -#define CTLR2_RSTCAL_Set ((uint32_t)0x00000008) - -/* ADC CAL mask */ -#define CTLR2_CAL_Set ((uint32_t)0x00000004) - -/* ADC SWSTART mask */ -#define CTLR2_SWSTART_Set ((uint32_t)0x00400000) - -/* ADC EXTTRIG mask */ -#define CTLR2_EXTTRIG_Set ((uint32_t)0x00100000) -#define CTLR2_EXTTRIG_Reset ((uint32_t)0xFFEFFFFF) - -/* ADC Software start mask */ -#define CTLR2_EXTTRIG_SWSTART_Set ((uint32_t)0x00500000) -#define CTLR2_EXTTRIG_SWSTART_Reset ((uint32_t)0xFFAFFFFF) - -/* ADC JEXTSEL mask */ -#define CTLR2_JEXTSEL_Reset ((uint32_t)0xFFFF8FFF) - -/* ADC JEXTTRIG mask */ -#define CTLR2_JEXTTRIG_Set ((uint32_t)0x00008000) -#define CTLR2_JEXTTRIG_Reset ((uint32_t)0xFFFF7FFF) - -/* ADC JSWSTART mask */ -#define CTLR2_JSWSTART_Set ((uint32_t)0x00200000) - -/* ADC injected software start mask */ -#define CTLR2_JEXTTRIG_JSWSTART_Set ((uint32_t)0x00208000) -#define CTLR2_JEXTTRIG_JSWSTART_Reset ((uint32_t)0xFFDF7FFF) - -/* ADC TSPD mask */ -#define CTLR2_TSVREFE_Set ((uint32_t)0x00800000) -#define CTLR2_TSVREFE_Reset ((uint32_t)0xFF7FFFFF) - -/* CTLR2 register Mask */ -#define CTLR2_CLEAR_Mask ((uint32_t)0xFFF1F7FD) - -/* ADC SQx mask */ -#define RSQR3_SQ_Set ((uint32_t)0x0000001F) -#define RSQR2_SQ_Set ((uint32_t)0x0000001F) -#define RSQR1_SQ_Set ((uint32_t)0x0000001F) - -/* RSQR1 register Mask */ -#define RSQR1_CLEAR_Mask ((uint32_t)0xFF0FFFFF) - -/* ADC JSQx mask */ -#define ISQR_JSQ_Set ((uint32_t)0x0000001F) - -/* ADC JL mask */ -#define ISQR_JL_Set ((uint32_t)0x00300000) -#define ISQR_JL_Reset ((uint32_t)0xFFCFFFFF) - -/* ADC SMPx mask */ -#define SAMPTR1_SMP_Set ((uint32_t)0x00000007) -#define SAMPTR2_SMP_Set ((uint32_t)0x00000007) - -/* ADC IDATARx registers offset */ -#define IDATAR_Offset ((uint8_t)0x28) - -/* ch32v00x_dbgmcu.c ---------------------------------------------------------*/ -#define IDCODE_DEVID_MASK ((uint32_t)0x0000FFFF) - -/* ch32v00x_dma.c ------------------------------------------------------------*/ - -/* DMA1 Channelx interrupt pending bit masks */ -#define DMA1_Channel1_IT_Mask ((uint32_t)(DMA_GIF1 | DMA_TCIF1 | DMA_HTIF1 | DMA_TEIF1)) -#define DMA1_Channel2_IT_Mask ((uint32_t)(DMA_GIF2 | DMA_TCIF2 | DMA_HTIF2 | DMA_TEIF2)) -#define DMA1_Channel3_IT_Mask ((uint32_t)(DMA_GIF3 | DMA_TCIF3 | DMA_HTIF3 | DMA_TEIF3)) -#define DMA1_Channel4_IT_Mask ((uint32_t)(DMA_GIF4 | DMA_TCIF4 | DMA_HTIF4 | DMA_TEIF4)) -#define DMA1_Channel5_IT_Mask ((uint32_t)(DMA_GIF5 | DMA_TCIF5 | DMA_HTIF5 | DMA_TEIF5)) -#define DMA1_Channel6_IT_Mask ((uint32_t)(DMA_GIF6 | DMA_TCIF6 | DMA_HTIF6 | DMA_TEIF6)) -#define DMA1_Channel7_IT_Mask ((uint32_t)(DMA_GIF7 | DMA_TCIF7 | DMA_HTIF7 | DMA_TEIF7)) - -/* DMA2 FLAG mask */ -// Editor's note: Overloaded Definition. -#define DMA2_FLAG_Mask ((uint32_t)0x10000000) - -/* DMA registers Masks */ -#define CFGR_CLEAR_Mask ((uint32_t)0xFFFF800F) - -/* ch32v00x_exti.c -----------------------------------------------------------*/ - -/* No interrupt selected */ -#define EXTI_LINENONE ((uint32_t)0x00000) - -/* ch32v00x_flash.c ----------------------------------------------------------*/ - -/* Flash Control Register bits */ -#define CR_PG_Set ((uint32_t)0x00000001) -#define CR_PG_Reset ((uint32_t)0xFFFFFFFE) -#define CR_PER_Set ((uint32_t)0x00000002) -#define CR_PER_Reset ((uint32_t)0xFFFFFFFD) -#define CR_MER_Set ((uint32_t)0x00000004) -#define CR_MER_Reset ((uint32_t)0xFFFFFFFB) -#define CR_OPTPG_Set ((uint32_t)0x00000010) -#define CR_OPTPG_Reset ((uint32_t)0xFFFFFFEF) -#define CR_OPTER_Set ((uint32_t)0x00000020) -#define CR_OPTER_Reset ((uint32_t)0xFFFFFFDF) -#define CR_STRT_Set ((uint32_t)0x00000040) -#define CR_LOCK_Set ((uint32_t)0x00000080) -#define CR_PAGE_PG ((uint32_t)0x00010000) -#define CR_PAGE_ER ((uint32_t)0x00020000) - -/* FLASH Status Register bits */ -#define SR_BSY ((uint32_t)0x00000001) -#define SR_WRPRTERR ((uint32_t)0x00000010) -#define SR_EOP ((uint32_t)0x00000020) - -/* FLASH Mask */ -#define RDPRT_Mask ((uint32_t)0x00000002) -#define WRP0_Mask ((uint32_t)0x000000FF) -#define WRP1_Mask ((uint32_t)0x0000FF00) -#define WRP2_Mask ((uint32_t)0x00FF0000) -#define WRP3_Mask ((uint32_t)0xFF000000) - -/* FLASH Keys */ -#define RDP_Key ((uint16_t)0x00A5) -#define FLASH_KEY1 ((uint32_t)0x45670123) -#define FLASH_KEY2 ((uint32_t)0xCDEF89AB) - -/* FLASH BANK address */ -#define FLASH_BANK1_END_ADDRESS ((uint32_t)0x807FFFF) - -/* Delay definition */ -#define EraseTimeout ((uint32_t)0x000B0000) - -/* Flash Program Valid Address */ -#define ValidAddrStart (FLASH_BASE) -#define ValidAddrEnd (FLASH_BASE + 0x4000) - -/* ch32v00x_i2c.c ------------------------------------------------------------*/ - -/* I2C SPE mask */ -#define CTLR1_PE_Set ((uint16_t)0x0001) -#define CTLR1_PE_Reset ((uint16_t)0xFFFE) - -/* I2C START mask */ -#define CTLR1_START_Set ((uint16_t)0x0100) -#define CTLR1_START_Reset ((uint16_t)0xFEFF) - -/* I2C STOP mask */ -#define CTLR1_STOP_Set ((uint16_t)0x0200) -#define CTLR1_STOP_Reset ((uint16_t)0xFDFF) - -/* I2C ACK mask */ -#define CTLR1_ACK_Set ((uint16_t)0x0400) -#define CTLR1_ACK_Reset ((uint16_t)0xFBFF) - -/* I2C ENGC mask */ -#define CTLR1_ENGC_Set ((uint16_t)0x0040) -#define CTLR1_ENGC_Reset ((uint16_t)0xFFBF) - -/* I2C SWRST mask */ -#define CTLR1_SWRST_Set ((uint16_t)0x8000) -#define CTLR1_SWRST_Reset ((uint16_t)0x7FFF) - -/* I2C PEC mask */ -#define CTLR1_PEC_Set ((uint16_t)0x1000) -#define CTLR1_PEC_Reset ((uint16_t)0xEFFF) - -/* I2C ENPEC mask */ -#define CTLR1_ENPEC_Set ((uint16_t)0x0020) -#define CTLR1_ENPEC_Reset ((uint16_t)0xFFDF) - -/* I2C ENARP mask */ -#define CTLR1_ENARP_Set ((uint16_t)0x0010) -#define CTLR1_ENARP_Reset ((uint16_t)0xFFEF) - -/* I2C NOSTRETCH mask */ -#define CTLR1_NOSTRETCH_Set ((uint16_t)0x0080) -#define CTLR1_NOSTRETCH_Reset ((uint16_t)0xFF7F) - -////* I2C registers Masks */ -// Editor's note: Overloaded Definition. -#define I2C_CTLR1_CLEAR_Mask ((uint16_t)0xFBF5) - -/* I2C DMAEN mask */ -#define CTLR2_DMAEN_Set ((uint16_t)0x0800) -#define CTLR2_DMAEN_Reset ((uint16_t)0xF7FF) - -/* I2C LAST mask */ -#define CTLR2_LAST_Set ((uint16_t)0x1000) -#define CTLR2_LAST_Reset ((uint16_t)0xEFFF) - -/* I2C FREQ mask */ -#define CTLR2_FREQ_Reset ((uint16_t)0xFFC0) - -/* I2C ADD0 mask */ -#define OADDR1_ADD0_Set ((uint16_t)0x0001) -#define OADDR1_ADD0_Reset ((uint16_t)0xFFFE) - -/* I2C ENDUAL mask */ -#define OADDR2_ENDUAL_Set ((uint16_t)0x0001) -#define OADDR2_ENDUAL_Reset ((uint16_t)0xFFFE) - -/* I2C ADD2 mask */ -#define OADDR2_ADD2_Reset ((uint16_t)0xFF01) - -/* I2C F/S mask */ -#define CKCFGR_FS_Set ((uint16_t)0x8000) - -/* I2C CCR mask */ -#define CKCFGR_CCR_Set ((uint16_t)0x0FFF) - -/* I2C FLAG mask */ -// Editor's Note: Overloaded Definition -#define I2c_FLAG_Mask ((uint32_t)0x00FFFFFF) - -/* I2C Interrupt Enable mask */ -#define ITEN_Mask ((uint32_t)0x07000000) - -/* ch32v00x_iwdg.c -----------------------------------------------------------*/ - -/* CTLR register bit mask */ -#define CTLR_KEY_Reload ((uint16_t)0xAAAA) -#define CTLR_KEY_Enable ((uint16_t)0xCCCC) - -/* ch32v00x_pwr.c ------------------------------------------------------------*/ - -/* PWR registers bit mask */ -/* CTLR register bit mask */ -#define CTLR_DS_MASK ((uint32_t)0xFFFFFFFD) -#define CTLR_PLS_MASK ((uint32_t)0xFFFFFF1F) - -/* ch32v00x_rcc.c ------------------------------------------------------------*/ - -/* RCC registers bit address in the alias region */ -#define RCC_OFFSET (RCC_BASE - PERIPH_BASE) - -/* BDCTLR Register */ -#define BDCTLR_OFFSET (RCC_OFFSET + 0x20) - -/* RCC registers bit mask */ - -/* CTLR register bit mask */ -#define CTLR_HSEBYP_Reset ((uint32_t)0xFFFBFFFF) -#define CTLR_HSEBYP_Set ((uint32_t)0x00040000) -#define CTLR_HSEON_Reset ((uint32_t)0xFFFEFFFF) -#define CTLR_HSEON_Set ((uint32_t)0x00010000) -#define CTLR_HSITRIM_Mask ((uint32_t)0xFFFFFF07) - -#define CFGR0_PLL_Mask ((uint32_t)0xFFC0FFFF) -#define CFGR0_PLLMull_Mask ((uint32_t)0x003C0000) -#define CFGR0_PLLSRC_Mask ((uint32_t)0x00010000) -#define CFGR0_PLLXTPRE_Mask ((uint32_t)0x00020000) -#define CFGR0_SWS_Mask ((uint32_t)0x0000000C) -#define CFGR0_SW_Mask ((uint32_t)0xFFFFFFFC) -#define CFGR0_HPRE_Reset_Mask ((uint32_t)0xFFFFFF0F) -#define CFGR0_HPRE_Set_Mask ((uint32_t)0x000000F0) -#define CFGR0_PPRE1_Reset_Mask ((uint32_t)0xFFFFF8FF) -#define CFGR0_PPRE1_Set_Mask ((uint32_t)0x00000700) -#define CFGR0_PPRE2_Reset_Mask ((uint32_t)0xFFFFC7FF) -#define CFGR0_PPRE2_Set_Mask ((uint32_t)0x00003800) -#define CFGR0_ADCPRE_Reset_Mask ((uint32_t)0xFFFF07FF) -#define CFGR0_ADCPRE_Set_Mask ((uint32_t)0x0000F800) - -/* RSTSCKR register bit mask */ -#define RSTSCKR_RMVF_Set ((uint32_t)0x01000000) - -/* RCC Flag Mask */ -// Editor's Note: Overloaded Definition -#define RCC_FLAG_Mask ((uint8_t)0x1F) - -/* INTR register byte 2 (Bits[15:8]) base address */ -#define INTR_BYTE2_ADDRESS ((uint32_t)0x40021009) - -/* INTR register byte 3 (Bits[23:16]) base address */ -#define INTR_BYTE3_ADDRESS ((uint32_t)0x4002100A) - -/* CFGR0 register byte 4 (Bits[31:24]) base address */ -#define CFGR0_BYTE4_ADDRESS ((uint32_t)0x40021007) - -/* BDCTLR register base address */ -#define BDCTLR_ADDRESS (PERIPH_BASE + BDCTLR_OFFSET) - -#ifndef __ASSEMBLER__ -#endif - -/* ch32v00x_spi.c ------------------------------------------------------------*/ - -/* SPI SPE mask */ -#define CTLR1_SPE_Set ((uint16_t)0x0040) -#define CTLR1_SPE_Reset ((uint16_t)0xFFBF) - -/* SPI CRCNext mask */ -#define CTLR1_CRCNext_Set ((uint16_t)0x1000) - -/* SPI CRCEN mask */ -#define CTLR1_CRCEN_Set ((uint16_t)0x2000) -#define CTLR1_CRCEN_Reset ((uint16_t)0xDFFF) - -/* SPI SSOE mask */ -#define CTLR2_SSOE_Set ((uint16_t)0x0004) -#define CTLR2_SSOE_Reset ((uint16_t)0xFFFB) - -/* SPI registers Masks */ -// Editor's Note: Overloaded Definition -#define SPI_CTLR1_CLEAR_Mask ((uint16_t)0x3040) -#define I2SCFGR_CLEAR_Mask ((uint16_t)0xF040) - -/* ch32v00x_tim.c ------------------------------------------------------------*/ - -/* TIM registers bit mask */ -#define SMCFGR_ETR_Mask ((uint16_t)0x00FF) -#define CHCTLR_Offset ((uint16_t)0x0018) -#define CCER_CCE_Set ((uint16_t)0x0001) -#define CCER_CCNE_Set ((uint16_t)0x0004) - -/* ch32v00x_usart.c ----------------------------------------------------------*/ - -/* USART_Private_Defines */ -#define CTLR1_UE_Set ((uint16_t)0x2000) /* USART Enable Mask */ -#define CTLR1_UE_Reset ((uint16_t)0xDFFF) /* USART Disable Mask */ - -#define CTLR1_WAKE_Mask ((uint16_t)0xF7FF) /* USART WakeUp Method Mask */ - -#define CTLR1_RWU_Set ((uint16_t)0x0002) /* USART mute mode Enable Mask */ -#define CTLR1_RWU_Reset ((uint16_t)0xFFFD) /* USART mute mode Enable Mask */ -#define CTLR1_SBK_Set ((uint16_t)0x0001) /* USART Break Character send Mask */ -// Editor's Note: Overloaded Definition -#define USART_CTLR1_CLEAR_Mask ((uint16_t)0xE9F3) /* USART CR1 Mask */ -#define CTLR2_Address_Mask ((uint16_t)0xFFF0) /* USART address Mask */ - -#define CTLR2_LINEN_Set ((uint16_t)0x4000) /* USART LIN Enable Mask */ -#define CTLR2_LINEN_Reset ((uint16_t)0xBFFF) /* USART LIN Disable Mask */ - -#define CTLR2_LBDL_Mask ((uint16_t)0xFFDF) /* USART LIN Break detection Mask */ -#define CTLR2_STOP_CLEAR_Mask ((uint16_t)0xCFFF) /* USART CR2 STOP Bits Mask */ -#define CTLR2_CLOCK_CLEAR_Mask ((uint16_t)0xF0FF) /* USART CR2 Clock Mask */ - -#define CTLR3_SCEN_Set ((uint16_t)0x0020) /* USART SC Enable Mask */ -#define CTLR3_SCEN_Reset ((uint16_t)0xFFDF) /* USART SC Disable Mask */ - -#define CTLR3_NACK_Set ((uint16_t)0x0010) /* USART SC NACK Enable Mask */ -#define CTLR3_NACK_Reset ((uint16_t)0xFFEF) /* USART SC NACK Disable Mask */ - -#define CTLR3_HDSEL_Set ((uint16_t)0x0008) /* USART Half-Duplex Enable Mask */ -#define CTLR3_HDSEL_Reset ((uint16_t)0xFFF7) /* USART Half-Duplex Disable Mask */ - -#define CTLR3_IRLP_Mask ((uint16_t)0xFFFB) /* USART IrDA LowPower mode Mask */ -#define CTLR3_CLEAR_Mask ((uint16_t)0xFCFF) /* USART CR3 Mask */ - -#define CTLR3_IREN_Set ((uint16_t)0x0002) /* USART IrDA Enable Mask */ -#define CTLR3_IREN_Reset ((uint16_t)0xFFFD) /* USART IrDA Disable Mask */ -#define GPR_LSB_Mask ((uint16_t)0x00FF) /* Guard Time Register LSB Mask */ -#define GPR_MSB_Mask ((uint16_t)0xFF00) /* Guard Time Register MSB Mask */ -#define IT_Mask ((uint16_t)0x001F) /* USART Interrupt Mask */ - -/* USART OverSampling-8 Mask */ -#define CTLR1_OVER8_Set ((uint16_t)0x8000) /* USART OVER8 mode Enable Mask */ -#define CTLR1_OVER8_Reset ((uint16_t)0x7FFF) /* USART OVER8 mode Disable Mask */ - -/* USART One Bit Sampling Mask */ -#define CTLR3_ONEBITE_Set ((uint16_t)0x0800) /* USART ONEBITE mode Enable Mask */ -#define CTLR3_ONEBITE_Reset ((uint16_t)0xF7FF) /* USART ONEBITE mode Disable Mask */ - -/* ch32v00x_wwdg.c ------------------------------------------------------------*/ - -/* CTLR register bit mask */ -#define CTLR_WDGA_Set ((uint32_t)0x00000080) - -/* CFGR register bit mask */ -#define CFGR_WDGTB_Mask ((uint32_t)0xFFFFFE7F) -#define CFGR_W_Mask ((uint32_t)0xFFFFFF80) -#define BIT_Mask ((uint8_t)0x7F) - -/* ch32v00x_adc.h ------------------------------------------------------------*/ - -/* ADC_mode */ -#define ADC_Mode_Independent ((uint32_t)0x00000000) - -/* ADC_external_trigger_sources_for_regular_channels_conversion */ -#define ADC_ExternalTrigConv_T1_TRGO ((uint32_t)0x00000000) -#define ADC_ExternalTrigConv_T1_CC1 ((uint32_t)0x00020000) -#define ADC_ExternalTrigConv_T1_CC2 ((uint32_t)0x00040000) -#define ADC_ExternalTrigConv_T2_TRGO ((uint32_t)0x00060000) -#define ADC_ExternalTrigConv_T2_CC1 ((uint32_t)0x00080000) -#define ADC_ExternalTrigConv_T3_CC1 ((uint32_t)0x000A0000) -#define ADC_ExternalTrigConv_Ext_IT11 ((uint32_t)0x000C0000) -#define ADC_ExternalTrigConv_None ((uint32_t)0x000E0000) - -/* ADC_data_align */ -#define ADC_DataAlign_Right ((uint32_t)0x00000000) -#define ADC_DataAlign_Left ((uint32_t)0x00000800) - -/* ADC_channels */ -#define ADC_Channel_0 ((uint8_t)0x00) -#define ADC_Channel_1 ((uint8_t)0x01) -#define ADC_Channel_2 ((uint8_t)0x02) -#define ADC_Channel_3 ((uint8_t)0x03) -#define ADC_Channel_4 ((uint8_t)0x04) -#define ADC_Channel_5 ((uint8_t)0x05) -#define ADC_Channel_6 ((uint8_t)0x06) -#define ADC_Channel_7 ((uint8_t)0x07) -#define ADC_Channel_8 ((uint8_t)0x08) -#define ADC_Channel_9 ((uint8_t)0x09) -#define ADC_Channel_10 ((uint8_t)0x0A) -#define ADC_Channel_11 ((uint8_t)0x0B) -#define ADC_Channel_12 ((uint8_t)0x0C) -#define ADC_Channel_13 ((uint8_t)0x0D) -#define ADC_Channel_14 ((uint8_t)0x0E) -#define ADC_Channel_15 ((uint8_t)0x0F) - -#define ADC_Channel_Vrefint ((uint8_t)ADC_Channel_15) - -/* ADC_sampling_time */ -#define ADC_SampleTime_4Cycles ((uint8_t)0x00) -#define ADC_SampleTime_5Cycles ((uint8_t)0x01) -#define ADC_SampleTime_6Cycles ((uint8_t)0x02) -#define ADC_SampleTime_7Cycles ((uint8_t)0x03) -#define ADC_SampleTime_8Cycles ((uint8_t)0x04) -#define ADC_SampleTime_9Cycles ((uint8_t)0x05) -#define ADC_SampleTime_10Cycles ((uint8_t)0x06) -#define ADC_SampleTime_11Cycles ((uint8_t)0x07) - -/* ADC_external_trigger_sources_for_injected_channels_conversion */ -#define ADC_ExternalTrigInjecConv_T1_CC3 ((uint32_t)0x00000000) -#define ADC_ExternalTrigInjecConv_T1_CC4 ((uint32_t)0x00001000) -#define ADC_ExternalTrigInjecConv_T2_CC3 ((uint32_t)0x00002000) -#define ADC_ExternalTrigInjecConv_T2_CC4 ((uint32_t)0x00003000) -#define ADC_ExternalTrigInjecConv_T2_CC2 ((uint32_t)0x00004000) -#define ADC_ExternalTrigInjecConv_T3_CC2 ((uint32_t)0x00005000) -#define ADC_ExternalTrigInjecConv_Ext_IT15 ((uint32_t)0x00006000) -#define ADC_ExternalTrigInjecConv_None ((uint32_t)0x00007000) - -/* ADC_injected_channel_selection */ -#define ADC_InjectedChannel_1 ((uint8_t)0x14) -#define ADC_InjectedChannel_2 ((uint8_t)0x18) -#define ADC_InjectedChannel_3 ((uint8_t)0x1C) -#define ADC_InjectedChannel_4 ((uint8_t)0x20) - -/* ADC_analog_watchdog_selection */ -#define ADC_AnalogWatchdog_SingleRegEnable ((uint32_t)0x00800200) -#define ADC_AnalogWatchdog_SingleInjecEnable ((uint32_t)0x00400200) -#define ADC_AnalogWatchdog_SingleRegOrInjecEnable ((uint32_t)0x00C00200) -#define ADC_AnalogWatchdog_AllRegEnable ((uint32_t)0x00800000) -#define ADC_AnalogWatchdog_AllInjecEnable ((uint32_t)0x00400000) -#define ADC_AnalogWatchdog_AllRegAllInjecEnable ((uint32_t)0x00C00000) -#define ADC_AnalogWatchdog_None ((uint32_t)0x00000000) - -/* ADC_interrupts_definition */ -#define ADC_IT_EOC ((uint16_t)0x0220) -#define ADC_IT_AWD ((uint16_t)0x0140) -#define ADC_IT_JEOC ((uint16_t)0x0480) - -/* ADC_flags_definition */ -#define ADC_FLAG_AWD ((uint8_t)0x01) -#define ADC_FLAG_EOC ((uint8_t)0x02) -#define ADC_FLAG_JEOC ((uint8_t)0x04) -#define ADC_FLAG_JSTRT ((uint8_t)0x08) -#define ADC_FLAG_STRT ((uint8_t)0x10) - -/* ADC_external_trigger_sources_delay_channels_definition */ -#define ADC_ExternalTrigRegul_DLY ((uint32_t)0x00000000) - -/* ADC_analog_watchdog_reset_enable_selection */ -#define ADC_AnalogWatchdog_0_RST_EN ((uint32_t)0x00001000) -#define ADC_AnalogWatchdog_1_RST_EN ((uint32_t)0x00002000) -#define ADC_AnalogWatchdog_2_RST_EN ((uint32_t)0x00004000) -#define ADC_AnalogWatchdog_3_RST_EN ((uint32_t)0x00008000) - -/* ADC_analog_watchdog_reset_flags_definition */ -#define ADC_AnalogWatchdogResetFLAG_0 ((uint32_t)0x00010000) -#define ADC_AnalogWatchdogResetFLAG_1 ((uint32_t)0x00020000) -#define ADC_AnalogWatchdogResetFLAG_2 ((uint32_t)0x00040000) -#define ADC_AnalogWatchdogResetFLAG_3 ((uint32_t)0x00080000) - -/* ADC_clock */ -#define ADC_CLK_Div4 ((uint32_t)0x00000013) -#define ADC_CLK_Div5 ((uint32_t)0x00000014) -#define ADC_CLK_Div6 ((uint32_t)0x00000025) -#define ADC_CLK_Div7 ((uint32_t)0x00000026) -#define ADC_CLK_Div8 ((uint32_t)0x00000037) -#define ADC_CLK_Div9 ((uint32_t)0x00000038) -#define ADC_CLK_Div10 ((uint32_t)0x00000049) -#define ADC_CLK_Div11 ((uint32_t)0x0000004A) -#define ADC_CLK_Div12 ((uint32_t)0x0000005B) -#define ADC_CLK_Div13 ((uint32_t)0x0000005C) -#define ADC_CLK_Div14 ((uint32_t)0x0000006D) -#define ADC_CLK_Div15 ((uint32_t)0x0000006E) -#define ADC_CLK_Div16 ((uint32_t)0x0000007F) - -/* PWR_AWU_Prescaler */ -#define AWU_Prescaler_1 ((uint32_t)0x00000000) -#define AWU_Prescaler_2 ((uint32_t)0x00000002) -#define AWU_Prescaler_4 ((uint32_t)0x00000003) -#define AWU_Prescaler_8 ((uint32_t)0x00000004) -#define AWU_Prescaler_16 ((uint32_t)0x00000005) -#define AWU_Prescaler_32 ((uint32_t)0x00000006) -#define AWU_Prescaler_64 ((uint32_t)0x00000007) -#define AWU_Prescaler_128 ((uint32_t)0x00000008) -#define AWU_Prescaler_256 ((uint32_t)0x00000009) -#define AWU_Prescaler_512 ((uint32_t)0x0000000A) -#define AWU_Prescaler_1024 ((uint32_t)0x0000000B) -#define AWU_Prescaler_2048 ((uint32_t)0x0000000C) -#define AWU_Prescaler_4096 ((uint32_t)0x0000000D) -#define AWU_Prescaler_10240 ((uint32_t)0x0000000E) -#define AWU_Prescaler_61440 ((uint32_t)0x0000000F) - -/* ch32v00x_dbgmcu.h ---------------------------------------------------------*/ -/* CFGR0 Register */ -#define DBGMCU_SLEEP ((uint32_t)0x00000001) -#define DBGMCU_STOP ((uint32_t)0x00000002) -#define DBGMCU_STANDBY ((uint32_t)0x00000004) -#define DBGMCU_IWDG_STOP ((uint32_t)0x00000100) -#define DBGMCU_WWDG_STOP ((uint32_t)0x00000200) -#define DBGMCU_TIM1_STOP ((uint32_t)0x00001000) -#define DBGMCU_TIM2_STOP ((uint32_t)0x00002000) -#define DBGMCU_TIM3_STOP ((uint32_t)0x00004000) - -/* ch32v00x_dma.h ------------------------------------------------------------*/ - -/* DMA_data_transfer_direction */ -#define DMA_DIR_PeripheralDST ((uint32_t)0x00000010) -#define DMA_DIR_PeripheralSRC ((uint32_t)0x00000000) - -/* DMA_peripheral_incremented_mode */ -#define DMA_PeripheralInc_Enable ((uint32_t)0x00000040) -#define DMA_PeripheralInc_Disable ((uint32_t)0x00000000) - -/* DMA_memory_incremented_mode */ -#define DMA_MemoryInc_Enable ((uint32_t)0x00000080) -#define DMA_MemoryInc_Disable ((uint32_t)0x00000000) - -/* DMA_peripheral_data_size */ -#define DMA_PeripheralDataSize_Byte ((uint32_t)0x00000000) -#define DMA_PeripheralDataSize_HalfWord ((uint32_t)0x00000100) -#define DMA_PeripheralDataSize_Word ((uint32_t)0x00000200) - -/* DMA_memory_data_size */ -#define DMA_MemoryDataSize_Byte ((uint32_t)0x00000000) -#define DMA_MemoryDataSize_HalfWord ((uint32_t)0x00000400) -#define DMA_MemoryDataSize_Word ((uint32_t)0x00000800) - -/* DMA_circular_normal_mode */ -#define DMA_Mode_Circular ((uint32_t)0x00000020) -#define DMA_Mode_Normal ((uint32_t)0x00000000) - -/* DMA_priority_level */ -#define DMA_Priority_VeryHigh ((uint32_t)0x00003000) -#define DMA_Priority_High ((uint32_t)0x00002000) -#define DMA_Priority_Medium ((uint32_t)0x00001000) -#define DMA_Priority_Low ((uint32_t)0x00000000) - -/* DMA_memory_to_memory */ -#define DMA_M2M_Enable ((uint32_t)0x00004000) -#define DMA_M2M_Disable ((uint32_t)0x00000000) - -/* DMA_interrupts_definition */ -#define DMA_IT_TC ((uint32_t)0x00000002) -#define DMA_IT_HT ((uint32_t)0x00000004) -#define DMA_IT_TE ((uint32_t)0x00000008) - -#define DMA1_IT_GL1 ((uint32_t)0x00000001) -#define DMA1_IT_TC1 ((uint32_t)0x00000002) -#define DMA1_IT_HT1 ((uint32_t)0x00000004) -#define DMA1_IT_TE1 ((uint32_t)0x00000008) -#define DMA1_IT_GL2 ((uint32_t)0x00000010) -#define DMA1_IT_TC2 ((uint32_t)0x00000020) -#define DMA1_IT_HT2 ((uint32_t)0x00000040) -#define DMA1_IT_TE2 ((uint32_t)0x00000080) -#define DMA1_IT_GL3 ((uint32_t)0x00000100) -#define DMA1_IT_TC3 ((uint32_t)0x00000200) -#define DMA1_IT_HT3 ((uint32_t)0x00000400) -#define DMA1_IT_TE3 ((uint32_t)0x00000800) -#define DMA1_IT_GL4 ((uint32_t)0x00001000) -#define DMA1_IT_TC4 ((uint32_t)0x00002000) -#define DMA1_IT_HT4 ((uint32_t)0x00004000) -#define DMA1_IT_TE4 ((uint32_t)0x00008000) -#define DMA1_IT_GL5 ((uint32_t)0x00010000) -#define DMA1_IT_TC5 ((uint32_t)0x00020000) -#define DMA1_IT_HT5 ((uint32_t)0x00040000) -#define DMA1_IT_TE5 ((uint32_t)0x00080000) -#define DMA1_IT_GL6 ((uint32_t)0x00100000) -#define DMA1_IT_TC6 ((uint32_t)0x00200000) -#define DMA1_IT_HT6 ((uint32_t)0x00400000) -#define DMA1_IT_TE6 ((uint32_t)0x00800000) -#define DMA1_IT_GL7 ((uint32_t)0x01000000) -#define DMA1_IT_TC7 ((uint32_t)0x02000000) -#define DMA1_IT_HT7 ((uint32_t)0x04000000) -#define DMA1_IT_TE7 ((uint32_t)0x08000000) -#define DMA1_IT_GL8 ((uint32_t)0x10000000) -#define DMA1_IT_TC8 ((uint32_t)0x20000000) -#define DMA1_IT_HT8 ((uint32_t)0x40000000) -#define DMA1_IT_TE8 ((uint32_t)0x80000000) - -/* DMA_flags_definition */ -#define DMA1_FLAG_GL1 ((uint32_t)0x00000001) -#define DMA1_FLAG_TC1 ((uint32_t)0x00000002) -#define DMA1_FLAG_HT1 ((uint32_t)0x00000004) -#define DMA1_FLAG_TE1 ((uint32_t)0x00000008) -#define DMA1_FLAG_GL2 ((uint32_t)0x00000010) -#define DMA1_FLAG_TC2 ((uint32_t)0x00000020) -#define DMA1_FLAG_HT2 ((uint32_t)0x00000040) -#define DMA1_FLAG_TE2 ((uint32_t)0x00000080) -#define DMA1_FLAG_GL3 ((uint32_t)0x00000100) -#define DMA1_FLAG_TC3 ((uint32_t)0x00000200) -#define DMA1_FLAG_HT3 ((uint32_t)0x00000400) -#define DMA1_FLAG_TE3 ((uint32_t)0x00000800) -#define DMA1_FLAG_GL4 ((uint32_t)0x00001000) -#define DMA1_FLAG_TC4 ((uint32_t)0x00002000) -#define DMA1_FLAG_HT4 ((uint32_t)0x00004000) -#define DMA1_FLAG_TE4 ((uint32_t)0x00008000) -#define DMA1_FLAG_GL5 ((uint32_t)0x00010000) -#define DMA1_FLAG_TC5 ((uint32_t)0x00020000) -#define DMA1_FLAG_HT5 ((uint32_t)0x00040000) -#define DMA1_FLAG_TE5 ((uint32_t)0x00080000) -#define DMA1_FLAG_GL6 ((uint32_t)0x00100000) -#define DMA1_FLAG_TC6 ((uint32_t)0x00200000) -#define DMA1_FLAG_HT6 ((uint32_t)0x00400000) -#define DMA1_FLAG_TE6 ((uint32_t)0x00800000) -#define DMA1_FLAG_GL7 ((uint32_t)0x01000000) -#define DMA1_FLAG_TC7 ((uint32_t)0x02000000) -#define DMA1_FLAG_HT7 ((uint32_t)0x04000000) -#define DMA1_FLAG_TE7 ((uint32_t)0x08000000) -#define DMA1_FLAG_GL8 ((uint32_t)0x10000000) -#define DMA1_FLAG_TC8 ((uint32_t)0x20000000) -#define DMA1_FLAG_HT8 ((uint32_t)0x40000000) -#define DMA1_FLAG_TE8 ((uint32_t)0x80000000) - - /* ch32v00x_exti.h -----------------------------------------------------------*/ - -#ifndef __ASSEMBLER__ - - /* EXTI mode enumeration */ - typedef enum - { - EXTI_Mode_Interrupt = 0x00, - EXTI_Mode_Event = 0x04 - } EXTIMode_TypeDef; - - /* EXTI Trigger enumeration */ - typedef enum - { - EXTI_Trigger_Rising = 0x08, - EXTI_Trigger_Falling = 0x0C, - EXTI_Trigger_Rising_Falling = 0x10 - } EXTITrigger_TypeDef; - -#endif - -/* EXTI_Lines */ -#define EXTI_Line0 ((uint32_t)0x00000001) /* External interrupt line 0 */ -#define EXTI_Line1 ((uint32_t)0x00000002) /* External interrupt line 1 */ -#define EXTI_Line2 ((uint32_t)0x00000004) /* External interrupt line 2 */ -#define EXTI_Line3 ((uint32_t)0x00000008) /* External interrupt line 3 */ -#define EXTI_Line4 ((uint32_t)0x00000010) /* External interrupt line 4 */ -#define EXTI_Line5 ((uint32_t)0x00000020) /* External interrupt line 5 */ -#define EXTI_Line6 ((uint32_t)0x00000040) /* External interrupt line 6 */ -#define EXTI_Line7 ((uint32_t)0x00000080) /* External interrupt line 7 */ -#define EXTI_Line8 ((uint32_t)0x00000100) /* External interrupt line 8 */ -#define EXTI_Line9 ((uint32_t)0x00000200) /* External interrupt line 9 */ -#define EXTI_Line10 ((uint32_t)0x00000400) /* External interrupt line 10 */ -#define EXTI_Line11 ((uint32_t)0x00000800) /* External interrupt line 11 */ -#define EXTI_Line12 ((uint32_t)0x00001000) /* External interrupt line 12 */ -#define EXTI_Line13 ((uint32_t)0x00002000) /* External interrupt line 13 */ -#define EXTI_Line14 ((uint32_t)0x00004000) /* External interrupt line 14 */ -#define EXTI_Line15 ((uint32_t)0x00008000) /* External interrupt line 15 */ -#define EXTI_Line16 ((uint32_t)0x00010000) /* External interrupt line 16 */ -#define EXTI_Line17 ((uint32_t)0x00020000) /* External interrupt line 17 */ -#define EXTI_Line18 ((uint32_t)0x00040000) /* External interrupt line 18 */ -#define EXTI_Line19 ((uint32_t)0x00080000) /* External interrupt line 19 */ -#define EXTI_Line20 ((uint32_t)0x00100000) /* External interrupt line 20 */ -#define EXTI_Line21 ((uint32_t)0x00200000) /* External interrupt line 21 */ -#define EXTI_Line22 ((uint32_t)0x00400000) /* External interrupt line 22 */ -#define EXTI_Line23 ((uint32_t)0x00800000) /* External interrupt line 23 */ -#define EXTI_Line24 ((uint32_t)0x01000000) /* External interrupt line 24 */ -#define EXTI_Line25 ((uint32_t)0x02000000) /* External interrupt line 25 */ -#define EXTI_Line26 ((uint32_t)0x04000000) /* External interrupt line 26 */ -#define EXTI_Line27 ((uint32_t)0x08000000) /* External interrupt line 27 */ -#define EXTI_Line28 ((uint32_t)0x10000000) /* External interrupt line 28 */ -#define EXTI_Line29 ((uint32_t)0x20000000) /* External interrupt line 29 */ - - /* ch32v00x_flash.h ----------------------------------------------------------*/ - -#ifndef __ASSEMBLER__ - /* FLASH Status */ - typedef enum - { - FLASH_BUSY = 1, - FLASH_ERROR_PG, - FLASH_ERROR_WRP, - FLASH_COMPLETE, - FLASH_TIMEOUT, - FLASH_RDP, - FLASH_OP_RANGE_ERROR = 0xFD, - FLASH_ALIGN_ERROR = 0xFE, - FLASH_ADR_RANGE_ERROR = 0xFF, - } FLASH_Status; -#endif - -/* Flash_Latency */ -#define FLASH_Latency_0 ((uint32_t)0x00000000) /* FLASH Zero Latency cycle */ -#define FLASH_Latency_1 ((uint32_t)0x00000001) /* FLASH One Latency cycle */ -#define FLASH_Latency_2 ((uint32_t)0x00000002) /* FLASH Two Latency cycles */ - -/* Values to be used with devices (1page = 256Byte) */ -#define FLASH_WRProt_Pages0to7 ((uint32_t)0x00000001) /* Write protection of page 0 to 7 */ -#define FLASH_WRProt_Pages8to15 ((uint32_t)0x00000002) /* Write protection of page 8 to 15 */ -#define FLASH_WRProt_Pages16to23 ((uint32_t)0x00000004) /* Write protection of page 16 to 23 */ -#define FLASH_WRProt_Pages24to31 ((uint32_t)0x00000008) /* Write protection of page 24 to 31 */ -#define FLASH_WRProt_Pages32to39 ((uint32_t)0x00000010) /* Write protection of page 32 to 39 */ -#define FLASH_WRProt_Pages40to47 ((uint32_t)0x00000020) /* Write protection of page 40 to 47 */ -#define FLASH_WRProt_Pages48to55 ((uint32_t)0x00000040) /* Write protection of page 48 to 55 */ -#define FLASH_WRProt_Pages56to63 ((uint32_t)0x00000080) /* Write protection of page 56 to 63 */ -#define FLASH_WRProt_Pages64to71 ((uint32_t)0x00000100) /* Write protection of page 64 to 71 */ -#define FLASH_WRProt_Pages72to79 ((uint32_t)0x00000200) /* Write protection of page 72 to 79 */ -#define FLASH_WRProt_Pages80to87 ((uint32_t)0x00000400) /* Write protection of page 80 to 87 */ -#define FLASH_WRProt_Pages88to95 ((uint32_t)0x00000800) /* Write protection of page 88 to 95 */ -#define FLASH_WRProt_Pages96to103 ((uint32_t)0x00001000) /* Write protection of page 96 to 103 */ -#define FLASH_WRProt_Pages104to111 ((uint32_t)0x00002000) /* Write protection of page 104 to 111 */ -#define FLASH_WRProt_Pages112to119 ((uint32_t)0x00004000) /* Write protection of page 112 to 119 */ -#define FLASH_WRProt_Pages120to127 ((uint32_t)0x00008000) /* Write protection of page 120 to 127 */ -#define FLASH_WRProt_Pages128to135 ((uint32_t)0x00010000) /* Write protection of page 128 to 135 */ -#define FLASH_WRProt_Pages136to143 ((uint32_t)0x00020000) /* Write protection of page 136 to 143 */ -#define FLASH_WRProt_Pages144to151 ((uint32_t)0x00040000) /* Write protection of page 144 to 151 */ -#define FLASH_WRProt_Pages152to159 ((uint32_t)0x00080000) /* Write protection of page 152 to 159 */ -#define FLASH_WRProt_Pages160to167 ((uint32_t)0x00100000) /* Write protection of page 160 to 167 */ -#define FLASH_WRProt_Pages168to175 ((uint32_t)0x00200000) /* Write protection of page 168 to 175 */ -#define FLASH_WRProt_Pages176to183 ((uint32_t)0x00400000) /* Write protection of page 176 to 183 */ -#define FLASH_WRProt_Pages184to191 ((uint32_t)0x00800000) /* Write protection of page 184 to 191 */ -#define FLASH_WRProt_Pages192to199 ((uint32_t)0x01000000) /* Write protection of page 192 to 199 */ -#define FLASH_WRProt_Pages200to207 ((uint32_t)0x02000000) /* Write protection of page 200 to 207 */ -#define FLASH_WRProt_Pages208to215 ((uint32_t)0x04000000) /* Write protection of page 208 to 215 */ -#define FLASH_WRProt_Pages216to223 ((uint32_t)0x08000000) /* Write protection of page 216 to 223 */ -#define FLASH_WRProt_Pages224to231 ((uint32_t)0x10000000) /* Write protection of page 224 to 231 */ -#define FLASH_WRProt_Pages232to239 ((uint32_t)0x20000000) /* Write protection of page 232 to 239 */ -#define FLASH_WRProt_Pages240to247 ((uint32_t)0x40000000) /* Write protection of page 240 to 247 */ - -#define FLASH_WRProt_AllPages ((uint32_t)0xFFFFFFFF) /* Write protection of all Pages */ - -/* Option_Bytes_IWatchdog */ -#define OB_IWDG_SW ((uint16_t)0x0001) /* Software IWDG selected */ -#define OB_IWDG_HW ((uint16_t)0x0000) /* Hardware IWDG selected */ - -/* Option_Bytes_nRST_STOP */ -#define OB_STOP_NoRST ((uint16_t)0x0002) /* No reset generated when entering in STOP */ -#define OB_STOP_RST ((uint16_t)0x0000) /* Reset generated when entering in STOP */ - -/* Option_Bytes_nRST_STDBY */ -#define OB_STDBY_NoRST ((uint16_t)0x0004) /* No reset generated when entering in STANDBY */ -#define OB_STDBY_RST ((uint16_t)0x0000) /* Reset generated when entering in STANDBY */ - -/* Option_Bytes_RST_ENandDT */ -#define OB_RST_NoEN ((uint8_t)0x18) /* Reset IO disable */ -#define OB_RST_EN_DT12ms ((uint8_t)0x10) /* Reset IO enable and Ignore delay time 12ms */ -#define OB_RST_EN_DT1ms ((uint8_t)0x08) /* Reset IO enable and Ignore delay time 1ms */ -#define OB_RST_EN_DT128us ((uint8_t)0x00) /* Reset IO enable and Ignore delay time 128us */ - -/* FLASH_Interrupts */ -#define FLASH_IT_ERROR ((uint32_t)0x00000400) /* FPEC error interrupt source */ -#define FLASH_IT_EOP ((uint32_t)0x00001000) /* End of FLASH Operation Interrupt source */ -#define FLASH_IT_BANK1_ERROR FLASH_IT_ERROR /* FPEC BANK1 error interrupt source */ -#define FLASH_IT_BANK1_EOP FLASH_IT_EOP /* End of FLASH BANK1 Operation Interrupt source */ - -/* FLASH_Flags */ -#define FLASH_FLAG_BSY ((uint32_t)0x00000001) /* FLASH Busy flag */ -#define FLASH_FLAG_EOP ((uint32_t)0x00000020) /* FLASH End of Operation flag */ -#define FLASH_FLAG_WRPRTERR ((uint32_t)0x00000010) /* FLASH Write protected error flag */ -#define FLASH_FLAG_OPTERR ((uint32_t)0x00000001) /* FLASH Option Byte error flag */ - -#define FLASH_FLAG_BANK1_BSY FLASH_FLAG_BSY /* FLASH BANK1 Busy flag*/ -#define FLASH_FLAG_BANK1_EOP FLASH_FLAG_EOP /* FLASH BANK1 End of Operation flag */ -#define FLASH_FLAG_BANK1_WRPRTERR FLASH_FLAG_WRPRTERR /* FLASH BANK1 Write protected error flag */ - -/* System_Reset_Start_Mode */ -#define Start_Mode_USER ((uint32_t)0x00000000) -#define Start_Mode_BOOT ((uint32_t)0x00004000) - - /* ch32v00x_gpio.h ------------------------------------------------------------*/ - -#ifndef __ASSEMBLER__ - - /* Output Maximum frequency selection */ - typedef enum - { - GPIO_Speed_In = 0, - GPIO_Speed_10MHz, - GPIO_Speed_2MHz, - GPIO_Speed_50MHz - } GPIOSpeed_TypeDef; -#define GPIO_Speed_30MHz GPIO_Speed_50MHz -#endif - -#define GPIO_CNF_IN_ANALOG 0 -#define GPIO_CNF_IN_FLOATING 4 -#define GPIO_CNF_IN_PUPD 8 -#define GPIO_CNF_OUT_PP 0 -#define GPIO_CNF_OUT_OD 4 -#define GPIO_CNF_OUT_PP_AF 8 -#define GPIO_CNF_OUT_OD_AF 12 - - /* Configuration Mode enumeration */ - /* - typedef enum - { - GPIO_Mode_AIN = 0x0, - GPIO_Mode_IN_FLOATING = 0x04, - GPIO_Mode_IPD = 0x28, - GPIO_Mode_IPU = 0x48, - GPIO_Mode_Out_OD = 0x14, - GPIO_Mode_Out_PP = 0x10, - GPIO_Mode_AF_OD = 0x1C, - GPIO_Mode_AF_PP = 0x18 - } GPIOMode_TypeDef; - */ - -#ifndef __ASSEMBLER__ - - /* Bit_SET and Bit_RESET enumeration */ - typedef enum - { - Bit_RESET = 0, - Bit_SET - } BitAction; - -#endif - -/* GPIO_pins_define */ -#define GPIO_Pin_0 ((uint16_t)0x0001) /* Pin 0 selected */ -#define GPIO_Pin_1 ((uint16_t)0x0002) /* Pin 1 selected */ -#define GPIO_Pin_2 ((uint16_t)0x0004) /* Pin 2 selected */ -#define GPIO_Pin_3 ((uint16_t)0x0008) /* Pin 3 selected */ -#define GPIO_Pin_4 ((uint16_t)0x0010) /* Pin 4 selected */ -#define GPIO_Pin_5 ((uint16_t)0x0020) /* Pin 5 selected */ -#define GPIO_Pin_6 ((uint16_t)0x0040) /* Pin 6 selected */ -#define GPIO_Pin_7 ((uint16_t)0x0080) /* Pin 7 selected */ -#define GPIO_Pin_8 ((uint16_t)0x0100) /* Pin 8 selected */ -#define GPIO_Pin_9 ((uint16_t)0x0200) /* Pin 9 selected */ -#define GPIO_Pin_10 ((uint16_t)0x0400) /* Pin 10 selected */ -#define GPIO_Pin_11 ((uint16_t)0x0800) /* Pin 11 selected */ -#define GPIO_Pin_12 ((uint16_t)0x1000) /* Pin 12 selected */ -#define GPIO_Pin_13 ((uint16_t)0x2000) /* Pin 13 selected */ -#define GPIO_Pin_14 ((uint16_t)0x4000) /* Pin 14 selected */ -#define GPIO_Pin_15 ((uint16_t)0x8000) /* Pin 15 selected */ -#define GPIO_Pin_16 ((uint32_t)0x010000) /* Pin 16 selected */ -#define GPIO_Pin_17 ((uint32_t)0x020000) /* Pin 17 selected */ -#define GPIO_Pin_18 ((uint32_t)0x040000) /* Pin 18 selected */ -#define GPIO_Pin_19 ((uint32_t)0x080000) /* Pin 19 selected */ -#define GPIO_Pin_20 ((uint32_t)0x100000) /* Pin 20 selected */ -#define GPIO_Pin_21 ((uint32_t)0x200000) /* Pin 21 selected */ -#define GPIO_Pin_22 ((uint32_t)0x400000) /* Pin 22 selected */ -#define GPIO_Pin_23 ((uint32_t)0x800000) /* Pin 23 selected */ - -#if defined(GPIO_Pin_23) -#define GPIO_Pin_All ((uint32_t)0xFFFFFF) /* All pins selected */ -#else -#define GPIO_Pin_All ((uint16_t)0xFFFF) /* All pins selected */ -#endif - -/* GPIO_Remap_define */ -#define GPIO_PartialRemap1_SPI1 ((uint32_t)0x00100001) /* SPI1 Partial1 Alternate Function mapping */ -#define GPIO_PartialRemap2_SPI1 ((uint32_t)0x00100002) /* SPI1 Partial2 Alternate Function mapping */ -#define GPIO_FullRemap_SPI1 ((uint32_t)0x00100003) /* SPI1 Full Alternate Function mapping */ -#define GPIO_PartialRemap1_I2C1 ((uint32_t)0x08020004) /* I2C1 Partial1 Alternate Function mapping */ -#define GPIO_PartialRemap2_I2C1 ((uint32_t)0x08020008) /* I2C1 Partial2 Alternate Function mapping */ -#define GPIO_PartialRemap3_I2C1 ((uint32_t)0x0802000C) /* I2C1 Partial3 Alternate Function mapping */ -#define GPIO_PartialRemap4_I2C1 ((uint32_t)0x08020010) /* I2C1 Partial4 Alternate Function mapping */ -#define GPIO_FullRemap_I2C1 ((uint32_t)0x08020014) /* I2C1 Full Alternate Function mapping */ -#define GPIO_PartialRemap1_USART1 ((uint32_t)0x00150020) /* USART1 Partial1 Alternate Function mapping */ -#define GPIO_PartialRemap2_USART1 ((uint32_t)0x00150040) /* USART1 Partial2 Alternate Function mapping */ -#define GPIO_FullRemap_USART1 ((uint32_t)0x00150060) /* USART1 Full Alternate Function mapping */ -#define GPIO_PartialRemap1_USART2 ((uint32_t)0x08070080) /* USART2 Partial1 Alternate Function mapping */ -#define GPIO_PartialRemap2_USART2 ((uint32_t)0x08070100) /* USART2 Partial2 Alternate Function mapping */ -#define GPIO_PartialRemap3_USART2 ((uint32_t)0x08070180) /* USART2 Partial3 Alternate Function mapping */ -#define GPIO_FullRemap_USART2 ((uint32_t)0x08070200) /* USART2 Full Alternate Function mapping */ -#define GPIO_PartialRemap1_USART3 ((uint32_t)0x001A0400) /* USART3 Partial1 Alternate Function mapping */ -#define GPIO_PartialRemap2_USART3 ((uint32_t)0x001A0800) /* USART3 Partial2 Alternate Function mapping */ -#define GPIO_FullRemap_USART3 ((uint32_t)0x001A0C00) /* USART3 Full Alternate Function mapping */ -#define GPIO_PartialRemap1_USART4 ((uint32_t)0x080C1000) /* USART4 Partial1 Alternate Function mapping */ -#define GPIO_PartialRemap2_USART4 ((uint32_t)0x080C2000) /* USART4 Partial2 Alternate Function mapping */ -#define GPIO_PartialRemap3_USART4 ((uint32_t)0x080C3000) /* USART4 Partial3 Alternate Function mapping */ -#define GPIO_PartialRemap4_USART4 ((uint32_t)0x080C4000) /* USART4 Partial4 Alternate Function mapping */ -#define GPIO_FullRemap_USART4 ((uint32_t)0x080C7000) /* USART4 Full Alternate Function mapping */ -#define GPIO_PartialRemap1_TIM1 ((uint32_t)0x084F0001) /* TIM1 Partial1 Alternate Function mapping */ -#define GPIO_PartialRemap2_TIM1 ((uint32_t)0x084F0002) /* TIM1 Partial2 Alternate Function mapping */ -#define GPIO_PartialRemap3_TIM1 ((uint32_t)0x084F0003) /* TIM1 Partial3 Alternate Function mapping */ -#define GPIO_FullRemap_TIM1 ((uint32_t)0x084F0004) /* TIM1 Full Alternate Function mapping */ -#define GPIO_PartialRemap1_TIM2 ((uint32_t)0x08220004) /* TIM2 Partial1 Alternate Function mapping */ -#define GPIO_PartialRemap2_TIM2 ((uint32_t)0x08220008) /* TIM2 Partial2 Alternate Function mapping */ -#define GPIO_PartialRemap3_TIM2 ((uint32_t)0x0822000C) /* TIM2 Partial3 Alternate Function mapping */ -#define GPIO_PartialRemap4_TIM2 ((uint32_t)0x08220010) /* TIM2 Partial4 Alternate Function mapping */ -#define GPIO_PartialRemap5_TIM2 ((uint32_t)0x08220014) /* TIM2 Partial5 Alternate Function mapping */ -#define GPIO_FullRemap_TIM2 ((uint32_t)0x08220018) /* TIM2 Full Alternate Function mapping */ -#define GPIO_PartialRemap1_TIM3 ((uint32_t)0x00350020) /* TIM3 Partial1 Alternate Function mapping */ -#define GPIO_PartialRemap2_TIM3 ((uint32_t)0x00350040) /* TIM3 Partial2 Alternate Function mapping */ -#define GPIO_FullRemap_TIM3 ((uint32_t)0x00350060) /* TIM3 Full Alternate Function mapping */ -#define GPIO_Remap_PIOC ((uint32_t)0x00200080) /* PIOC Alternate Function mapping */ -#define GPIO_Remap_SWJ_Disable ((uint32_t)0x08300400) /* SDI Disabled (SDI) */ - -/* GPIO_Port_Sources */ -#define GPIO_PortSourceGPIOA ((uint8_t)0x00) -#define GPIO_PortSourceGPIOC ((uint8_t)0x02) -#define GPIO_PortSourceGPIOD ((uint8_t)0x03) -#define GPIO_PortSourceGPIOB ((uint8_t)0x01) - -/* GPIO_Pin_sources */ -#define GPIO_PinSource0 ((uint8_t)0x00) -#define GPIO_PinSource1 ((uint8_t)0x01) -#define GPIO_PinSource2 ((uint8_t)0x02) -#define GPIO_PinSource3 ((uint8_t)0x03) -#define GPIO_PinSource4 ((uint8_t)0x04) -#define GPIO_PinSource5 ((uint8_t)0x05) -#define GPIO_PinSource6 ((uint8_t)0x06) -#define GPIO_PinSource7 ((uint8_t)0x07) -#define GPIO_PinSource8 ((uint8_t)0x08) -#define GPIO_PinSource9 ((uint8_t)0x09) -#define GPIO_PinSource10 ((uint8_t)0x0A) -#define GPIO_PinSource11 ((uint8_t)0x0B) -#define GPIO_PinSource12 ((uint8_t)0x0C) -#define GPIO_PinSource13 ((uint8_t)0x0D) -#define GPIO_PinSource14 ((uint8_t)0x0E) -#define GPIO_PinSource15 ((uint8_t)0x0F) -#define GPIO_PinSource16 ((uint8_t)0x10) -#define GPIO_PinSource17 ((uint8_t)0x11) -#define GPIO_PinSource18 ((uint8_t)0x12) -#define GPIO_PinSource19 ((uint8_t)0x13) -#define GPIO_PinSource20 ((uint8_t)0x14) -#define GPIO_PinSource21 ((uint8_t)0x15) -#define GPIO_PinSource22 ((uint8_t)0x16) -#define GPIO_PinSource23 ((uint8_t)0x17) - -/* ch32v00x_i2c.h ------------------------------------------------------------*/ - -/* I2C_mode */ -#define I2C_Mode_I2C ((uint16_t)0x0000) - -/* I2C_duty_cycle_in_fast_mode */ -#define I2C_DutyCycle_16_9 ((uint16_t)0x4000) /* I2C fast mode Tlow/Thigh = 16/9 */ -#define I2C_DutyCycle_2 ((uint16_t)0xBFFF) /* I2C fast mode Tlow/Thigh = 2 */ - -/* I2C_acknowledgement */ -#define I2C_Ack_Enable ((uint16_t)0x0400) -#define I2C_Ack_Disable ((uint16_t)0x0000) - -/* I2C_transfer_direction */ -#define I2C_Direction_Transmitter ((uint8_t)0x00) -#define I2C_Direction_Receiver ((uint8_t)0x01) - -/* I2C_acknowledged_address */ -#define I2C_AcknowledgedAddress_7bit ((uint16_t)0x4000) -#define I2C_AcknowledgedAddress_10bit ((uint16_t)0xC000) - -/* I2C_registers */ -#define I2C_Register_CTLR1 ((uint8_t)0x00) -#define I2C_Register_CTLR2 ((uint8_t)0x04) -#define I2C_Register_OADDR1 ((uint8_t)0x08) -#define I2C_Register_OADDR2 ((uint8_t)0x0C) -#define I2C_Register_DATAR ((uint8_t)0x10) -#define I2C_Register_STAR1 ((uint8_t)0x14) -#define I2C_Register_STAR2 ((uint8_t)0x18) -#define I2C_Register_CKCFGR ((uint8_t)0x1C) - -/* I2C_PEC_position */ -#define I2C_PECPosition_Next ((uint16_t)0x0800) -#define I2C_PECPosition_Current ((uint16_t)0xF7FF) - -/* I2C_NACK_position */ -#define I2C_NACKPosition_Next ((uint16_t)0x0800) -#define I2C_NACKPosition_Current ((uint16_t)0xF7FF) - -/* I2C_interrupts_definition */ -#define I2C_IT_BUF ((uint16_t)0x0400) -#define I2C_IT_EVT ((uint16_t)0x0200) -#define I2C_IT_ERR ((uint16_t)0x0100) - -/* I2C_interrupts_definition */ -#define I2C_IT_PECERR ((uint32_t)0x01001000) -#define I2C_IT_OVR ((uint32_t)0x01000800) -#define I2C_IT_AF ((uint32_t)0x01000400) -#define I2C_IT_ARLO ((uint32_t)0x01000200) -#define I2C_IT_BERR ((uint32_t)0x01000100) -#define I2C_IT_TXE ((uint32_t)0x06000080) -#define I2C_IT_RXNE ((uint32_t)0x06000040) -#define I2C_IT_STOPF ((uint32_t)0x02000010) -#define I2C_IT_ADD10 ((uint32_t)0x02000008) -#define I2C_IT_BTF ((uint32_t)0x02000004) -#define I2C_IT_ADDR ((uint32_t)0x02000002) -#define I2C_IT_SB ((uint32_t)0x02000001) - -/* SR2 register flags */ -#define I2C_FLAG_DUALF ((uint32_t)0x00800000) -#define I2C_FLAG_GENCALL ((uint32_t)0x00100000) -#define I2C_FLAG_TRA ((uint32_t)0x00040000) -#define I2C_FLAG_BUSY ((uint32_t)0x00020000) -#define I2C_FLAG_MSL ((uint32_t)0x00010000) - -/* SR1 register flags */ -#define I2C_FLAG_PECERR ((uint32_t)0x10001000) -#define I2C_FLAG_OVR ((uint32_t)0x10000800) -#define I2C_FLAG_AF ((uint32_t)0x10000400) -#define I2C_FLAG_ARLO ((uint32_t)0x10000200) -#define I2C_FLAG_BERR ((uint32_t)0x10000100) -#define I2C_FLAG_TXE ((uint32_t)0x10000080) -#define I2C_FLAG_RXNE ((uint32_t)0x10000040) -#define I2C_FLAG_STOPF ((uint32_t)0x10000010) -#define I2C_FLAG_ADD10 ((uint32_t)0x10000008) -#define I2C_FLAG_BTF ((uint32_t)0x10000004) -#define I2C_FLAG_ADDR ((uint32_t)0x10000002) -#define I2C_FLAG_SB ((uint32_t)0x10000001) - -/****************I2C Master Events (Events grouped in order of communication)********************/ - -/******************************************************************************************************************** - * @brief Start communicate - * - * After master use I2C_GenerateSTART() function sending the START condition,the master - * has to wait for event 5(the Start condition has been correctly - * released on the I2C bus ). - * - */ -/* EVT5 */ -#define I2C_EVENT_MASTER_MODE_SELECT ((uint32_t)0x00030001) /* BUSY, MSL and SB flag */ - -/******************************************************************************************************************** - * @brief Address Acknowledge - * - * When start condition correctly released on the bus(check EVT5), the - * master use I2C_Send7bitAddress() function sends the address of the slave(s) with which it will communicate - * it also determines master as transmitter or Receiver. Then the master has to wait that a slave acknowledges - * his address. If an acknowledge is sent on the bus, one of the following events will be set: - * - * - * - * 1) In case of Master Receiver (7-bit addressing): the I2C_EVENT_MASTER_RECEIVER_MODE_SELECTED - * event is set. - * - * 2) In case of Master Transmitter (7-bit addressing): the I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED - * is set - * - * 3) In case of 10-Bit addressing mode, the master (after generating the START - * and checking on EVT5) use I2C_SendData() function send the header of 10-bit addressing mode. - * Then master wait EVT9. EVT9 means that the 10-bit addressing header has been correctly sent - * on the bus. Then master should use the function I2C_Send7bitAddress() to send the second part - * of the 10-bit address (LSB) . Then master should wait for event 6. - * - * - */ - -/* EVT6 */ -#define I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED ((uint32_t)0x00070082) /* BUSY, MSL, ADDR, TXE and TRA flags */ -#define I2C_EVENT_MASTER_RECEIVER_MODE_SELECTED ((uint32_t)0x00030002) /* BUSY, MSL and ADDR flags */ -/*EVT9 */ -#define I2C_EVENT_MASTER_MODE_ADDRESS10 ((uint32_t)0x00030008) /* BUSY, MSL and ADD10 flags */ - -/******************************************************************************************************************** - * @brief Communication events - * - * If START condition has generated and slave address - * been acknowledged. then the master has to check one of the following events for - * communication procedures: - * - * 1) Master Receiver mode: The master has to wait on the event EVT7 then use - * I2C_ReceiveData() function to read the data received from the slave . - * - * 2) Master Transmitter mode: The master use I2C_SendData() function to send data - * then to wait on event EVT8 or EVT8_2. - * These two events are similar: - * - EVT8 means that the data has been written in the data register and is - * being shifted out. - * - EVT8_2 means that the data has been physically shifted out and output - * on the bus. - * In most cases, using EVT8 is sufficient for the application. - * Using EVT8_2 will leads to a slower communication speed but will more reliable . - * EVT8_2 is also more suitable than EVT8 for testing on the last data transmission - * - * - * Note: - * In case the user software does not guarantee that this event EVT7 is managed before - * the current byte end of transfer, then user may check on I2C_EVENT_MASTER_BYTE_RECEIVED - * and I2C_FLAG_BTF flag at the same time .But in this case the communication may be slower. - * - * - */ - -/* Master Receive mode */ -/* EVT7 */ -#define I2C_EVENT_MASTER_BYTE_RECEIVED ((uint32_t)0x00030040) /* BUSY, MSL and RXNE flags */ - -/* Master Transmitter mode*/ -/* EVT8 */ -#define I2C_EVENT_MASTER_BYTE_TRANSMITTING ((uint32_t)0x00070080) /* TRA, BUSY, MSL, TXE flags */ -/* EVT8_2 */ -#define I2C_EVENT_MASTER_BYTE_TRANSMITTED ((uint32_t)0x00070084) /* TRA, BUSY, MSL, TXE and BTF flags */ - -/******************I2C Slave Events (Events grouped in order of communication)******************/ - -/******************************************************************************************************************** - * @brief Start Communicate events - * - * Wait on one of these events at the start of the communication. It means that - * the I2C peripheral detected a start condition of master device generate on the bus. - * If the acknowledge feature is enabled through function I2C_AcknowledgeConfig()),The peripheral generates an ACK condition on the bus. - * - * - * - * a) In normal case (only one address managed by the slave), when the address - * sent by the master matches the own address of the peripheral (configured by - * I2C_OwnAddress1 field) the I2C_EVENT_SLAVE_XXX_ADDRESS_MATCHED event is set - * (where XXX could be TRANSMITTER or RECEIVER). - * - * b) In case the address sent by the master matches the second address of the - * peripheral (configured by the function I2C_OwnAddress2Config() and enabled - * by the function I2C_DualAddressCmd()) the events I2C_EVENT_SLAVE_XXX_SECONDADDRESS_MATCHED - * (where XXX could be TRANSMITTER or RECEIVER) are set. - * - * c) In case the address sent by the master is General Call (address 0x00) and - * if the General Call is enabled for the peripheral (using function I2C_GeneralCallCmd()) - * the following event is set I2C_EVENT_SLAVE_GENERALCALLADDRESS_MATCHED. - * - */ - -/* EVT1 */ -/* a) Case of One Single Address managed by the slave */ -#define I2C_EVENT_SLAVE_RECEIVER_ADDRESS_MATCHED ((uint32_t)0x00020002) /* BUSY and ADDR flags */ -#define I2C_EVENT_SLAVE_TRANSMITTER_ADDRESS_MATCHED ((uint32_t)0x00060082) /* TRA, BUSY, TXE and ADDR flags */ - -/* b) Case of Dual address managed by the slave */ -#define I2C_EVENT_SLAVE_RECEIVER_SECONDADDRESS_MATCHED ((uint32_t)0x00820000) /* DUALF and BUSY flags */ -#define I2C_EVENT_SLAVE_TRANSMITTER_SECONDADDRESS_MATCHED ((uint32_t)0x00860080) /* DUALF, TRA, BUSY and TXE flags */ - -/* c) Case of General Call enabled for the slave */ -#define I2C_EVENT_SLAVE_GENERALCALLADDRESS_MATCHED ((uint32_t)0x00120000) /* GENCALL and BUSY flags */ - -/******************************************************************************************************************** - * @brief Communication events - * - * Wait on one of these events when EVT1 has already been checked : - * - * - Slave Receiver mode: - * - EVT2--The device is expecting to receive a data byte . - * - EVT4--The device is expecting the end of the communication: master - * sends a stop condition and data transmission is stopped. - * - * - Slave Transmitter mode: - * - EVT3--When a byte has been transmitted by the slave and the Master is expecting - * the end of the byte transmission. The two events I2C_EVENT_SLAVE_BYTE_TRANSMITTED and - * I2C_EVENT_SLAVE_BYTE_TRANSMITTING are similar. If the user software doesn't guarantee - * the EVT3 is managed before the current byte end of transfer The second one can optionally - * be used. - * - EVT3_2--When the master sends a NACK to tell slave device that data transmission - * shall end . The slave device has to stop sending - * data bytes and wait a Stop condition from bus. - * - * Note: - * If the user software does not guarantee that the event 2 is - * managed before the current byte end of transfer, User may check on I2C_EVENT_SLAVE_BYTE_RECEIVED - * and I2C_FLAG_BTF flag at the same time . - * In this case the communication will be slower. - * - */ - -/* Slave Receiver mode*/ -/* EVT2 */ -#define I2C_EVENT_SLAVE_BYTE_RECEIVED ((uint32_t)0x00020040) /* BUSY and RXNE flags */ -/* EVT4 */ -#define I2C_EVENT_SLAVE_STOP_DETECTED ((uint32_t)0x00000010) /* STOPF flag */ - -/* Slave Transmitter mode -----------------------*/ -/* EVT3 */ -#define I2C_EVENT_SLAVE_BYTE_TRANSMITTED ((uint32_t)0x00060084) /* TRA, BUSY, TXE and BTF flags */ -#define I2C_EVENT_SLAVE_BYTE_TRANSMITTING ((uint32_t)0x00060080) /* TRA, BUSY and TXE flags */ -/*EVT3_2 */ -#define I2C_EVENT_SLAVE_ACK_FAILURE ((uint32_t)0x00000400) /* AF flag */ - -/* ch32v00x_iwdg.h -----------------------------------------------------------*/ - -/* IWDG_WriteAccess */ -#define IWDG_WriteAccess_Enable ((uint16_t)0x5555) -#define IWDG_WriteAccess_Disable ((uint16_t)0x0000) - -/* IWDG_prescaler */ -#define IWDG_Prescaler_4 ((uint8_t)0x00) -#define IWDG_Prescaler_8 ((uint8_t)0x01) -#define IWDG_Prescaler_16 ((uint8_t)0x02) -#define IWDG_Prescaler_32 ((uint8_t)0x03) -#define IWDG_Prescaler_64 ((uint8_t)0x04) -#define IWDG_Prescaler_128 ((uint8_t)0x05) -#define IWDG_Prescaler_256 ((uint8_t)0x06) - -/* IWDG_Flag */ -#define IWDG_FLAG_PVU ((uint16_t)0x0001) -#define IWDG_FLAG_RVU ((uint16_t)0x0002) - -/* ch32v00x_misc.h -----------------------------------------------------------*/ - -/* Preemption_Priority_Group */ -#define NVIC_PriorityGroup_0 ((uint32_t)0x00) -#define NVIC_PriorityGroup_1 ((uint32_t)0x01) -#define NVIC_PriorityGroup_2 ((uint32_t)0x02) -#define NVIC_PriorityGroup_3 ((uint32_t)0x03) -#define NVIC_PriorityGroup_4 ((uint32_t)0x04) - -/* ch32v00x_opa.h ------------------------------------------------------------*/ - -/* Editor's note: I don't know if this is actually useful */ -#ifndef __ASSEMBLER__ - - /* OPA_member_enumeration */ - typedef enum - { - OPA1 = 0, - OPA2 - } OPA_Num_TypeDef; - - /* OPA_out_channel_enumeration */ - typedef enum - { - OUT_IO_OUT0 = 0, - OUT_IO_OUT1 - } OPA_Mode_TypeDef; - - /* OPA PSEL enumeration */ - typedef enum - { - CHP0 = 0, - CHP1, - CHP2, - CHP_OFF - } OPA_PSEL_TypeDef; - - /* OPA_FB_enumeration */ - typedef enum - { - FB_OFF = 0, - FB_ON - } OPA_FB_TypeDef; - - /* OPA NSEL enumeration */ - typedef enum - { - CHN0 = 0, - CHN1, - CHN2_PGA_16xIN, - CHN_PGA_4xIN, - CHN_PGA_8xIN, - CHN_PGA_16xIN, - CHN_PGA_32xIN, - CHN_OFF - } OPA_NSEL_TypeDef; - - /* OPA_PSEL_POLL_enumeration */ - typedef enum - { - CHP_OPA1_OFF_OPA2_OFF = 0, - CHP_OPA1_ON_OPA2_OFF, - CHP_OPA1_OFF_OPA2_ON, - CHP_OPA1_ON_OPA2_ON - } OPA_PSEL_POLL_TypeDef; - - /* OPA_BKIN_EN_enumeration */ - typedef enum - { - BKIN_OPA1_OFF_OPA2_OFF = 0, - BKIN_OPA1_ON_OPA2_OFF, - BKIN_OPA1_OFF_OPA2_ON, - BKIN_OPA1_ON_OPA2_ON - } OPA_BKIN_EN_TypeDef; - - /* OPA_RST_EN_enumeration */ - typedef enum - { - RST_OPA1_OFF_OPA2_OFF = 0, - RST_OPA1_ON_OPA2_OFF, - RST_OPA1_OFF_OPA2_ON, - RST_OPA1_ON_OPA2_ON - } OPA_RST_EN_TypeDef; - - /* OPA_BKIN_SEL_enumeration */ - typedef enum - { - BKIN_OPA1_TIM1_OPA2_TIM2 = 0, - BKIN_OPA1_TIM2_OPA2_TIM1 - } OPA_BKIN_SEL_TypeDef; - - /* OPA_OUT_IE_enumeration */ - typedef enum - { - OUT_IE_OPA1_OFF_OPA2_OFF = 0, - OUT_IE_OPA1_ON_OPA2_OFF, - OUT_IE_OPA1_OFF_OPA2_ON, - OUT_IE_OPA1_ON_OPA2_ON - } OPA_OUT_IE_TypeDef; - - /* OPA_CNT_IE_enumeration */ - typedef enum - { - CNT_IE_OFF = 0, - CNT_IE_ON, - } OPA_CNT_IE_TypeDef; - - /* OPA_NMI_IE_enumeration */ - typedef enum - { - NMI_IE_OFF = 0, - NMI_IE_ON, - } OPA_NMI_IE_TypeDef; - - /* OPA_PSEL_POLL_NUM_enumeration */ - typedef enum - { - CHP_POLL_NUM_1 = 0, - CHP_POLL_NUM_2, - CHP_POLL_NUM_3 - } OPA_PSEL_POLL_NUM_TypeDef; - - /* OPA Init Structure definition */ - typedef struct - { - uint16_t OPA_POLL_Interval; /* OPA polling interval = (OPA_POLL_Interval+1)*1us - This parameter must range from 0 to 0x1FF.*/ - OPA_Num_TypeDef OPA_NUM; /* Specifies the members of OPA */ - OPA_Mode_TypeDef Mode; /* Specifies the mode of OPA */ - OPA_PSEL_TypeDef PSEL; /* Specifies the positive channel of OPA */ - OPA_FB_TypeDef FB; /* Specifies the internal feedback resistor of OPA */ - OPA_NSEL_TypeDef NSEL; /* Specifies the negative channel of OPA */ - OPA_PSEL_POLL_TypeDef PSEL_POLL; /* Specifies the positive channel poll of OPA */ - OPA_BKIN_EN_TypeDef BKIN_EN; /* Specifies the brake input source of OPA */ - OPA_RST_EN_TypeDef RST_EN; /* Specifies the reset source of OPA */ - OPA_BKIN_SEL_TypeDef BKIN_SEL; /* Specifies the brake input source selection of OPA */ - OPA_OUT_IE_TypeDef OUT_IE; /* Specifies the out interrupt of OPA */ - OPA_CNT_IE_TypeDef CNT_IE; /* Specifies the out interrupt rising edge of sampling data */ - OPA_NMI_IE_TypeDef NMI_IE; /* Specifies the out NIM interrupt of OPA */ - OPA_PSEL_POLL_NUM_TypeDef POLL_NUM; /* Specifies the number of forward inputs*/ - } OPA_InitTypeDef; - - /* CMP_member_enumeration */ - typedef enum - { - CMP1 = 0, - CMP2, - CMP3 - } CMP_Num_TypeDef; - - /* CMP_out_channel_enumeration */ - typedef enum - { - OUT_IO_TIM2 = 0, - OUT_IO0 - } CMP_Mode_TypeDef; - - /* CMP_NSEL_enumeration */ - typedef enum - { - CMP_CHN0 = 0, - CMP_CHN1, - } CMP_NSEL_TypeDef; - - /* CMP_PSEL_enumeration */ - typedef enum - { - CMP_CHP1 = 0, - CMP_CHP2, - } CMP_PSEL_TypeDef; - - /* CMP_HYEN_enumeration */ - typedef enum - { - CMP_HYEN1 = 0, - CMP_HYEN2, - } CMP_HYEN_TypeDef; - - /* CMP Init Structure definition */ - typedef struct - { - CMP_Num_TypeDef CMP_NUM; /* Specifies the members of CMP */ - CMP_Mode_TypeDef Mode; /* Specifies the mode of CMP */ - CMP_NSEL_TypeDef NSEL; /* Specifies the negative channel of CMP */ - CMP_PSEL_TypeDef PSEL; /* Specifies the positive channel of CMP */ - CMP_HYEN_TypeDef HYEN; /* Specifies the hysteresis comparator of CMP */ - } CMP_InitTypeDef; - -/* OPA_flags_definition */ -#define OPA_FLAG_OUT_OPA1 ((uint16_t)0x1000) -#define OPA_FLAG_OUT_OPA2 ((uint16_t)0x2000) -#define OPA_FLAG_OUT_CNT ((uint16_t)0x4000) - -#endif - -/* ch32v00x_pwr.h ------------------------------------------------------------*/ - -/* PVD_detection_level */ -#define PWR_PVDLevel_0 ((uint32_t)0x00000000) -#define PWR_PVDLevel_1 ((uint32_t)0x00000020) -#define PWR_PVDLevel_2 ((uint32_t)0x00000040) -#define PWR_PVDLevel_3 ((uint32_t)0x00000060) - -#define PWR_PVDLevel_2V1 PWR_PVDLevel_0 -#define PWR_PVDLevel_2V3 PWR_PVDLevel_1 -#define PWR_PVDLevel_3V0 PWR_PVDLevel_2 -#define PWR_PVDLevel_4V0 PWR_PVDLevel_3 - -/* STOP_mode_entry */ -#define PWR_STOPEntry_WFI ((uint8_t)0x01) -#define PWR_STOPEntry_WFE ((uint8_t)0x02) - -/* PWR_Flag */ -#define PWR_FLAG_PVDO ((uint32_t)0x00000004) -#define PWR_FLAG_FLASH ((uint32_t)0x00000020) - -/* ch32v00x_rcc.h ------------------------------------------------------------*/ - -/* HSE_configuration */ -#define RCC_HSE_OFF ((uint32_t)0x00000000) -#define RCC_HSE_ON ((uint32_t)0x00010000) -#define RCC_HSE_Bypass ((uint32_t)0x00040000) - -/* System_clock_source */ -#define RCC_SYSCLKSource_HSI ((uint32_t)0x00000000) -#define RCC_SYSCLKSource_HSE ((uint32_t)0x00000001) -#define RCC_SYSCLKSource_PLLCLK ((uint32_t)0x00000002) - -/* AHB_clock_source */ -#define RCC_SYSCLK_Div1 ((uint32_t)0x00000000) -#define RCC_SYSCLK_Div2 ((uint32_t)0x00000010) -#define RCC_SYSCLK_Div3 ((uint32_t)0x00000020) -#define RCC_SYSCLK_Div4 ((uint32_t)0x00000030) -#define RCC_SYSCLK_Div5 ((uint32_t)0x00000040) -#define RCC_SYSCLK_Div6 ((uint32_t)0x00000050) -#define RCC_SYSCLK_Div7 ((uint32_t)0x00000060) -#define RCC_SYSCLK_Div8 ((uint32_t)0x00000070) -#define RCC_SYSCLK_Div16 ((uint32_t)0x000000B0) -#define RCC_SYSCLK_Div32 ((uint32_t)0x000000C0) -#define RCC_SYSCLK_Div64 ((uint32_t)0x000000D0) -#define RCC_SYSCLK_Div128 ((uint32_t)0x000000E0) -#define RCC_SYSCLK_Div256 ((uint32_t)0x000000F0) - -/* RCC_Interrupt_source */ -#define RCC_IT_LSIRDY ((uint8_t)0x01) -#define RCC_IT_HSIRDY ((uint8_t)0x04) -#define RCC_IT_HSERDY ((uint8_t)0x08) -#define RCC_IT_PLLRDY ((uint8_t)0x10) -#define RCC_IT_CSS ((uint8_t)0x80) - -/* AHB_peripheral */ -#define RCC_AHBPeriph_DMA1 ((uint32_t)0x00000001) -#define RCC_AHBPeriph_SRAM ((uint32_t)0x00000004) -#define RCC_AHBPeriph_USBFS ((uint32_t)0x00001000) -#define RCC_AHBPeriph_USBHD RCC_AHBPeriph_USBFS -#define RCC_AHBPeriph_IO2W ((uint32_t)0x00002000) -#define RCC_AHBPeriph_USBPD ((uint32_t)0x00020000) - -/* APB2_peripheral */ -#define RCC_APB2Periph_AFIO ((uint32_t)0x00000001) -#define RCC_APB2Periph_GPIOA ((uint32_t)0x00000004) -#define RCC_APB2Periph_GPIOB ((uint32_t)0x00000008) -#define RCC_APB2Periph_GPIOC ((uint32_t)0x00000010) -#define RCC_APB2Periph_GPIOD ((uint32_t)0x00000020) -#define RCC_APB2Periph_ADC1 ((uint32_t)0x00000200) -#define RCC_APB2Periph_TIM1 ((uint32_t)0x00000800) -#define RCC_APB2Periph_SPI1 ((uint32_t)0x00001000) -#define RCC_APB2Periph_USART1 ((uint32_t)0x00004000) - -/* APB1_peripheral */ -#define RCC_APB1Periph_TIM2 ((uint32_t)0x00000001) -#define RCC_APB1Periph_TIM3 ((uint32_t)0x00000002) -#define RCC_APB1Periph_WWDG ((uint32_t)0x00000800) -#define RCC_APB1Periph_USART2 ((uint32_t)0x00020000) -#define RCC_APB1Periph_USART3 ((uint32_t)0x00040000) -#define RCC_APB1Periph_USART4 ((uint32_t)0x00080000) -#define RCC_APB1Periph_I2C1 ((uint32_t)0x00200000) -#define RCC_APB1Periph_PWR ((uint32_t)0x10000000) - -/* APB2_peripheral */ -#define RCC_APB2Periph_GPIOB ((uint32_t)0x00000008) - -#define RCC_APB1Periph_TIM3 ((uint32_t)0x00000002) -#define RCC_APB1Periph_USART2 ((uint32_t)0x00020000) -#define RCC_APB1Periph_USART3 ((uint32_t)0x00040000) -#define RCC_APB1Periph_USART4 ((uint32_t)0x00080000) - -/* Clock_source_to_output_on_MCO_pin */ -#define RCC_MCO_NoClock ((uint8_t)0x00) -#define RCC_MCO_SYSCLK ((uint8_t)0x04) -#define RCC_MCO_HSI ((uint8_t)0x05) -#define RCC_MCO_HSE ((uint8_t)0x06) - -/* RCC_Flag */ -#define RCC_FLAG_HSIRDY ((uint8_t)0x21) -#define RCC_FLAG_HSERDY ((uint8_t)0x31) -#define RCC_FLAG_PLLRDY ((uint8_t)0x39) -#define RCC_FLAG_LSIRDY ((uint8_t)0x61) -#define RCC_FLAG_OPARST ((uint8_t)0x79) -#define RCC_FLAG_PINRST ((uint8_t)0x7A) -#define RCC_FLAG_PORRST ((uint8_t)0x7B) -#define RCC_FLAG_SFTRST ((uint8_t)0x7C) -#define RCC_FLAG_IWDGRST ((uint8_t)0x7D) -#define RCC_FLAG_WWDGRST ((uint8_t)0x7E) -#define RCC_FLAG_LPWRRST ((uint8_t)0x7F) - -/* SysTick_clock_source */ -#define SysTick_CLKSource_HCLK_Div8 ((uint32_t)0xFFFFFFFB) -#define SysTick_CLKSource_HCLK ((uint32_t)0x00000004) - -/* ch32v00x_spi.h ------------------------------------------------------------*/ - -/* SPI_data_direction */ -#define SPI_Direction_2Lines_FullDuplex ((uint16_t)0x0000) -#define SPI_Direction_2Lines_RxOnly ((uint16_t)0x0400) -#define SPI_Direction_1Line_Rx ((uint16_t)0x8000) -#define SPI_Direction_1Line_Tx ((uint16_t)0xC000) - -/* SPI_mode */ -#define SPI_Mode_Master ((uint16_t)0x0104) /* Sets MSTR, as well as SSI, which is required for Master Mode */ -#define SPI_Mode_Slave ((uint16_t)0x0000) - -/* SPI_data_size */ -#define SPI_DataSize_16b ((uint16_t)0x0800) -#define SPI_DataSize_8b ((uint16_t)0x0000) - -/* SPI_Clock_Polarity */ -#define SPI_CPOL_Low ((uint16_t)0x0000) -#define SPI_CPOL_High ((uint16_t)0x0002) - -/* SPI_Clock_Phase */ -#define SPI_CPHA_1Edge ((uint16_t)0x0000) -#define SPI_CPHA_2Edge ((uint16_t)0x0001) - -/* SPI_Slave_Select_management */ -#define SPI_NSS_Soft ((uint16_t)0x0200) -#define SPI_NSS_Hard ((uint16_t)0x0000) - -/* SPI_BaudRate_Prescaler */ -#define SPI_BaudRatePrescaler_2 ((uint16_t)0x0000) -#define SPI_BaudRatePrescaler_4 ((uint16_t)0x0008) -#define SPI_BaudRatePrescaler_8 ((uint16_t)0x0010) -#define SPI_BaudRatePrescaler_16 ((uint16_t)0x0018) -#define SPI_BaudRatePrescaler_32 ((uint16_t)0x0020) -#define SPI_BaudRatePrescaler_64 ((uint16_t)0x0028) -#define SPI_BaudRatePrescaler_128 ((uint16_t)0x0030) -#define SPI_BaudRatePrescaler_256 ((uint16_t)0x0038) - -/* SPI_MSB transmission */ -#define SPI_FirstBit_MSB ((uint16_t)0x0000) -#define SPI_FirstBit_LSB ((uint16_t)0x0080) // not support SPI slave mode - -/* SPI_I2S_DMA_transfer_requests */ -#define SPI_I2S_DMAReq_Tx ((uint16_t)0x0002) -#define SPI_I2S_DMAReq_Rx ((uint16_t)0x0001) - -/* SPI_NSS_internal_software_management */ -#define SPI_NSSInternalSoft_Set ((uint16_t)0x0100) -#define SPI_NSSInternalSoft_Reset ((uint16_t)0xFEFF) - -/* SPI_CRC_Transmit_Receive */ -#define SPI_CRC_Tx ((uint8_t)0x00) -#define SPI_CRC_Rx ((uint8_t)0x01) - -/* SPI_direction_transmit_receive */ -#define SPI_Direction_Rx ((uint16_t)0xBFFF) -#define SPI_Direction_Tx ((uint16_t)0x4000) - -/* SPI_I2S_interrupts_definition */ -#define SPI_I2S_IT_TXE ((uint8_t)0x71) -#define SPI_I2S_IT_RXNE ((uint8_t)0x60) -#define SPI_I2S_IT_ERR ((uint8_t)0x50) -#define SPI_I2S_IT_OVR ((uint8_t)0x56) -#define SPI_IT_MODF ((uint8_t)0x55) -#define SPI_IT_CRCERR ((uint8_t)0x54) -#define I2S_IT_UDR ((uint8_t)0x53) - -/* SPI_I2S_flags_definition */ -#define SPI_I2S_FLAG_RXNE ((uint16_t)0x0001) -#define SPI_I2S_FLAG_TXE ((uint16_t)0x0002) -#define I2S_FLAG_CHSIDE ((uint16_t)0x0004) -#define I2S_FLAG_UDR ((uint16_t)0x0008) -#define SPI_FLAG_CRCERR ((uint16_t)0x0010) -#define SPI_FLAG_MODF ((uint16_t)0x0020) -#define SPI_I2S_FLAG_OVR ((uint16_t)0x0040) -#define SPI_I2S_FLAG_BSY ((uint16_t)0x0080) - -/* ch32v00x_tim.h ------------------------------------------------------------*/ - -/* TIM_Output_Compare_and_PWM_modes */ -#define TIM_OCMode_Timing ((uint16_t)0x0000) -#define TIM_OCMode_Active ((uint16_t)0x0010) -#define TIM_OCMode_Inactive ((uint16_t)0x0020) -#define TIM_OCMode_Toggle ((uint16_t)0x0030) -#define TIM_OCMode_PWM1 ((uint16_t)0x0060) -#define TIM_OCMode_PWM2 ((uint16_t)0x0070) - -/* TIM_One_Pulse_Mode */ -#define TIM_OPMode_Single ((uint16_t)0x0008) -#define TIM_OPMode_Repetitive ((uint16_t)0x0000) - -/* TIM_Channel */ -#define TIM_Channel_1 ((uint16_t)0x0000) -#define TIM_Channel_2 ((uint16_t)0x0004) -#define TIM_Channel_3 ((uint16_t)0x0008) -#define TIM_Channel_4 ((uint16_t)0x000C) - -/* TIM_Clock_Division_CKD */ -#define TIM_CKD_DIV1 ((uint16_t)0x0000) -#define TIM_CKD_DIV2 ((uint16_t)0x0100) -#define TIM_CKD_DIV4 ((uint16_t)0x0200) - -/* TIM_Counter_Mode */ -#define TIM_CounterMode_Up ((uint16_t)0x0000) -#define TIM_CounterMode_Down ((uint16_t)0x0010) -#define TIM_CounterMode_CenterAligned1 ((uint16_t)0x0020) -#define TIM_CounterMode_CenterAligned2 ((uint16_t)0x0040) -#define TIM_CounterMode_CenterAligned3 ((uint16_t)0x0060) - -/* TIM_Output_Compare_Polarity */ -#define TIM_OCPolarity_High ((uint16_t)0x0000) -#define TIM_OCPolarity_Low ((uint16_t)0x0002) - -/* TIM_Output_Compare_N_Polarity */ -#define TIM_OCNPolarity_High ((uint16_t)0x0000) -#define TIM_OCNPolarity_Low ((uint16_t)0x0008) - -/* TIM_Output_Compare_state */ -#define TIM_OutputState_Disable ((uint16_t)0x0000) -#define TIM_OutputState_Enable ((uint16_t)0x0001) - -/* TIM_Output_Compare_N_state */ -#define TIM_OutputNState_Disable ((uint16_t)0x0000) -#define TIM_OutputNState_Enable ((uint16_t)0x0004) - -/* TIM_Capture_Compare_state */ -#define TIM_CCx_Enable ((uint16_t)0x0001) -#define TIM_CCx_Disable ((uint16_t)0x0000) - -/* TIM_Capture_Compare_N_state */ -#define TIM_CCxN_Enable ((uint16_t)0x0004) -#define TIM_CCxN_Disable ((uint16_t)0x0000) - -/* Break_Input_enable_disable */ -#define TIM_Break_Enable ((uint16_t)0x1000) -#define TIM_Break_Disable ((uint16_t)0x0000) - -/* Break_Polarity */ -#define TIM_BreakPolarity_Low ((uint16_t)0x0000) -#define TIM_BreakPolarity_High ((uint16_t)0x2000) - -/* TIM_AOE_Bit_Set_Reset */ -#define TIM_AutomaticOutput_Enable ((uint16_t)0x4000) -#define TIM_AutomaticOutput_Disable ((uint16_t)0x0000) - -/* Lock_level */ -#define TIM_LOCKLevel_OFF ((uint16_t)0x0000) -#define TIM_LOCKLevel_1 ((uint16_t)0x0100) -#define TIM_LOCKLevel_2 ((uint16_t)0x0200) -#define TIM_LOCKLevel_3 ((uint16_t)0x0300) - -/* OSSI_Off_State_Selection_for_Idle_mode_state */ -#define TIM_OSSIState_Enable ((uint16_t)0x0400) -#define TIM_OSSIState_Disable ((uint16_t)0x0000) - -/* OSSR_Off_State_Selection_for_Run_mode_state */ -#define TIM_OSSRState_Enable ((uint16_t)0x0800) -#define TIM_OSSRState_Disable ((uint16_t)0x0000) - -/* TIM_Output_Compare_Idle_State */ -#define TIM_OCIdleState_Set ((uint16_t)0x0100) -#define TIM_OCIdleState_Reset ((uint16_t)0x0000) - -/* TIM_Output_Compare_N_Idle_State */ -#define TIM_OCNIdleState_Set ((uint16_t)0x0200) -#define TIM_OCNIdleState_Reset ((uint16_t)0x0000) - -/* TIM_Input_Capture_Polarity */ -#define TIM_ICPolarity_Rising ((uint16_t)0x0000) -#define TIM_ICPolarity_Falling ((uint16_t)0x0002) -#define TIM_ICPolarity_BothEdge ((uint16_t)0x000A) - -/* TIM_Input_Capture_Selection */ -#define TIM_ICSelection_DirectTI ((uint16_t)0x0001) /* TIM Input 1, 2, 3 or 4 is selected to be \ - connected to IC1, IC2, IC3 or IC4, respectively */ -#define TIM_ICSelection_IndirectTI ((uint16_t)0x0002) /* TIM Input 1, 2, 3 or 4 is selected to be \ - connected to IC2, IC1, IC4 or IC3, respectively. */ -#define TIM_ICSelection_TRC ((uint16_t)0x0003) /* TIM Input 1, 2, 3 or 4 is selected to be connected to TRC. */ - -/* TIM_Input_Capture_Prescaler */ -#define TIM_ICPSC_DIV1 ((uint16_t)0x0000) /* Capture performed each time an edge is detected on the capture input. */ -#define TIM_ICPSC_DIV2 ((uint16_t)0x0004) /* Capture performed once every 2 events. */ -#define TIM_ICPSC_DIV4 ((uint16_t)0x0008) /* Capture performed once every 4 events. */ -#define TIM_ICPSC_DIV8 ((uint16_t)0x000C) /* Capture performed once every 8 events. */ - -/* TIM_interrupt_sources */ -#define TIM_IT_Update ((uint16_t)0x0001) -#define TIM_IT_CC1 ((uint16_t)0x0002) -#define TIM_IT_CC2 ((uint16_t)0x0004) -#define TIM_IT_CC3 ((uint16_t)0x0008) -#define TIM_IT_CC4 ((uint16_t)0x0010) -#define TIM_IT_COM ((uint16_t)0x0020) -#define TIM_IT_Trigger ((uint16_t)0x0040) -#define TIM_IT_Break ((uint16_t)0x0080) - -/* TIM_DMA_Base_address */ -#define TIM_DMABase_CR1 ((uint16_t)0x0000) -#define TIM_DMABase_CR2 ((uint16_t)0x0001) -#define TIM_DMABase_SMCR ((uint16_t)0x0002) -#define TIM_DMABase_DIER ((uint16_t)0x0003) -#define TIM_DMABase_SR ((uint16_t)0x0004) -#define TIM_DMABase_EGR ((uint16_t)0x0005) -#define TIM_DMABase_CCMR1 ((uint16_t)0x0006) -#define TIM_DMABase_CCMR2 ((uint16_t)0x0007) -#define TIM_DMABase_CCER ((uint16_t)0x0008) -#define TIM_DMABase_CNT ((uint16_t)0x0009) -#define TIM_DMABase_PSC ((uint16_t)0x000A) -#define TIM_DMABase_ARR ((uint16_t)0x000B) -#define TIM_DMABase_RCR ((uint16_t)0x000C) -#define TIM_DMABase_CCR1 ((uint16_t)0x000D) -#define TIM_DMABase_CCR2 ((uint16_t)0x000E) -#define TIM_DMABase_CCR3 ((uint16_t)0x000F) -#define TIM_DMABase_CCR4 ((uint16_t)0x0010) -#define TIM_DMABase_BDTR ((uint16_t)0x0011) -#define TIM_DMABase_DCR ((uint16_t)0x0012) - -/* TIM_DMA_Burst_Length */ -#define TIM_DMABurstLength_1Transfer ((uint16_t)0x0000) -#define TIM_DMABurstLength_2Transfers ((uint16_t)0x0100) -#define TIM_DMABurstLength_3Transfers ((uint16_t)0x0200) -#define TIM_DMABurstLength_4Transfers ((uint16_t)0x0300) -#define TIM_DMABurstLength_5Transfers ((uint16_t)0x0400) -#define TIM_DMABurstLength_6Transfers ((uint16_t)0x0500) -#define TIM_DMABurstLength_7Transfers ((uint16_t)0x0600) -#define TIM_DMABurstLength_8Transfers ((uint16_t)0x0700) -#define TIM_DMABurstLength_9Transfers ((uint16_t)0x0800) -#define TIM_DMABurstLength_10Transfers ((uint16_t)0x0900) -#define TIM_DMABurstLength_11Transfers ((uint16_t)0x0A00) -#define TIM_DMABurstLength_12Transfers ((uint16_t)0x0B00) -#define TIM_DMABurstLength_13Transfers ((uint16_t)0x0C00) -#define TIM_DMABurstLength_14Transfers ((uint16_t)0x0D00) -#define TIM_DMABurstLength_15Transfers ((uint16_t)0x0E00) -#define TIM_DMABurstLength_16Transfers ((uint16_t)0x0F00) -#define TIM_DMABurstLength_17Transfers ((uint16_t)0x1000) -#define TIM_DMABurstLength_18Transfers ((uint16_t)0x1100) - -/* TIM_DMA_sources */ -#define TIM_DMA_Update ((uint16_t)0x0100) -#define TIM_DMA_CC1 ((uint16_t)0x0200) -#define TIM_DMA_CC2 ((uint16_t)0x0400) -#define TIM_DMA_CC3 ((uint16_t)0x0800) -#define TIM_DMA_CC4 ((uint16_t)0x1000) -#define TIM_DMA_COM ((uint16_t)0x2000) -#define TIM_DMA_Trigger ((uint16_t)0x4000) - -/* TIM_External_Trigger_Prescaler */ -#define TIM_ExtTRGPSC_OFF ((uint16_t)0x0000) -#define TIM_ExtTRGPSC_DIV2 ((uint16_t)0x1000) -#define TIM_ExtTRGPSC_DIV4 ((uint16_t)0x2000) -#define TIM_ExtTRGPSC_DIV8 ((uint16_t)0x3000) - -/* TIM_Internal_Trigger_Selection */ -#define TIM_TS_ITR0 ((uint16_t)0x0000) -#define TIM_TS_ITR1 ((uint16_t)0x0010) -#define TIM_TS_ITR2 ((uint16_t)0x0020) -#define TIM_TS_ITR3 ((uint16_t)0x0030) -#define TIM_TS_TI1F_ED ((uint16_t)0x0040) -#define TIM_TS_TI1FP1 ((uint16_t)0x0050) -#define TIM_TS_TI2FP2 ((uint16_t)0x0060) -#define TIM_TS_ETRF ((uint16_t)0x0070) - -/* TIM_TIx_External_Clock_Source */ -#define TIM_TIxExternalCLK1Source_TI1 ((uint16_t)0x0050) -#define TIM_TIxExternalCLK1Source_TI2 ((uint16_t)0x0060) -#define TIM_TIxExternalCLK1Source_TI1ED ((uint16_t)0x0040) - -/* TIM_External_Trigger_Polarity */ -#define TIM_ExtTRGPolarity_Inverted ((uint16_t)0x8000) -#define TIM_ExtTRGPolarity_NonInverted ((uint16_t)0x0000) - -/* TIM_Prescaler_Reload_Mode */ -#define TIM_PSCReloadMode_Update ((uint16_t)0x0000) -#define TIM_PSCReloadMode_Immediate ((uint16_t)0x0001) - -/* TIM_Forced_Action */ -#define TIM_ForcedAction_Active ((uint16_t)0x0050) -#define TIM_ForcedAction_InActive ((uint16_t)0x0040) - -/* TIM_Encoder_Mode */ -#define TIM_EncoderMode_TI1 ((uint16_t)0x0001) -#define TIM_EncoderMode_TI2 ((uint16_t)0x0002) -#define TIM_EncoderMode_TI12 ((uint16_t)0x0003) - -/* TIM_Event_Source */ -#define TIM_EventSource_Update ((uint16_t)0x0001) -#define TIM_EventSource_CC1 ((uint16_t)0x0002) -#define TIM_EventSource_CC2 ((uint16_t)0x0004) -#define TIM_EventSource_CC3 ((uint16_t)0x0008) -#define TIM_EventSource_CC4 ((uint16_t)0x0010) -#define TIM_EventSource_COM ((uint16_t)0x0020) -#define TIM_EventSource_Trigger ((uint16_t)0x0040) -#define TIM_EventSource_Break ((uint16_t)0x0080) - -/* TIM_Update_Source */ -#define TIM_UpdateSource_Global ((uint16_t)0x0000) /* Source of update is the counter overflow/underflow \ - or the setting of UG bit, or an update generation \ - through the slave mode controller. */ -#define TIM_UpdateSource_Regular ((uint16_t)0x0001) /* Source of update is counter overflow/underflow. */ - -/* TIM_Output_Compare_Preload_State */ -#define TIM_OCPreload_Enable ((uint16_t)0x0008) -#define TIM_OCPreload_Disable ((uint16_t)0x0000) - -/* TIM_Output_Compare_Fast_State */ -#define TIM_OCFast_Enable ((uint16_t)0x0004) -#define TIM_OCFast_Disable ((uint16_t)0x0000) - -/* TIM_Output_Compare_Clear_State */ -#define TIM_OCClear_Enable ((uint16_t)0x0080) -#define TIM_OCClear_Disable ((uint16_t)0x0000) - -/* TIM_Trigger_Output_Source */ -#define TIM_TRGOSource_Reset ((uint16_t)0x0000) -#define TIM_TRGOSource_Enable ((uint16_t)0x0010) -#define TIM_TRGOSource_Update ((uint16_t)0x0020) -#define TIM_TRGOSource_OC1 ((uint16_t)0x0030) -#define TIM_TRGOSource_OC1Ref ((uint16_t)0x0040) -#define TIM_TRGOSource_OC2Ref ((uint16_t)0x0050) -#define TIM_TRGOSource_OC3Ref ((uint16_t)0x0060) -#define TIM_TRGOSource_OC4Ref ((uint16_t)0x0070) - -/* TIM_Slave_Mode */ -#define TIM_SlaveMode_Reset ((uint16_t)0x0004) -#define TIM_SlaveMode_Gated ((uint16_t)0x0005) -#define TIM_SlaveMode_Trigger ((uint16_t)0x0006) -#define TIM_SlaveMode_External1 ((uint16_t)0x0007) - -/* TIM_Master_Slave_Mode */ -#define TIM_MasterSlaveMode_Enable ((uint16_t)0x0080) -#define TIM_MasterSlaveMode_Disable ((uint16_t)0x0000) - -/* TIM_Flags */ -#define TIM_FLAG_Update ((uint16_t)0x0001) -#define TIM_FLAG_CC1 ((uint16_t)0x0002) -#define TIM_FLAG_CC2 ((uint16_t)0x0004) -#define TIM_FLAG_CC3 ((uint16_t)0x0008) -#define TIM_FLAG_CC4 ((uint16_t)0x0010) -#define TIM_FLAG_COM ((uint16_t)0x0020) -#define TIM_FLAG_Trigger ((uint16_t)0x0040) -#define TIM_FLAG_Break ((uint16_t)0x0080) -#define TIM_FLAG_CC1OF ((uint16_t)0x0200) -#define TIM_FLAG_CC2OF ((uint16_t)0x0400) -#define TIM_FLAG_CC3OF ((uint16_t)0x0800) -#define TIM_FLAG_CC4OF ((uint16_t)0x1000) - -/* TIM_Legacy */ -#define TIM_DMABurstLength_1Byte TIM_DMABurstLength_1Transfer -#define TIM_DMABurstLength_2Bytes TIM_DMABurstLength_2Transfers -#define TIM_DMABurstLength_3Bytes TIM_DMABurstLength_3Transfers -#define TIM_DMABurstLength_4Bytes TIM_DMABurstLength_4Transfers -#define TIM_DMABurstLength_5Bytes TIM_DMABurstLength_5Transfers -#define TIM_DMABurstLength_6Bytes TIM_DMABurstLength_6Transfers -#define TIM_DMABurstLength_7Bytes TIM_DMABurstLength_7Transfers -#define TIM_DMABurstLength_8Bytes TIM_DMABurstLength_8Transfers -#define TIM_DMABurstLength_9Bytes TIM_DMABurstLength_9Transfers -#define TIM_DMABurstLength_10Bytes TIM_DMABurstLength_10Transfers -#define TIM_DMABurstLength_11Bytes TIM_DMABurstLength_11Transfers -#define TIM_DMABurstLength_12Bytes TIM_DMABurstLength_12Transfers -#define TIM_DMABurstLength_13Bytes TIM_DMABurstLength_13Transfers -#define TIM_DMABurstLength_14Bytes TIM_DMABurstLength_14Transfers -#define TIM_DMABurstLength_15Bytes TIM_DMABurstLength_15Transfers -#define TIM_DMABurstLength_16Bytes TIM_DMABurstLength_16Transfers -#define TIM_DMABurstLength_17Bytes TIM_DMABurstLength_17Transfers -#define TIM_DMABurstLength_18Bytes TIM_DMABurstLength_18Transfers - -/* TIM_Supersede_Mode_OC1 */ -#define TIM_Supersede_Mode_OC1_H ((uint16_t)0x0000) -#define TIM_Supersede_Mode_OC1_L ((uint16_t)0x0010) - -/* TIM_Supersede_Mode_OC2 */ -#define TIM_Supersede_Mode_OC2_H ((uint16_t)0x0000) -#define TIM_Supersede_Mode_OC2_L ((uint16_t)0x0020) - -/* TIM_Supersede_Mode_OC3 */ -#define TIM_Supersede_Mode_OC3_H ((uint16_t)0x0000) -#define TIM_Supersede_Mode_OC3_L ((uint16_t)0x0040) - -/* TIM_Supersede_Mode_OC4 */ -#define TIM_Supersede_Mode_OC4_H ((uint16_t)0x0000) -#define TIM_Supersede_Mode_OC4_L ((uint16_t)0x0080) - -/* ch32v00x_usart.h ----------------------------------------------------------*/ - -/* USART_Word_Length */ -#define USART_WordLength_8b ((uint16_t)0x0000) -#define USART_WordLength_9b ((uint16_t)0x1000) - -/* USART_Stop_Bits */ -#define USART_StopBits_1 ((uint16_t)0x0000) -#define USART_StopBits_0_5 ((uint16_t)0x1000) -#define USART_StopBits_2 ((uint16_t)0x2000) -#define USART_StopBits_1_5 ((uint16_t)0x3000) - -/* USART_Parity */ -#define USART_Parity_No ((uint16_t)0x0000) -#define USART_Parity_Even ((uint16_t)0x0400) -#define USART_Parity_Odd ((uint16_t)0x0600) - -/* USART_Mode */ -#define USART_Mode_Rx ((uint16_t)0x0004) -#define USART_Mode_Tx ((uint16_t)0x0008) - -/* USART_Hardware_Flow_Control */ -#define USART_HardwareFlowControl_None ((uint16_t)0x0000) -#define USART_HardwareFlowControl_RTS ((uint16_t)0x0100) -#define USART_HardwareFlowControl_CTS ((uint16_t)0x0200) -#define USART_HardwareFlowControl_RTS_CTS ((uint16_t)0x0300) - -/* USART_Clock */ -#define USART_Clock_Disable ((uint16_t)0x0000) -#define USART_Clock_Enable ((uint16_t)0x0800) - -/* USART_Clock_Polarity */ -#define USART_CPOL_Low ((uint16_t)0x0000) -#define USART_CPOL_High ((uint16_t)0x0400) - -/* USART_Clock_Phase */ -#define USART_CPHA_1Edge ((uint16_t)0x0000) -#define USART_CPHA_2Edge ((uint16_t)0x0200) - -/* USART_Last_Bit */ -#define USART_LastBit_Disable ((uint16_t)0x0000) -#define USART_LastBit_Enable ((uint16_t)0x0100) - -/* USART_Interrupt_definition */ -#define USART_IT_PE ((uint16_t)0x0028) -#define USART_IT_TXE ((uint16_t)0x0727) -#define USART_IT_TC ((uint16_t)0x0626) -#define USART_IT_RXNE ((uint16_t)0x0525) -#define USART_IT_ORE_RX ((uint16_t)0x0325) -#define USART_IT_IDLE ((uint16_t)0x0424) -#define USART_IT_LBD ((uint16_t)0x0846) -#define USART_IT_CTS ((uint16_t)0x096A) -#define USART_IT_ERR ((uint16_t)0x0060) -#define USART_IT_ORE_ER ((uint16_t)0x0360) -#define USART_IT_NE ((uint16_t)0x0260) -#define USART_IT_FE ((uint16_t)0x0160) - -#define USART_IT_ORE USART_IT_ORE_ER - -/* USART_DMA_Requests */ -#define USART_DMAReq_Tx ((uint16_t)0x0080) -#define USART_DMAReq_Rx ((uint16_t)0x0040) - -/* USART_WakeUp_methods */ -#define USART_WakeUp_IdleLine ((uint16_t)0x0000) -#define USART_WakeUp_AddressMark ((uint16_t)0x0800) - -/* USART_LIN_Break_Detection_Length */ -#define USART_LINBreakDetectLength_10b ((uint16_t)0x0000) -#define USART_LINBreakDetectLength_11b ((uint16_t)0x0020) - -/* USART_IrDA_Low_Power */ -#define USART_IrDAMode_LowPower ((uint16_t)0x0004) -#define USART_IrDAMode_Normal ((uint16_t)0x0000) - -/* USART_Flags */ -#define USART_FLAG_CTS ((uint16_t)0x0200) -#define USART_FLAG_LBD ((uint16_t)0x0100) -#define USART_FLAG_TXE ((uint16_t)0x0080) -#define USART_FLAG_TC ((uint16_t)0x0040) -#define USART_FLAG_RXNE ((uint16_t)0x0020) -#define USART_FLAG_IDLE ((uint16_t)0x0010) -#define USART_FLAG_ORE ((uint16_t)0x0008) -#define USART_FLAG_NE ((uint16_t)0x0004) -#define USART_FLAG_FE ((uint16_t)0x0002) -#define USART_FLAG_PE ((uint16_t)0x0001) - - // While not truly CH32X035, we can re-use some of the USB register defs. - /* ch32v10x_usb.h ------------------------------------------------------------*/ - -#ifndef NULL -#define NULL 0 -#endif - -#ifndef VOID -#define VOID void -#endif -#ifndef CONST -#define CONST const -#endif -#ifndef BOOL - typedef unsigned char BOOL; -#endif -#ifndef BOOLEAN - typedef unsigned char BOOLEAN; -#endif -#ifndef CHAR - typedef char CHAR; -#endif -#ifndef INT8 - typedef char INT8; -#endif -#ifndef INT16 - typedef short INT16; -#endif -#ifndef INT32 - typedef long INT32; -#endif -#ifndef UINT8 - typedef unsigned char UINT8; -#endif -#ifndef UINT16 - typedef unsigned short UINT16; -#endif -#ifndef UINT32 - typedef unsigned long UINT32; -#endif -#ifndef UINT8V - typedef unsigned char volatile UINT8V; -#endif -#ifndef UINT16V - typedef unsigned short volatile UINT16V; -#endif -#ifndef UINT32V - typedef unsigned long volatile UINT32V; -#endif - -#ifndef PVOID - typedef void *PVOID; -#endif -#ifndef PCHAR - typedef char *PCHAR; -#endif -#ifndef PCHAR - typedef const char *PCCHAR; -#endif -#ifndef PINT8 - typedef char *PINT8; -#endif -#ifndef PINT16 - typedef short *PINT16; -#endif -#ifndef PINT32 - typedef long *PINT32; -#endif -#ifndef PUINT8 - typedef unsigned char *PUINT8; -#endif -#ifndef PUINT16 - typedef unsigned short *PUINT16; -#endif -#ifndef PUINT32 - typedef unsigned long *PUINT32; -#endif -#ifndef PUINT8V - typedef volatile unsigned char *PUINT8V; -#endif -#ifndef PUINT16V - typedef volatile unsigned short *PUINT16V; -#endif -#ifndef PUINT32V - typedef volatile unsigned long *PUINT32V; -#endif - -/******************************************************************************/ -/* Peripheral memory map */ -/******************************************************************************/ -/* USB */ -#define R32_USB_CONTROL (*((PUINT32V)(0x40023400))) // USB control & interrupt enable & device address -#define R8_USB_CTRL (*((PUINT8V)(0x40023400))) // USB base control -#define RB_UC_HOST_MODE 0x80 // enable USB host mode: 0=device mode, 1=host mode -#define RB_UC_LOW_SPEED 0x40 // enable USB low speed: 0=12Mbps, 1=1.5Mbps -#define RB_UC_DEV_PU_EN 0x20 // USB device enable and internal pullup resistance enable -#define RB_UC_SYS_CTRL1 0x20 // USB system control high bit -#define RB_UC_SYS_CTRL0 0x10 // USB system control low bit -#define MASK_UC_SYS_CTRL 0x30 // bit mask of USB system control -// bUC_HOST_MODE & bUC_SYS_CTRL1 & bUC_SYS_CTRL0: USB system control -// 0 00: disable USB device and disable internal pullup resistance -// 0 01: enable USB device and disable internal pullup resistance, need external pullup resistance -// 0 1x: enable USB device and enable internal pullup resistance -// 1 00: enable USB host and normal status -// 1 01: enable USB host and force UDP/UDM output SE0 state -// 1 10: enable USB host and force UDP/UDM output J state -// 1 11: enable USB host and force UDP/UDM output resume or K state -#define RB_UC_INT_BUSY 0x08 // enable automatic responding busy for device mode or automatic pause for host mode during interrupt flag UIF_TRANSFER valid -#define RB_UC_RESET_SIE 0x04 // force reset USB SIE, need software clear -#define RB_UC_CLR_ALL 0x02 // force clear FIFO and count of USB -#define RB_UC_DMA_EN 0x01 // DMA enable and DMA interrupt enable for USB - -#define R8_UDEV_CTRL (*((PUINT8V)(0x40023401))) // USB device physical prot control -#define RB_UD_PD_DIS 0x80 // disable USB UDP/UDM pulldown resistance: 0=enable pulldown, 1=disable -#define RB_UD_DP_PIN 0x20 // ReadOnly: indicate current UDP pin level -#define RB_UD_DM_PIN 0x10 // ReadOnly: indicate current UDM pin level -#define RB_UD_LOW_SPEED 0x04 // enable USB physical port low speed: 0=full speed, 1=low speed -#define RB_UD_GP_BIT 0x02 // general purpose bit -#define RB_UD_PORT_EN 0x01 // enable USB physical port I/O: 0=disable, 1=enable - -#define R8_UHOST_CTRL R8_UDEV_CTRL // USB host physical prot control -#define RB_UH_PD_DIS 0x80 // disable USB UDP/UDM pulldown resistance: 0=enable pulldown, 1=disable -#define RB_UH_DP_PIN 0x20 // ReadOnly: indicate current UDP pin level -#define RB_UH_DM_PIN 0x10 // ReadOnly: indicate current UDM pin level -#define RB_UH_LOW_SPEED 0x04 // enable USB port low speed: 0=full speed, 1=low speed -#define RB_UH_BUS_RESET 0x02 // control USB bus reset: 0=normal, 1=force bus reset -#define RB_UH_PORT_EN 0x01 // enable USB port: 0=disable, 1=enable port, automatic disabled if USB device detached - -#define R8_USB_INT_EN (*((PUINT8V)(0x40023402))) // USB interrupt enable -#define RB_UIE_DEV_SOF 0x80 // enable interrupt for SOF received for USB device mode -#define RB_UIE_DEV_NAK 0x40 // enable interrupt for NAK responded for USB device mode -#define RB_UIE_FIFO_OV 0x10 // enable interrupt for FIFO overflow -#define RB_UIE_HST_SOF 0x08 // enable interrupt for host SOF timer action for USB host mode -#define RB_UIE_SUSPEND 0x04 // enable interrupt for USB suspend or resume event -#define RB_UIE_TRANSFER 0x02 // enable interrupt for USB transfer completion -#define RB_UIE_DETECT 0x01 // enable interrupt for USB device detected event for USB host mode -#define RB_UIE_BUS_RST 0x01 // enable interrupt for USB bus reset event for USB device mode - -#define R8_USB_DEV_AD (*((PUINT8V)(0x40023403))) // USB device address -#define RB_UDA_GP_BIT 0x80 // general purpose bit -#define MASK_USB_ADDR 0x7F // bit mask for USB device address - -#define R32_USB_STATUS (*((PUINT32V)(0x40023404))) // USB miscellaneous status & interrupt flag & interrupt status -#define R8_USB_MIS_ST (*((PUINT8V)(0x40023405))) // USB miscellaneous status -#define RB_UMS_SOF_PRES 0x80 // RO, indicate host SOF timer presage status -#define RB_UMS_SOF_ACT 0x40 // RO, indicate host SOF timer action status for USB host -#define RB_UMS_SIE_FREE 0x20 // RO, indicate USB SIE free status -#define RB_UMS_R_FIFO_RDY 0x10 // RO, indicate USB receiving FIFO ready status (not empty) -#define RB_UMS_BUS_RESET 0x08 // RO, indicate USB bus reset status -#define RB_UMS_SUSPEND 0x04 // RO, indicate USB suspend status -#define RB_UMS_DM_LEVEL 0x02 // RO, indicate UDM level saved at device attached to USB host -#define RB_UMS_DEV_ATTACH 0x01 // RO, indicate device attached status on USB host - -#define R8_USB_INT_FG (*((PUINT8V)(0x40023406))) // USB interrupt flag -#define RB_U_IS_NAK 0x80 // RO, indicate current USB transfer is NAK received -#define RB_U_TOG_OK 0x40 // RO, indicate current USB transfer toggle is OK -#define RB_U_SIE_FREE 0x20 // RO, indicate USB SIE free status -#define RB_UIF_FIFO_OV 0x10 // FIFO overflow interrupt flag for USB, direct bit address clear or write 1 to clear -#define RB_UIF_HST_SOF 0x08 // host SOF timer interrupt flag for USB host, direct bit address clear or write 1 to clear -#define RB_UIF_SUSPEND 0x04 // USB suspend or resume event interrupt flag, direct bit address clear or write 1 to clear -#define RB_UIF_TRANSFER 0x02 // USB transfer completion interrupt flag, direct bit address clear or write 1 to clear -#define RB_UIF_DETECT 0x01 // device detected event interrupt flag for USB host mode, direct bit address clear or write 1 to clear -#define RB_UIF_BUS_RST 0x01 // bus reset event interrupt flag for USB device mode, direct bit address clear or write 1 to clear - -#define R8_USB_INT_ST (*((PUINT8V)(0x40023407))) // USB interrupt status -#define RB_UIS_IS_NAK 0x80 // RO, indicate current USB transfer is NAK received for USB device mode -#define RB_UIS_TOG_OK 0x40 // RO, indicate current USB transfer toggle is OK -#define RB_UIS_TOKEN1 0x20 // RO, current token PID code bit 1 received for USB device mode -#define RB_UIS_TOKEN0 0x10 // RO, current token PID code bit 0 received for USB device mode -#define MASK_UIS_TOKEN 0x30 // RO, bit mask of current token PID code received for USB device mode -#define UIS_TOKEN_OUT 0x00 -#define UIS_TOKEN_SOF 0x10 -#define UIS_TOKEN_IN 0x20 -#define UIS_TOKEN_SETUP 0x30 -// bUIS_TOKEN1 & bUIS_TOKEN0: current token PID code received for USB device mode -// 00: OUT token PID received -// 01: SOF token PID received -// 10: IN token PID received -// 11: SETUP token PID received -#define MASK_UIS_ENDP 0x0F // RO, bit mask of current transfer endpoint number for USB device mode -#define MASK_UIS_H_RES 0x0F // RO, bit mask of current transfer handshake response for USB host mode: 0000=no response, time out from device, others=handshake response PID received - -#define R16_USB_RX_LEN (*((PUINT16V)(0x40023408))) // USB receiving length -#define MASK_UIS_RX_LEN 0x3FF // RO, bit mask of current receive length(10 bits for ch32v10x) -#define R32_USB_BUF_MODE (*((PUINT32V)(0x4002340c))) // USB endpoint buffer mode -#define R8_UEP4_1_MOD (*((PUINT8V)(0x4002340c))) // endpoint 4/1 mode -#define RB_UEP1_RX_EN 0x80 // enable USB endpoint 1 receiving (OUT) -#define RB_UEP1_TX_EN 0x40 // enable USB endpoint 1 transmittal (IN) -#define RB_UEP1_BUF_MOD 0x10 // buffer mode of USB endpoint 1 -// bUEPn_RX_EN & bUEPn_TX_EN & bUEPn_BUF_MOD: USB endpoint 1/2/3 buffer mode, buffer start address is UEPn_DMA -// 0 0 x: disable endpoint and disable buffer -// 1 0 0: 64 bytes buffer for receiving (OUT endpoint) -// 1 0 1: dual 64 bytes buffer by toggle bit bUEP_R_TOG selection for receiving (OUT endpoint), total=128bytes -// 0 1 0: 64 bytes buffer for transmittal (IN endpoint) -// 0 1 1: dual 64 bytes buffer by toggle bit bUEP_T_TOG selection for transmittal (IN endpoint), total=128bytes -// 1 1 0: 64 bytes buffer for receiving (OUT endpoint) + 64 bytes buffer for transmittal (IN endpoint), total=128bytes -// 1 1 1: dual 64 bytes buffer by bUEP_R_TOG selection for receiving (OUT endpoint) + dual 64 bytes buffer by bUEP_T_TOG selection for transmittal (IN endpoint), total=256bytes -#define RB_UEP4_RX_EN 0x08 // enable USB endpoint 4 receiving (OUT) -#define RB_UEP4_TX_EN 0x04 // enable USB endpoint 4 transmittal (IN) - // bUEP4_RX_EN & bUEP4_TX_EN: USB endpoint 4 buffer mode, buffer start address is UEP0_DMA - // 0 0: single 64 bytes buffer for endpoint 0 receiving & transmittal (OUT & IN endpoint) - // 1 0: single 64 bytes buffer for endpoint 0 receiving & transmittal (OUT & IN endpoint) + 64 bytes buffer for endpoint 4 receiving (OUT endpoint), total=128bytes - // 0 1: single 64 bytes buffer for endpoint 0 receiving & transmittal (OUT & IN endpoint) + 64 bytes buffer for endpoint 4 transmittal (IN endpoint), total=128bytes - // 1 1: single 64 bytes buffer for endpoint 0 receiving & transmittal (OUT & IN endpoint) - // + 64 bytes buffer for endpoint 4 receiving (OUT endpoint) + 64 bytes buffer for endpoint 4 transmittal (IN endpoint), total=192bytes - -#define R8_UEP2_3_MOD (*((PUINT8V)(0x4002340d))) // endpoint 2/3 mode -#define RB_UEP3_RX_EN 0x80 // enable USB endpoint 3 receiving (OUT) -#define RB_UEP3_TX_EN 0x40 // enable USB endpoint 3 transmittal (IN) -#define RB_UEP3_BUF_MOD 0x10 // buffer mode of USB endpoint 3 -#define RB_UEP2_RX_EN 0x08 // enable USB endpoint 2 receiving (OUT) -#define RB_UEP2_TX_EN 0x04 // enable USB endpoint 2 transmittal (IN) -#define RB_UEP2_BUF_MOD 0x01 // buffer mode of USB endpoint 2 - -#define R8_UH_EP_MOD R8_UEP2_3_MOD // host endpoint mode -#define RB_UH_EP_TX_EN 0x40 // enable USB host OUT endpoint transmittal -#define RB_UH_EP_TBUF_MOD 0x10 // buffer mode of USB host OUT endpoint -// bUH_EP_TX_EN & bUH_EP_TBUF_MOD: USB host OUT endpoint buffer mode, buffer start address is UH_TX_DMA -// 0 x: disable endpoint and disable buffer -// 1 0: 64 bytes buffer for transmittal (OUT endpoint) -// 1 1: dual 64 bytes buffer by toggle bit bUH_T_TOG selection for transmittal (OUT endpoint), total=128bytes -#define RB_UH_EP_RX_EN 0x08 // enable USB host IN endpoint receiving -#define RB_UH_EP_RBUF_MOD 0x01 // buffer mode of USB host IN endpoint - // bUH_EP_RX_EN & bUH_EP_RBUF_MOD: USB host IN endpoint buffer mode, buffer start address is UH_RX_DMA - // 0 x: disable endpoint and disable buffer - // 1 0: 64 bytes buffer for receiving (IN endpoint) - // 1 1: dual 64 bytes buffer by toggle bit bUH_R_TOG selection for receiving (IN endpoint), total=128bytes - -#define R8_UEP5_6_MOD (*((PUINT8V)(0x4002340e))) // endpoint 5/6 mode -#define RB_UEP6_RX_EN 0x80 // enable USB endpoint 6 receiving (OUT) -#define RB_UEP6_TX_EN 0x40 // enable USB endpoint 6 transmittal (IN) -#define RB_UEP6_BUF_MOD 0x10 // buffer mode of USB endpoint 6 -#define RB_UEP5_RX_EN 0x08 // enable USB endpoint 5 receiving (OUT) -#define RB_UEP5_TX_EN 0x04 // enable USB endpoint 5 transmittal (IN) -#define RB_UEP5_BUF_MOD 0x01 // buffer mode of USB endpoint 5 - -#define R8_UEP7_MOD (*((PUINT8V)(0x4002340f))) // endpoint 7 mode -#define RB_UEP7_RX_EN 0x08 // enable USB endpoint 7 receiving (OUT) -#define RB_UEP7_TX_EN 0x04 // enable USB endpoint 7 transmittal (IN) -#define RB_UEP7_BUF_MOD 0x01 // buffer mode of USB endpoint 7 - -#define R16_UEP0_DMA (*((PUINT16V)(0x40023410))) // endpoint 0 DMA buffer address -#define R16_UEP1_DMA (*((PUINT16V)(0x40023414))) // endpoint 1 DMA buffer address -#define R16_UEP2_DMA (*((PUINT16V)(0x40023418))) // endpoint 2 DMA buffer address -#define R16_UH_RX_DMA R16_UEP2_DMA // host rx endpoint buffer high address -#define R16_UEP3_DMA (*((PUINT16V)(0x4002341c))) // endpoint 3 DMA buffer address - -#define R16_UEP4_DMA (*((PUINT16V)(0x40023420))) // endpoint 4 DMA buffer address -#define R16_UEP5_DMA (*((PUINT16V)(0x40023424))) // endpoint 5 DMA buffer address -#define R16_UEP6_DMA (*((PUINT16V)(0x40023428))) // endpoint 6 DMA buffer address -#define R16_UEP7_DMA (*((PUINT16V)(0x4002342c))) // endpoint 7 DMA buffer address - -#define R16_UH_TX_DMA R16_UEP3_DMA // host tx endpoint buffer high address -#define R32_USB_EP0_CTRL (*((PUINT32V)(0x40023430))) // endpoint 0 control & transmittal length -#define R8_UEP0_T_LEN (*((PUINT8V)(0x40023430))) // endpoint 0 transmittal length -#define R8_UEP0_CTRL (*((PUINT8V)(0x40023432))) // endpoint 0 control -#define R32_USB_EP1_CTRL (*((PUINT32V)(0x40023434))) // endpoint 1 control & transmittal length -#define R16_UEP1_T_LEN (*((PUINT16V)(0x40023434))) // endpoint 1 transmittal length(16-bits for ch32v10x) -#define R8_UEP1_CTRL (*((PUINT8V)(0x40023436))) // endpoint 1 control -#define RB_UEP_R_TOG 0x80 // expected data toggle flag of USB endpoint X receiving (OUT): 0=DATA0, 1=DATA1 -#define RB_UEP_T_TOG 0x40 // prepared data toggle flag of USB endpoint X transmittal (IN): 0=DATA0, 1=DATA1 -#define RB_UEP_AUTO_TOG 0x10 // enable automatic toggle after successful transfer completion on endpoint 1/2/3: 0=manual toggle, 1=automatic toggle -#define RB_UEP_R_RES1 0x08 // handshake response type high bit for USB endpoint X receiving (OUT) -#define RB_UEP_R_RES0 0x04 // handshake response type low bit for USB endpoint X receiving (OUT) -#define MASK_UEP_R_RES 0x0C // bit mask of handshake response type for USB endpoint X receiving (OUT) -#define UEP_R_RES_ACK 0x00 -#define UEP_R_RES_TOUT 0x04 -#define UEP_R_RES_NAK 0x08 -#define UEP_R_RES_STALL 0x0C -// RB_UEP_R_RES1 & RB_UEP_R_RES0: handshake response type for USB endpoint X receiving (OUT) -// 00: ACK (ready) -// 01: no response, time out to host, for non-zero endpoint isochronous transactions -// 10: NAK (busy) -// 11: STALL (error) -#define RB_UEP_T_RES1 0x02 // handshake response type high bit for USB endpoint X transmittal (IN) -#define RB_UEP_T_RES0 0x01 // handshake response type low bit for USB endpoint X transmittal (IN) -#define MASK_UEP_T_RES 0x03 // bit mask of handshake response type for USB endpoint X transmittal (IN) -#define UEP_T_RES_ACK 0x00 -#define UEP_T_RES_TOUT 0x01 -#define UEP_T_RES_NAK 0x02 -#define UEP_T_RES_STALL 0x03 - // bUEP_T_RES1 & bUEP_T_RES0: handshake response type for USB endpoint X transmittal (IN) - // 00: DATA0 or DATA1 then expecting ACK (ready) - // 01: DATA0 or DATA1 then expecting no response, time out from host, for non-zero endpoint isochronous transactions - // 10: NAK (busy) - // 11: STALL (error) - -#define R8_UH_SETUP R8_UEP1_CTRL // host aux setup -#define RB_UH_PRE_PID_EN 0x80 // USB host PRE PID enable for low speed device via hub -#define RB_UH_SOF_EN 0x40 // USB host automatic SOF enable - -#define R32_USB_EP2_CTRL (*((PUINT32V)(0x40023438))) // endpoint 2 control & transmittal length -#define R16_UEP2_T_LEN (*((PUINT16V)(0x40023438))) // endpoint 2 transmittal length(16-bits for ch32v10x) -#define R8_UEP2_CTRL (*((PUINT8V)(0x4002343a))) // endpoint 2 control - -#define R8_UH_EP_PID (*((PUINT8V)(0x40023438))) // host endpoint and PID -#define MASK_UH_TOKEN 0xF0 // bit mask of token PID for USB host transfer -#define MASK_UH_ENDP 0x0F // bit mask of endpoint number for USB host transfer - -#define R8_UH_RX_CTRL R8_UEP2_CTRL // host receiver endpoint control -#define RB_UH_R_TOG 0x80 // expected data toggle flag of host receiving (IN): 0=DATA0, 1=DATA1 -#define RB_UH_R_AUTO_TOG 0x10 // enable automatic toggle after successful transfer completion: 0=manual toggle, 1=automatic toggle -#define RB_UH_R_RES 0x04 // prepared handshake response type for host receiving (IN): 0=ACK (ready), 1=no response, time out to device, for isochronous transactions - -#define R32_USB_EP3_CTRL (*((PUINT32V)(0x4002343c))) // endpoint 3 control & transmittal length -#define R16_UEP3_T_LEN (*((PUINT16V)(0x4002343c))) // endpoint 3 transmittal length(16-bits for ch32v10x) -#define R8_UEP3_CTRL (*((PUINT8V)(0x4002343e))) // endpoint 3 control -#define R8_UH_TX_LEN (*((PUINT16V)(0x4002343c))) // R8_UEP3_T_LEN // host transmittal endpoint transmittal length - -#define R8_UH_TX_CTRL R8_UEP3_CTRL // host transmittal endpoint control -#define RB_UH_T_TOG 0x40 // prepared data toggle flag of host transmittal (SETUP/OUT): 0=DATA0, 1=DATA1 -#define RB_UH_T_AUTO_TOG 0x10 // enable automatic toggle after successful transfer completion: 0=manual toggle, 1=automatic toggle -#define RB_UH_T_RES 0x01 // expected handshake response type for host transmittal (SETUP/OUT): 0=ACK (ready), 1=no response, time out from device, for isochronous transactions - -#define R32_USB_EP4_CTRL (*((PUINT32V)(0x40023440))) // endpoint 4 control & transmittal length -#define R16_UEP4_T_LEN (*((PUINT16V)(0x40023440))) // endpoint 4 transmittal length(16-bits for ch32v10x) -#define R8_UEP4_CTRL (*((PUINT8V)(0x40023442))) // endpoint 4 control - -#define R32_USB_EP5_CTRL (*((PUINT32V)(0x40023444))) // endpoint 5 control & transmittal length -#define R16_UEP5_T_LEN (*((PUINT16V)(0x40023444))) // endpoint 5 transmittal length(16-bits for ch32v10x) -#define R8_UEP5_CTRL (*((PUINT8V)(0x40023446))) // endpoint 5 control - -#define R32_USB_EP6_CTRL (*((PUINT32V)(0x40023448))) // endpoint 6 control & transmittal length -#define R16_UEP6_T_LEN (*((PUINT16V)(0x40023448))) // endpoint 6 transmittal length(16-bits for ch32v10x) -#define R8_UEP6_CTRL (*((PUINT8V)(0x4002344a))) // endpoint 6 control - -#define R32_USB_EP7_CTRL (*((PUINT32V)(0x4002344c))) // endpoint 7 control & transmittal length -#define R16_UEP7_T_LEN (*((PUINT16V)(0x4002344c))) // endpoint 7 transmittal length(16-bits for ch32v10x) -#define R8_UEP7_CTRL (*((PUINT8V)(0x4002344e))) // endpoint 7 control - - /* ch32v10x_usb_host.h -----------------------------------------------------------*/ - -#define ERR_SUCCESS 0x00 -#define ERR_USB_CONNECT 0x15 -#define ERR_USB_DISCON 0x16 -#define ERR_USB_BUF_OVER 0x17 -#define ERR_USB_DISK_ERR 0x1F -#define ERR_USB_TRANSFER 0x20 -#define ERR_USB_UNSUPPORT 0xFB -#define ERR_USB_UNKNOWN 0xFE -#define ERR_AOA_PROTOCOL 0x41 - -#define ROOT_DEV_DISCONNECT 0 -#define ROOT_DEV_CONNECTED 1 -#define ROOT_DEV_FAILED 2 -#define ROOT_DEV_SUCCESS 3 -#define DEV_TYPE_KEYBOARD (USB_DEV_CLASS_HID | 0x20) -#define DEV_TYPE_MOUSE (USB_DEV_CLASS_HID | 0x30) -#define DEF_AOA_DEVICE 0xF0 -#define DEV_TYPE_UNKNOW 0xFF - -#define HUB_MAX_PORTS 4 -#define WAIT_USB_TOUT_200US 3000 - -/* ch32v30x_usb.h ------------------------------------------------------------*/ - -/* ch32v00x_wwdg.h -----------------------------------------------------------*/ - -/* WWDG_Prescaler */ -#define WWDG_Prescaler_1 ((uint32_t)0x00000000) -#define WWDG_Prescaler_2 ((uint32_t)0x00000080) -#define WWDG_Prescaler_4 ((uint32_t)0x00000100) -#define WWDG_Prescaler_8 ((uint32_t)0x00000180) - -#ifdef __cplusplus -}; -#endif - -// For debug writing to the debug interface. -#define DMDATA0 ((volatile uint32_t *)0xe0000380) -#define DMDATA1 ((volatile uint32_t *)0xe0000384) -#define DMSTATUS_SENTINEL ((volatile uint32_t *)0xe0000388) // Reads as 0x00000000 if debugger is attached. - -// Determination of PLL multiplication factor for non-V003 chips - -// Applies to all processors - -/* some bit definitions for systick regs */ -#define SYSTICK_SR_CNTIF (1 << 0) -#define SYSTICK_CTLR_STE (1 << 0) -#define SYSTICK_CTLR_STIE (1 << 1) -#define SYSTICK_CTLR_STCLK (1 << 2) -#define SYSTICK_CTLR_STRE (1 << 3) -#define SYSTICK_CTLR_SWIE (1 << 31) - -#define PFIC ((PFIC_Type *)PFIC_BASE) -#define NVIC PFIC -#define NVIC_KEY1 ((uint32_t)0xFA050000) -#define NVIC_KEY2 ((uint32_t)0xBCAF0000) -#define NVIC_KEY3 ((uint32_t)0xBEEF0000) - -#define SysTick ((SysTick_Type *)SysTick_BASE) - -#define PA1 1 -#define PA2 2 -#define PC0 32 -#define PC1 33 -#define PC2 34 -#define PC3 35 -#define PC4 36 -#define PC5 37 -#define PC6 38 -#define PC7 39 -#define PD0 48 -#define PD1 49 -#define PD2 50 -#define PD3 51 -#define PD4 52 -#define PD5 53 -#define PD6 54 -#define PD7 55 - -#define PA0 0 -#define PA3 3 -#define PA4 4 -#define PA5 5 -#define PA6 6 -#define PA7 7 -#define PA8 8 -#define PA9 9 -#define PA10 10 -#define PA11 11 -#define PA12 12 -#define PA13 13 -#define PA14 14 -#define PA15 15 -#define PB0 16 -#define PB1 17 -#define PB2 18 -#define PB3 19 -#define PB4 20 -#define PB5 21 -#define PB6 22 -#define PB7 23 -#define PB8 24 -#define PB9 25 -#define PB10 26 -#define PB11 27 -#define PB12 28 -#define PB13 29 -#define PB14 30 -#define PB15 31 -#define PC8 40 -#define PC9 41 -#define PC10 42 -#define PC11 43 -#define PC12 44 -#define PC13 45 -#define PC14 46 -#define PC15 47 -#define PD8 56 -#define PD9 57 -#define PD10 58 -#define PD11 59 -#define PD12 60 -#define PD13 61 -#define PD14 62 -#define PD15 63 - -/* - * This file contains various parts of the official WCH EVT Headers which - * were originally under a restrictive license. - * - * The collection of this file was generated by - * cnlohr, 2023-02-18 and - * AlexanderMandera, 2023-06-23 - * It was significantly reworked into several files cnlohr, 2025-01-29 - * - * While originally under a restrictive copyright, WCH has approved use - * under MIT-licensed use, because of inclusion in Zephyr, as well as other - * open-source licensed projects. - * - * These copies of the headers from WCH are available now under: - * - * Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the “Softwareâ€), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED “AS ISâ€, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ - -#endif // Header guard diff --git a/src/extralibs/ch32v003_GPIO_branchless.h b/src/extralibs/ch32v003_GPIO_branchless.h index 5504f0d..c3043ed 100644 --- a/src/extralibs/ch32v003_GPIO_branchless.h +++ b/src/extralibs/ch32v003_GPIO_branchless.h @@ -1,22 +1,26 @@ // 2023-06-26 recallmenot -// ######## necessities +//######## necessities // include guards #ifndef CH32V003_GPIO_BR_H #define CH32V003_GPIO_BR_H // includes +#include //uintN_t support #include "../ch32fun/ch32fun.h" -#include //uintN_t support + + /*######## library description This is a speedy and light GPIO library due to - static inlining of most functions - compile-time abstraction - branchless where it counts + static inlining of most functions + compile-time abstraction + branchless where it counts */ + + /*######## library usage and configuration first, enable the desired port. @@ -94,81 +98,78 @@ Writing `TIMx->SWEVGR |= TIM_UG` will immediately update the shadow register and */ -// ######## ports, pins and states: use these for the functions below! -#define GPIOv_from_PORT_PIN(GPIO_port_n, pin) -enum GPIO_port_n -{ - GPIO_port_A = 0b00, - GPIO_port_C = 0b10, - GPIO_port_D = 0b11, +//######## ports, pins and states: use these for the functions below! + +#define GPIOv_from_PORT_PIN( GPIO_port_n, pin ) + +enum GPIO_port_n { + GPIO_port_A = 0b00, + GPIO_port_C = 0b10, + GPIO_port_D = 0b11, }; -enum GPIO_pinModes -{ - GPIO_pinMode_I_floating, - GPIO_pinMode_I_pullUp, - GPIO_pinMode_I_pullDown, - GPIO_pinMode_I_analog, - GPIO_pinMode_O_pushPull, - GPIO_pinMode_O_openDrain, - GPIO_pinMode_O_pushPullMux, - GPIO_pinMode_O_openDrainMux, +enum GPIO_pinModes { + GPIO_pinMode_I_floating, + GPIO_pinMode_I_pullUp, + GPIO_pinMode_I_pullDown, + GPIO_pinMode_I_analog, + GPIO_pinMode_O_pushPull, + GPIO_pinMode_O_openDrain, + GPIO_pinMode_O_pushPullMux, + GPIO_pinMode_O_openDrainMux, }; -enum lowhigh -{ - low, - high, +enum lowhigh { + low, + high, }; // analog inputs -enum GPIO_analog_inputs -{ - GPIO_Ain0_A2, - GPIO_Ain1_A1, - GPIO_Ain2_C4, - GPIO_Ain3_D2, - GPIO_Ain4_D3, - GPIO_Ain5_D5, - GPIO_Ain6_D6, - GPIO_Ain7_D4, - GPIO_AinVref, - GPIO_AinVcal, +enum GPIO_analog_inputs { + GPIO_Ain0_A2, + GPIO_Ain1_A1, + GPIO_Ain2_C4, + GPIO_Ain3_D2, + GPIO_Ain4_D3, + GPIO_Ain5_D5, + GPIO_Ain6_D6, + GPIO_Ain7_D4, + GPIO_AinVref, + GPIO_AinVcal, }; // how many cycles the ADC shall sample the input for (speed vs precision) -enum GPIO_ADC_sampletimes -{ - GPIO_ADC_sampletime_3cy, - GPIO_ADC_sampletime_9cy, - GPIO_ADC_sampletime_15cy, - GPIO_ADC_sampletime_30cy, - GPIO_ADC_sampletime_43cy, - GPIO_ADC_sampletime_57cy, - GPIO_ADC_sampletime_73cy, - GPIO_ADC_sampletime_241cy_default, +enum GPIO_ADC_sampletimes { + GPIO_ADC_sampletime_3cy, + GPIO_ADC_sampletime_9cy, + GPIO_ADC_sampletime_15cy, + GPIO_ADC_sampletime_30cy, + GPIO_ADC_sampletime_43cy, + GPIO_ADC_sampletime_57cy, + GPIO_ADC_sampletime_73cy, + GPIO_ADC_sampletime_241cy_default, }; -enum GPIO_tim1_output_sets -{ - GPIO_tim1_output_set_0__D2_A1_C3_C4__D0_A2_D1, - GPIO_tim1_output_set_1__C6_C7_C0_D3__C3_C4_D1, - GPIO_tim1_output_set_2__D2_A1_C3_C4__D0_A2_D1, - GPIO_tim1_output_set_3__C4_C7_C5_D4__C3_D2_C6, +enum GPIO_tim1_output_sets { + GPIO_tim1_output_set_0__D2_A1_C3_C4__D0_A2_D1, + GPIO_tim1_output_set_1__C6_C7_C0_D3__C3_C4_D1, + GPIO_tim1_output_set_2__D2_A1_C3_C4__D0_A2_D1, + GPIO_tim1_output_set_3__C4_C7_C5_D4__C3_D2_C6, }; -enum GPIO_tim2_output_sets -{ - GPIO_tim2_output_set_0__D4_D3_C0_D7, - GPIO_tim2_output_set_1__C5_C2_D2_C1, - GPIO_tim2_output_set_2__C1_D3_C0_D7, - GPIO_tim2_output_set_3__C1_C7_D6_D5, +enum GPIO_tim2_output_sets { + GPIO_tim2_output_set_0__D4_D3_C0_D7, + GPIO_tim2_output_set_1__C5_C2_D2_C1, + GPIO_tim2_output_set_2__C1_D3_C0_D7, + GPIO_tim2_output_set_3__C1_C7_D6_D5, }; -// ######## interface function overview: use these! -// most functions have been reduced to function-like macros, actual definitions downstairs + + +//######## interface function overview: use these! +// most functions have been reduced to function-like macros, actual definitions downstairs // setup #define GPIO_port_enable(GPIO_port_n) @@ -201,66 +202,72 @@ static inline void GPIO_tim2_init(); #define GPIO_tim1_analogWrite(channel, value) #define GPIO_tim2_analogWrite(channel, value) -// ######## internal function declarations -// ######## internal variables -// ######## preprocessor macros +//######## internal function declarations -#define CONCAT(a, b) a##b + + +//######## internal variables + + + +//######## preprocessor macros + +#define CONCAT(a, b) a ## b #define CONCAT_INDIRECT(a, b) CONCAT(a, b) #undef GPIOv_from_PORT_PIN -#define GPIOv_from_PORT_PIN(GPIO_port_n, pin) ((GPIO_port_n << 4) | (pin)) -#define GPIOv_to_PORT(GPIOv) (GPIOv >> 4) -#define GPIOv_to_PIN(GPIOv) (GPIOv & 0b1111) -#define GPIOv_to_GPIObase(GPIOv) ((GPIO_TypeDef *)(uintptr_t)((GPIOA_BASE + (0x400 * (GPIOv >> 4))))) +#define GPIOv_from_PORT_PIN( GPIO_port_n, pin ) ((GPIO_port_n << 4 ) | (pin)) +#define GPIOv_to_PORT( GPIOv ) (GPIOv >> 4 ) +#define GPIOv_to_PIN( GPIOv ) (GPIOv & 0b1111) +#define GPIOv_to_GPIObase( GPIOv ) ((GPIO_TypeDef*)(uintptr_t)((GPIOA_BASE + (0x400 * (GPIOv >> 4))))) -#define GPIOx_to_port_n2(GPIOx) GPIOx_to_port_n_##GPIOx -#define GPIOx_to_port_n(GPIOx) GPIOx_to_port_n2(GPIOx) -#define GPIOx_to_port_n_GPIO_port_A 0b00 -#define GPIOx_to_port_n_GPIO_port_C 0b10 -#define GPIOx_to_port_n_GPIO_port_D 0b11 +#define GPIOx_to_port_n2(GPIOx) GPIOx_to_port_n_##GPIOx +#define GPIOx_to_port_n(GPIOx) GPIOx_to_port_n2(GPIOx) +#define GPIOx_to_port_n_GPIO_port_A 0b00 +#define GPIOx_to_port_n_GPIO_port_C 0b10 +#define GPIOx_to_port_n_GPIO_port_D 0b11 -#define GPIO_port_n_to_GPIOx2(GPIO_port_n) GPIO_port_n_to_GPIOx_##GPIO_port_n -#define GPIO_port_n_to_GPIOx(GPIO_port_n) GPIO_port_n_to_GPIOx2(GPIO_port_n) -#define GPIO_port_n_to_GPIOx_GPIO_port_A GPIOA -#define GPIO_port_n_to_GPIOx_GPIO_port_C GPIOC -#define GPIO_port_n_to_GPIOx_GPIO_port_D GPIOD +#define GPIO_port_n_to_GPIOx2(GPIO_port_n) GPIO_port_n_to_GPIOx_##GPIO_port_n +#define GPIO_port_n_to_GPIOx(GPIO_port_n) GPIO_port_n_to_GPIOx2(GPIO_port_n) +#define GPIO_port_n_to_GPIOx_GPIO_port_A GPIOA +#define GPIO_port_n_to_GPIOx_GPIO_port_C GPIOC +#define GPIO_port_n_to_GPIOx_GPIO_port_D GPIOD -#define GPIO_port_n_to_RCC_APB2Periph2(GPIO_port_n) GPIO_port_n_to_RCC_APB2Periph_##GPIO_port_n -#define GPIO_port_n_to_RCC_APB2Periph(GPIO_port_n) GPIO_port_n_to_RCC_APB2Periph2(GPIO_port_n) -#define GPIO_port_n_to_RCC_APB2Periph_GPIO_port_A RCC_APB2Periph_GPIOA -#define GPIO_port_n_to_RCC_APB2Periph_GPIO_port_C RCC_APB2Periph_GPIOC -#define GPIO_port_n_to_RCC_APB2Periph_GPIO_port_D RCC_APB2Periph_GPIOD +#define GPIO_port_n_to_RCC_APB2Periph2(GPIO_port_n) GPIO_port_n_to_RCC_APB2Periph_##GPIO_port_n +#define GPIO_port_n_to_RCC_APB2Periph(GPIO_port_n) GPIO_port_n_to_RCC_APB2Periph2(GPIO_port_n) +#define GPIO_port_n_to_RCC_APB2Periph_GPIO_port_A RCC_APB2Periph_GPIOA +#define GPIO_port_n_to_RCC_APB2Periph_GPIO_port_C RCC_APB2Periph_GPIOC +#define GPIO_port_n_to_RCC_APB2Periph_GPIO_port_D RCC_APB2Periph_GPIOD -#define GPIO_pinMode_to_CFG2(GPIO_pinMode, GPIO_Speed) GPIO_pinMode_to_CFG_##GPIO_pinMode(GPIO_Speed) -#define GPIO_pinMode_to_CFG(GPIO_pinMode, GPIO_Speed) GPIO_pinMode_to_CFG2(GPIO_pinMode, GPIO_Speed) -#define GPIO_pinMode_to_CFG_GPIO_pinMode_I_floating(GPIO_Speed) (GPIO_Speed_In | GPIO_CNF_IN_FLOATING) -#define GPIO_pinMode_to_CFG_GPIO_pinMode_I_pullUp(GPIO_Speed) (GPIO_Speed_In | GPIO_CNF_IN_PUPD) -#define GPIO_pinMode_to_CFG_GPIO_pinMode_I_pullDown(GPIO_Speed) (GPIO_Speed_In | GPIO_CNF_IN_PUPD) -#define GPIO_pinMode_to_CFG_GPIO_pinMode_I_analog(GPIO_Speed) (GPIO_Speed_In | GPIO_CNF_IN_ANALOG) -#define GPIO_pinMode_to_CFG_GPIO_pinMode_O_pushPull(GPIO_Speed) (GPIO_Speed | GPIO_CNF_OUT_PP) -#define GPIO_pinMode_to_CFG_GPIO_pinMode_O_openDrain(GPIO_Speed) (GPIO_Speed | GPIO_CNF_OUT_OD) -#define GPIO_pinMode_to_CFG_GPIO_pinMode_O_pushPullMux(GPIO_Speed) (GPIO_Speed | GPIO_CNF_OUT_PP_AF) -#define GPIO_pinMode_to_CFG_GPIO_pinMode_O_openDrainMux(GPIO_Speed) (GPIO_Speed | GPIO_CNF_IN_ANALOG) +#define GPIO_pinMode_to_CFG2(GPIO_pinMode, GPIO_Speed) GPIO_pinMode_to_CFG_##GPIO_pinMode(GPIO_Speed) +#define GPIO_pinMode_to_CFG(GPIO_pinMode, GPIO_Speed) GPIO_pinMode_to_CFG2(GPIO_pinMode, GPIO_Speed) +#define GPIO_pinMode_to_CFG_GPIO_pinMode_I_floating(GPIO_Speed) (GPIO_Speed_In | GPIO_CNF_IN_FLOATING) +#define GPIO_pinMode_to_CFG_GPIO_pinMode_I_pullUp(GPIO_Speed) (GPIO_Speed_In | GPIO_CNF_IN_PUPD) +#define GPIO_pinMode_to_CFG_GPIO_pinMode_I_pullDown(GPIO_Speed) (GPIO_Speed_In | GPIO_CNF_IN_PUPD) +#define GPIO_pinMode_to_CFG_GPIO_pinMode_I_analog(GPIO_Speed) (GPIO_Speed_In | GPIO_CNF_IN_ANALOG) +#define GPIO_pinMode_to_CFG_GPIO_pinMode_O_pushPull(GPIO_Speed) (GPIO_Speed | GPIO_CNF_OUT_PP) +#define GPIO_pinMode_to_CFG_GPIO_pinMode_O_openDrain(GPIO_Speed) (GPIO_Speed | GPIO_CNF_OUT_OD) +#define GPIO_pinMode_to_CFG_GPIO_pinMode_O_pushPullMux(GPIO_Speed) (GPIO_Speed | GPIO_CNF_OUT_PP_AF) +#define GPIO_pinMode_to_CFG_GPIO_pinMode_O_openDrainMux(GPIO_Speed) (GPIO_Speed | GPIO_CNF_IN_ANALOG) -#define GPIO_pinMode_set_PUPD2(GPIO_pinMode, GPIOv) GPIO_pinMode_set_PUPD_##GPIO_pinMode(GPIOv) -#define GPIO_pinMode_set_PUPD(GPIO_pinMode, GPIOv) GPIO_pinMode_set_PUPD2(GPIO_pinMode, GPIOv) +#define GPIO_pinMode_set_PUPD2(GPIO_pinMode, GPIOv) GPIO_pinMode_set_PUPD_##GPIO_pinMode(GPIOv) +#define GPIO_pinMode_set_PUPD(GPIO_pinMode, GPIOv) GPIO_pinMode_set_PUPD2(GPIO_pinMode, GPIOv) #define GPIO_pinMode_set_PUPD_GPIO_pinMode_I_floating(GPIOv) -#define GPIO_pinMode_set_PUPD_GPIO_pinMode_I_pullUp(GPIOv) GPIOv_to_GPIObase(GPIOv)->BSHR = (1 << GPIOv_to_PIN(GPIOv)) -#define GPIO_pinMode_set_PUPD_GPIO_pinMode_I_pullDown(GPIOv) GPIOv_to_GPIObase(GPIOv)->BSHR = (1 << (GPIOv_to_PIN(GPIOv) + 16)) +#define GPIO_pinMode_set_PUPD_GPIO_pinMode_I_pullUp(GPIOv) GPIOv_to_GPIObase(GPIOv)->BSHR = (1 << GPIOv_to_PIN(GPIOv)) +#define GPIO_pinMode_set_PUPD_GPIO_pinMode_I_pullDown(GPIOv) GPIOv_to_GPIObase(GPIOv)->BSHR = (1 << (GPIOv_to_PIN(GPIOv) + 16)) #define GPIO_pinMode_set_PUPD_GPIO_pinMode_I_analog(GPIOv) #define GPIO_pinMode_set_PUPD_GPIO_pinMode_O_pushPull(GPIOv) #define GPIO_pinMode_set_PUPD_GPIO_pinMode_O_openDrain(GPIOv) #define GPIO_pinMode_set_PUPD_GPIO_pinMode_O_pushPullMux(GPIOv) #define GPIO_pinMode_set_PUPD_GPIO_pinMode_O_openDrainMux(GPIOv) -#define GPIO_port_pinMode_set_PUPD2(GPIO_pinMode, GPIO_port_n) GPIO_port_pinMode_set_PUPD_##GPIO_pinMode(GPIO_port_n) -#define GPIO_port_pinMode_set_PUPD(GPIO_pinMode, GPIO_port_n) GPIO_port_pinMode_set_PUPD2(GPIO_pinMode, GPIO_port_n) +#define GPIO_port_pinMode_set_PUPD2(GPIO_pinMode, GPIO_port_n) GPIO_port_pinMode_set_PUPD_##GPIO_pinMode(GPIO_port_n) +#define GPIO_port_pinMode_set_PUPD(GPIO_pinMode, GPIO_port_n) GPIO_port_pinMode_set_PUPD2(GPIO_pinMode, GPIO_port_n) #define GPIO_port_pinMode_set_PUPD_GPIO_pinMode_I_floating(GPIO_port_n) -#define GPIO_port_pinMode_set_PUPD_GPIO_pinMode_I_pullUp(GPIO_port_n) GPIO_port_n_to_GPIOx(GPIO_port_n)->OUTDR = 0b11111111 -#define GPIO_port_pinMode_set_PUPD_GPIO_pinMode_I_pullDown(GPIO_port_n) GPIO_port_n_to_GPIOx(GPIO_port_n)->OUTDR = 0b00000000 +#define GPIO_port_pinMode_set_PUPD_GPIO_pinMode_I_pullUp(GPIO_port_n) GPIO_port_n_to_GPIOx(GPIO_port_n)->OUTDR = 0b11111111 +#define GPIO_port_pinMode_set_PUPD_GPIO_pinMode_I_pullDown(GPIO_port_n) GPIO_port_n_to_GPIOx(GPIO_port_n)->OUTDR = 0b00000000 #define GPIO_port_pinMode_set_PUPD_GPIO_pinMode_I_analog(GPIO_port_n) #define GPIO_port_pinMode_set_PUPD_GPIO_pinMode_O_pushPull(GPIO_port_n) #define GPIO_port_pinMode_set_PUPD_GPIO_pinMode_O_openDrain(GPIO_port_n) @@ -280,74 +287,91 @@ static inline void GPIO_tim2_init(); #endif #if !defined(GPIO_timer_prescaler) -#define GPIO_timer_prescaler TIM_CKD_DIV2 // APB_CLOCK / 1024 / 2 = 23.4kHz +#define GPIO_timer_prescaler TIM_CKD_DIV2 // APB_CLOCK / 1024 / 2 = 23.4kHz #endif -// ######## define requirements / maintenance defines +//######## define requirements / maintenance defines + + + +//######## small function definitions, static inline -// ######## small function definitions, static inline #undef GPIO_port_enable #define GPIO_port_enable(GPIO_port_n) RCC->APB2PCENR |= GPIO_port_n_to_RCC_APB2Periph(GPIO_port_n); -#define GPIO_port_pinMode(GPIO_port_n, pinMode, GPIO_Speed) ({ \ - GPIO_port_n_to_GPIOx(GPIO_port_n)->CFGLR = (GPIO_pinMode_to_CFG(pinMode, GPIO_Speed) << (4 * 0)) | \ - (GPIO_pinMode_to_CFG(pinMode, GPIO_Speed) << (4 * 1)) | \ - (GPIO_pinMode_to_CFG(pinMode, GPIO_Speed) << (4 * 2)) | \ - (GPIO_pinMode_to_CFG(pinMode, GPIO_Speed) << (4 * 3)) | \ - (GPIO_pinMode_to_CFG(pinMode, GPIO_Speed) << (4 * 4)) | \ - (GPIO_pinMode_to_CFG(pinMode, GPIO_Speed) << (4 * 5)) | \ - (GPIO_pinMode_to_CFG(pinMode, GPIO_Speed) << (4 * 6)) | \ - (GPIO_pinMode_to_CFG(pinMode, GPIO_Speed) << (4 * 7)); \ - GPIO_port_pinMode_set_PUPD(pinMode, GPIO_port_n); \ +#define GPIO_port_pinMode(GPIO_port_n, pinMode, GPIO_Speed) ({ \ + GPIO_port_n_to_GPIOx(GPIO_port_n)->CFGLR = (GPIO_pinMode_to_CFG(pinMode, GPIO_Speed) << (4 * 0)) | \ + (GPIO_pinMode_to_CFG(pinMode, GPIO_Speed) << (4 * 1)) | \ + (GPIO_pinMode_to_CFG(pinMode, GPIO_Speed) << (4 * 2)) | \ + (GPIO_pinMode_to_CFG(pinMode, GPIO_Speed) << (4 * 3)) | \ + (GPIO_pinMode_to_CFG(pinMode, GPIO_Speed) << (4 * 4)) | \ + (GPIO_pinMode_to_CFG(pinMode, GPIO_Speed) << (4 * 5)) | \ + (GPIO_pinMode_to_CFG(pinMode, GPIO_Speed) << (4 * 6)) | \ + (GPIO_pinMode_to_CFG(pinMode, GPIO_Speed) << (4 * 7)); \ + GPIO_port_pinMode_set_PUPD(pinMode, GPIO_port_n); \ }) #undef GPIO_port_digitalWrite -#define GPIO_port_digitalWrite(GPIO_port_n, byte) GPIO_port_n_to_GPIOx(GPIO_port_n)->OUTDR = byte +#define GPIO_port_digitalWrite(GPIO_port_n, byte) GPIO_port_n_to_GPIOx(GPIO_port_n)->OUTDR = byte #undef GPIO_port_digitalRead -#define GPIO_port_digitalRead(GPIO_port_n) (GPIO_port_n_to_GPIOx(GPIO_port_n)->INDR & 0b11111111) +#define GPIO_port_digitalRead(GPIO_port_n) (GPIO_port_n_to_GPIOx(GPIO_port_n)->INDR & 0b11111111) #undef GPIO_pinMode -#define GPIO_pinMode(GPIOv, pinMode, GPIO_Speed) ({ \ - GPIOv_to_GPIObase(GPIOv)->CFGLR &= ~(0b1111 << (4 * GPIOv_to_PIN(GPIOv))); \ - GPIOv_to_GPIObase(GPIOv)->CFGLR |= (GPIO_pinMode_to_CFG(pinMode, GPIO_Speed) << (4 * GPIOv_to_PIN(GPIOv))); \ - GPIO_pinMode_set_PUPD(pinMode, GPIOv); \ +#define GPIO_pinMode(GPIOv, pinMode, GPIO_Speed) ({ \ + GPIOv_to_GPIObase(GPIOv)->CFGLR &= ~(0b1111 << (4 * GPIOv_to_PIN(GPIOv))); \ + GPIOv_to_GPIObase(GPIOv)->CFGLR |= (GPIO_pinMode_to_CFG(pinMode, GPIO_Speed) << (4 * GPIOv_to_PIN(GPIOv))); \ + GPIO_pinMode_set_PUPD(pinMode, GPIOv); \ }) #undef GPIO_digitalWrite_hi -#define GPIO_digitalWrite_hi(GPIOv) GPIOv_to_GPIObase(GPIOv)->BSHR = (1 << GPIOv_to_PIN(GPIOv)) +#define GPIO_digitalWrite_hi(GPIOv) GPIOv_to_GPIObase(GPIOv)->BSHR = (1 << GPIOv_to_PIN(GPIOv)) #undef GPIO_digitalWrite_lo -#define GPIO_digitalWrite_lo(GPIOv) GPIOv_to_GPIObase(GPIOv)->BSHR = (1 << (16 + GPIOv_to_PIN(GPIOv))) +#define GPIO_digitalWrite_lo(GPIOv) GPIOv_to_GPIObase(GPIOv)->BSHR = (1 << (16 + GPIOv_to_PIN(GPIOv))) #undef GPIO_digitalWrite -#define GPIO_digitalWrite(GPIOv, lowhigh) GPIO_digitalWrite_##lowhigh(GPIOv) -#define GPIO_digitalWrite_low(GPIOv) GPIO_digitalWrite_lo(GPIOv) -#define GPIO_digitalWrite_0(GPIOv) GPIO_digitalWrite_lo(GPIOv) -#define GPIO_digitalWrite_high(GPIOv) GPIO_digitalWrite_hi(GPIOv) -#define GPIO_digitalWrite_1(GPIOv) GPIO_digitalWrite_hi(GPIOv) +#define GPIO_digitalWrite(GPIOv, lowhigh) GPIO_digitalWrite_##lowhigh(GPIOv) +#define GPIO_digitalWrite_low(GPIOv) GPIO_digitalWrite_lo(GPIOv) +#define GPIO_digitalWrite_0(GPIOv) GPIO_digitalWrite_lo(GPIOv) +#define GPIO_digitalWrite_high(GPIOv) GPIO_digitalWrite_hi(GPIOv) +#define GPIO_digitalWrite_1(GPIOv) GPIO_digitalWrite_hi(GPIOv) #undef GPIO_digitalWrite_branching -#define GPIO_digitalWrite_branching(GPIOv, lowhigh) (lowhigh ? GPIO_digitalWrite_hi(GPIOv) : GPIO_digitalWrite_lo(GPIOv)) +#define GPIO_digitalWrite_branching(GPIOv, lowhigh) (lowhigh ? GPIO_digitalWrite_hi(GPIOv) : GPIO_digitalWrite_lo(GPIOv)) #undef GPIO_digitalRead -#define GPIO_digitalRead(GPIOv) ((GPIOv_to_GPIObase(GPIOv)->INDR >> GPIOv_to_PIN(GPIOv)) & 0b1) +#define GPIO_digitalRead(GPIOv) ((GPIOv_to_GPIObase(GPIOv)->INDR >> GPIOv_to_PIN(GPIOv)) & 0b1) #undef GPIO_ADC_set_sampletime // 0:7 => 3/9/15/30/43/57/73/241 cycles -#define GPIO_ADC_set_sampletime(GPIO_analog_input, GPIO_ADC_sampletime) ({ \ - ADC1->SAMPTR2 &= ~(0b111) << (3 * GPIO_analog_input); \ - ADC1->SAMPTR2 |= GPIO_ADC_sampletime << (3 * GPIO_analog_input); \ +#define GPIO_ADC_set_sampletime(GPIO_analog_input, GPIO_ADC_sampletime) ({ \ + ADC1->SAMPTR2 &= ~(0b111) << (3 * GPIO_analog_input); \ + ADC1->SAMPTR2 |= GPIO_ADC_sampletime << (3 * GPIO_analog_input); \ }) #undef GPIO_ADC_set_sampletimes_all -#define GPIO_ADC_set_sampletimes_all(GPIO_ADC_sampletime) ({ \ - ADC1->SAMPTR2 &= 0; \ - ADC1->SAMPTR2 |= \ - GPIO_ADC_sampletime << (0 * 3) | GPIO_ADC_sampletime << (1 * 3) | GPIO_ADC_sampletime << (2 * 3) | GPIO_ADC_sampletime << (3 * 3) | GPIO_ADC_sampletime << (4 * 3) | GPIO_ADC_sampletime << (5 * 3) | GPIO_ADC_sampletime << (6 * 3) | GPIO_ADC_sampletime << (7 * 3) | GPIO_ADC_sampletime << (8 * 3) | GPIO_ADC_sampletime << (9 * 3); \ - ADC1->SAMPTR1 &= 0; \ - ADC1->SAMPTR1 |= \ - GPIO_ADC_sampletime << (0 * 3) | GPIO_ADC_sampletime << (1 * 3) | GPIO_ADC_sampletime << (2 * 3) | GPIO_ADC_sampletime << (3 * 3) | GPIO_ADC_sampletime << (4 * 3) | GPIO_ADC_sampletime << (5 * 3); \ +#define GPIO_ADC_set_sampletimes_all(GPIO_ADC_sampletime) ({ \ + ADC1->SAMPTR2 &= 0; \ + ADC1->SAMPTR2 |= \ + GPIO_ADC_sampletime << (0 * 3) \ + | GPIO_ADC_sampletime << (1 * 3) \ + | GPIO_ADC_sampletime << (2 * 3) \ + | GPIO_ADC_sampletime << (3 * 3) \ + | GPIO_ADC_sampletime << (4 * 3) \ + | GPIO_ADC_sampletime << (5 * 3) \ + | GPIO_ADC_sampletime << (6 * 3) \ + | GPIO_ADC_sampletime << (7 * 3) \ + | GPIO_ADC_sampletime << (8 * 3) \ + | GPIO_ADC_sampletime << (9 * 3); \ + ADC1->SAMPTR1 &= 0; \ + ADC1->SAMPTR1 |= \ + GPIO_ADC_sampletime << (0 * 3) \ + | GPIO_ADC_sampletime << (1 * 3) \ + | GPIO_ADC_sampletime << (2 * 3) \ + | GPIO_ADC_sampletime << (3 * 3) \ + | GPIO_ADC_sampletime << (4 * 3) \ + | GPIO_ADC_sampletime << (5 * 3); \ }) #undef GPIO_ADC_set_power @@ -357,137 +381,133 @@ static inline void GPIO_tim2_init(); #define GPIO_ADC_set_power_0 ADC1->CTLR2 &= ~(ADC_ADON) #undef GPIO_ADC_calibrate -#define GPIO_ADC_calibrate() ({ \ - ADC1->CTLR2 |= ADC_RSTCAL; \ - while (ADC1->CTLR2 & ADC_RSTCAL) \ - ; \ - ADC1->CTLR2 |= ADC_CAL; \ - while (ADC1->CTLR2 & ADC_CAL) \ - ; \ +#define GPIO_ADC_calibrate() ({ \ + ADC1->CTLR2 |= ADC_RSTCAL; \ + while(ADC1->CTLR2 & ADC_RSTCAL); \ + ADC1->CTLR2 |= ADC_CAL; \ + while(ADC1->CTLR2 & ADC_CAL); \ }) // large but will likely only ever be called once -static inline void GPIO_ADCinit() -{ - // select ADC clock source - // ADCCLK = 24 MHz => RCC_ADCPRE = 0: divide by 2 - RCC->CFGR0 &= ~(0x1F << 11); +static inline void GPIO_ADCinit() { + // select ADC clock source + // ADCCLK = 24 MHz => RCC_ADCPRE = 0: divide by 2 + RCC->CFGR0 &= ~(0x1F<<11); - // enable clock to the ADC - RCC->APB2PCENR |= RCC_APB2Periph_ADC1; + // enable clock to the ADC + RCC->APB2PCENR |= RCC_APB2Periph_ADC1; - // Reset the ADC to init all regs - RCC->APB2PRSTR |= RCC_APB2Periph_ADC1; - RCC->APB2PRSTR &= ~RCC_APB2Periph_ADC1; + // Reset the ADC to init all regs + RCC->APB2PRSTR |= RCC_APB2Periph_ADC1; + RCC->APB2PRSTR &= ~RCC_APB2Periph_ADC1; - // set sampling time for all inputs to 241 cycles - GPIO_ADC_set_sampletimes_all(GPIO_ADC_sampletime); + // set sampling time for all inputs to 241 cycles + GPIO_ADC_set_sampletimes_all(GPIO_ADC_sampletime); - // set trigger to software - ADC1->CTLR2 |= ADC_EXTSEL; + // set trigger to software + ADC1->CTLR2 |= ADC_EXTSEL; - // pre-clear conversion queue - ADC1->RSQR1 = 0; - ADC1->RSQR2 = 0; - ADC1->RSQR3 = 0; + // pre-clear conversion queue + ADC1->RSQR1 = 0; + ADC1->RSQR2 = 0; + ADC1->RSQR3 = 0; - // power the ADC - GPIO_ADC_set_power(1); - GPIO_ADC_calibrate(); + // power the ADC + GPIO_ADC_set_power(1); + GPIO_ADC_calibrate(); } -static inline uint16_t GPIO_analogRead(enum GPIO_analog_inputs input) -{ - // set mux to selected input - ADC1->RSQR3 = input; - // allow everything to precharge - Delay_Us(GPIO_ADC_MUX_DELAY); - // start sw conversion (auto clears) - ADC1->CTLR2 |= ADC_SWSTART; - // wait for conversion complete - while (!(ADC1->STATR & ADC_EOC)) {} - // get result - return ADC1->RDATAR; +static inline uint16_t GPIO_analogRead(enum GPIO_analog_inputs input) { + // set mux to selected input + ADC1->RSQR3 = input; + // allow everything to precharge + Delay_Us(GPIO_ADC_MUX_DELAY); + // start sw conversion (auto clears) + ADC1->CTLR2 |= ADC_SWSTART; + // wait for conversion complete + while(!(ADC1->STATR & ADC_EOC)) {} + // get result + return ADC1->RDATAR; } + + #undef GPIO_tim1_map -#define GPIO_tim1_map(GPIO_tim1_output_set) ({ \ - RCC->APB2PCENR |= RCC_APB2Periph_AFIO; \ - AFIO->PCFR1 |= ((GPIO_tim1_output_set & 0b11) << 6); \ +#define GPIO_tim1_map(GPIO_tim1_output_set) ({ \ + RCC->APB2PCENR |= RCC_APB2Periph_AFIO; \ + AFIO->PCFR1 |= ((GPIO_tim1_output_set & 0b11) << 6); \ }) #undef GPIO_tim2_map -#define GPIO_tim2_map(GPIO_tim2_output_set) ({ \ - RCC->APB2PCENR |= RCC_APB2Periph_AFIO; \ - AFIO->PCFR1 |= ((GPIO_tim2_output_set & 0b11) << 8); \ +#define GPIO_tim2_map(GPIO_tim2_output_set) ({ \ + RCC->APB2PCENR |= RCC_APB2Periph_AFIO; \ + AFIO->PCFR1 |= ((GPIO_tim2_output_set & 0b11) << 8); \ }) -static inline void GPIO_tim1_init() -{ - // enable TIM1 - RCC->APB2PCENR |= RCC_APB2Periph_TIM1; - // reset TIM1 to init all regs - RCC->APB2PRSTR |= RCC_APB2Periph_TIM1; - RCC->APB2PRSTR &= ~RCC_APB2Periph_TIM1; - // SMCFGR: default clk input is CK_INT - // set clock prescaler divider - TIM1->PSC = GPIO_timer_prescaler; - // set PWM total cycle width - TIM1->ATRLR = GPIO_timer_resolution; - // CTLR1: default is up, events generated, edge align - // enable auto-reload of preload - TIM1->CTLR1 |= TIM_ARPE; - // initialize counter - TIM1->SWEVGR |= TIM_UG; - // disengage brake - TIM1->BDTR |= TIM_MOE; - // Enable TIM1 - TIM1->CTLR1 |= TIM_CEN; +static inline void GPIO_tim1_init() { + // enable TIM1 + RCC->APB2PCENR |= RCC_APB2Periph_TIM1; + // reset TIM1 to init all regs + RCC->APB2PRSTR |= RCC_APB2Periph_TIM1; + RCC->APB2PRSTR &= ~RCC_APB2Periph_TIM1; + // SMCFGR: default clk input is CK_INT + // set clock prescaler divider + TIM1->PSC = GPIO_timer_prescaler; + // set PWM total cycle width + TIM1->ATRLR = GPIO_timer_resolution; + // CTLR1: default is up, events generated, edge align + // enable auto-reload of preload + TIM1->CTLR1 |= TIM_ARPE; + // initialize counter + TIM1->SWEVGR |= TIM_UG; + // disengage brake + TIM1->BDTR |= TIM_MOE; + // Enable TIM1 + TIM1->CTLR1 |= TIM_CEN; } -static inline void GPIO_tim2_init() -{ - // enable TIM2 - RCC->APB1PCENR |= RCC_APB1Periph_TIM2; - // reset TIM2 to init all regs - RCC->APB1PRSTR |= RCC_APB1Periph_TIM2; - RCC->APB1PRSTR &= ~RCC_APB1Periph_TIM2; - // SMCFGR: default clk input is CK_INT - // set clock prescaler divider - TIM2->PSC = GPIO_timer_prescaler; - // set PWM total cycle width - TIM2->ATRLR = GPIO_timer_resolution; - // CTLR1: default is up, events generated, edge align - // enable auto-reload of preload - TIM2->CTLR1 |= TIM_ARPE; - // initialize counter - TIM2->SWEVGR |= TIM_UG; - // Enable TIM2 - TIM2->CTLR1 |= TIM_CEN; +static inline void GPIO_tim2_init() { + // enable TIM2 + RCC->APB1PCENR |= RCC_APB1Periph_TIM2; + // reset TIM2 to init all regs + RCC->APB1PRSTR |= RCC_APB1Periph_TIM2; + RCC->APB1PRSTR &= ~RCC_APB1Periph_TIM2; + // SMCFGR: default clk input is CK_INT + // set clock prescaler divider + TIM2->PSC = GPIO_timer_prescaler; + // set PWM total cycle width + TIM2->ATRLR = GPIO_timer_resolution; + // CTLR1: default is up, events generated, edge align + // enable auto-reload of preload + TIM2->CTLR1 |= TIM_ARPE; + // initialize counter + TIM2->SWEVGR |= TIM_UG; + // Enable TIM2 + TIM2->CTLR1 |= TIM_CEN; } -#define GPIO_timer_channel_set2(timer, channel) GPIO_timer_channel_set_##channel(timer) -#define GPIO_timer_channel_set(timer, channel) GPIO_timer_channel_set2(timer, channel) -#define GPIO_timer_channel_set_1(timer) timer->CHCTLR1 |= (TIM_OCMode_PWM1 | TIM_OCPreload_Enable) -#define GPIO_timer_channel_set_2(timer) timer->CHCTLR1 |= ((TIM_OCMode_PWM1 | TIM_OCPreload_Enable) << 8) -#define GPIO_timer_channel_set_3(timer) timer->CHCTLR2 |= (TIM_OCMode_PWM1 | TIM_OCPreload_Enable) -#define GPIO_timer_channel_set_4(timer) timer->CHCTLR2 |= ((TIM_OCMode_PWM1 | TIM_OCPreload_Enable) << 8) +#define GPIO_timer_channel_set2(timer, channel) GPIO_timer_channel_set_##channel(timer) +#define GPIO_timer_channel_set(timer, channel) GPIO_timer_channel_set2(timer, channel) +#define GPIO_timer_channel_set_1(timer) timer->CHCTLR1 |= (TIM_OCMode_PWM1 | TIM_OCPreload_Enable) +#define GPIO_timer_channel_set_2(timer) timer->CHCTLR1 |= ((TIM_OCMode_PWM1 | TIM_OCPreload_Enable) << 8) +#define GPIO_timer_channel_set_3(timer) timer->CHCTLR2 |= (TIM_OCMode_PWM1 | TIM_OCPreload_Enable) +#define GPIO_timer_channel_set_4(timer) timer->CHCTLR2 |= ((TIM_OCMode_PWM1 | TIM_OCPreload_Enable) << 8) #undef GPIO_tim1_enableCH -#define GPIO_tim1_enableCH(channel) ({ \ - GPIO_timer_channel_set(TIM1, channel); \ - TIM1->CCER |= (TIM_OutputState_Enable) << (4 * (channel - 1)); \ +#define GPIO_tim1_enableCH(channel) ({ \ + GPIO_timer_channel_set(TIM1, channel); \ + TIM1->CCER |= (TIM_OutputState_Enable) << (4 * (channel - 1)); \ }) #undef GPIO_tim2_enableCH -#define GPIO_tim2_enableCH(channel) ({ \ - GPIO_timer_channel_set(TIM2, channel); \ - TIM2->CCER |= (TIM_OutputState_Enable) << (4 * (channel - 1)); \ +#define GPIO_tim2_enableCH(channel) ({ \ + GPIO_timer_channel_set(TIM2, channel); \ + TIM2->CCER |= (TIM_OutputState_Enable ) << (4 * (channel - 1)); \ }) -#define GPIO_timer_CVR(channel) CONCAT_INDIRECT(CH, CONCAT_INDIRECT(channel, CVR)) +#define GPIO_timer_CVR(channel) CONCAT_INDIRECT(CH, CONCAT_INDIRECT(channel, CVR)) #undef GPIO_tim1_analogWrite -#define GPIO_tim1_analogWrite(channel, value) TIM1->GPIO_timer_CVR(channel) = value; +#define GPIO_tim1_analogWrite(channel, value) TIM1->GPIO_timer_CVR(channel) = value; #undef GPIO_tim2_analogWrite -#define GPIO_tim2_analogWrite(channel, value) TIM2->GPIO_timer_CVR(channel) = value; +#define GPIO_tim2_analogWrite(channel, value) TIM2->GPIO_timer_CVR(channel) = value; #endif // CH32V003_GPIO_BR_H diff --git a/src/extralibs/ch32v003_SPI.h b/src/extralibs/ch32v003_SPI.h index cbca66b..6fcb867 100644 --- a/src/extralibs/ch32v003_SPI.h +++ b/src/extralibs/ch32v003_SPI.h @@ -1,15 +1,15 @@ -// ######## necessities +//######## necessities // include guards #ifndef CH32V003_SPI_H #define CH32V003_SPI_H // includes +#include //uintN_t support #include "ch32fun.h" -#include //uintN_t support #ifndef APB_CLOCK -#define APB_CLOCK FUNCONF_SYSTEM_CORE_CLOCK + #define APB_CLOCK FUNCONF_SYSTEM_CORE_CLOCK #endif /*######## library usage and configuration @@ -20,7 +20,7 @@ SYSTEM_CORE_CLOCK and APB_CLOCK should be defined already as APB_CLOCK is used b #ifndef APB_CLOCK - #define APB_CLOCK FUNCONF_SYSTEM_CORE_CLOCK + #define APB_CLOCK FUNCONF_SYSTEM_CORE_CLOCK #endif to enable using the functions of this library: @@ -47,8 +47,10 @@ then pick the desired setting of each group: #define CH32V003_SPI_NSS_SOFTWARE_ANY_MANUAL // toggle manually! */ -// ######## function overview (declarations): use these! -// initialize and configure the SPI peripheral + + +//######## function overview (declarations): use these! +// initialize and configure the SPI peripheral static inline void SPI_init(); // establish / end a connection to the SPI device @@ -65,14 +67,14 @@ static inline void SPI_NSS_software_high(); // read / write the SPI device // these commands are raw, you'll have to consider all other steps in SPI_transfer! -static inline uint8_t SPI_read_8(); +static inline uint8_t SPI_read_8(); static inline uint16_t SPI_read_16(); -static inline void SPI_write_8(uint8_t data); -static inline void SPI_write_16(uint16_t data); +static inline void SPI_write_8(uint8_t data); +static inline void SPI_write_16(uint16_t data); // send a command and get a response from the SPI device // you'll use this for most devices -static inline uint8_t SPI_transfer_8(uint8_t data); +static inline uint8_t SPI_transfer_8(uint8_t data); static inline uint16_t SPI_transfer_16(uint16_t data); // SPI peripheral power enable / disable (default off, init() automatically enables) @@ -85,25 +87,31 @@ static inline void SPI_poweron(); static inline void kill_interrrupts(); static inline void restore_interrupts(); -// ######## internal function declarations -static inline void SPI_wait_TX_complete(); -static inline uint8_t SPI_is_RX_empty(); -static inline void SPI_wait_RX_available(); -// ######## internal variables + +//######## internal function declarations +static inline void SPI_wait_TX_complete(); +static inline uint8_t SPI_is_RX_empty(); +static inline void SPI_wait_RX_available(); + + + +//######## internal variables static uint16_t EXT1_INTENR_backup; -// ######## preprocessor macros -// min and max helper macros -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) + + +//######## preprocessor macros +// min and max helper macros +#define MIN(a,b) (((a)<(b))?(a):(b)) +#define MAX(a,b) (((a)>(b))?(a):(b)) // stringify for displaying what #defines evaluated to at preprocessor stage #define VALUE_TO_STRING(x) #x #define VALUE(x) VALUE_TO_STRING(x) -#define VAR_NAME_VALUE(var) #var "=" VALUE(var) +#define VAR_NAME_VALUE(var) #var "=" VALUE(var) -// compile-time log2 +//compile-time log2 #define LOG2(x) ((x) == 0 ? -1 : __builtin_ctz(x)) // compile-time clock prescaler calculation: log2(APB_CLOCK/SPEED_BUS) @@ -112,249 +120,233 @@ static uint16_t EXT1_INTENR_backup; // ensure that CLOCK_PRESCALER_VALUE is within the range of 0..7 _Static_assert(SPI_CLK_PRESCALER >= 0 && SPI_CLK_PRESCALER <= 7, "SPI_CLK_PRESCALER is out of range (0..7). Please set a different SPI bus speed. prescaler = log2(f_CPU/f_SPI)"); -// #pragma message(VAR_NAME_VALUE(SPI_CLK_PRESCALER)) +//#pragma message(VAR_NAME_VALUE(SPI_CLK_PRESCALER)) -// ######## preprocessor #define requirements + + +//######## preprocessor #define requirements #if !defined(CH32V003_SPI_DIRECTION_2LINE_TXRX) && !defined(CH32V003_SPI_DIRECTION_1LINE_TX) -#warning "none of the CH32V003_SPI_DIRECTION_ options were defined!" + #warning "none of the CH32V003_SPI_DIRECTION_ options were defined!" #endif #if defined(CH32V003_SPI_DIRECTION_2LINE_TXRX) && defined(CH32V003_SPI_DIRECTION_1LINE_TX) -#warning "both CH32V003_SPI_DIRECTION_ options were defined!" + #warning "both CH32V003_SPI_DIRECTION_ options were defined!" #endif #if ((defined(CH32V003_SPI_CLK_MODE_POL0_PHA0) ? 1 : 0) + \ - (defined(CH32V003_SPI_CLK_MODE_POL0_PHA1) ? 1 : 0) + \ - (defined(CH32V003_SPI_CLK_MODE_POL1_PHA0) ? 1 : 0) + \ - (defined(CH32V003_SPI_CLK_MODE_POL1_PHA1) ? 1 : 0)) > 1 -#warning "more than one of the CH32V003_SPI_CLK_MODE_ options were defined!" + (defined(CH32V003_SPI_CLK_MODE_POL0_PHA1) ? 1 : 0) + \ + (defined(CH32V003_SPI_CLK_MODE_POL1_PHA0) ? 1 : 0) + \ + (defined(CH32V003_SPI_CLK_MODE_POL1_PHA1) ? 1 : 0)) > 1 + #warning "more than one of the CH32V003_SPI_CLK_MODE_ options were defined!" #endif #if ((defined(CH32V003_SPI_CLK_MODE_POL0_PHA0) ? 1 : 0) + \ - (defined(CH32V003_SPI_CLK_MODE_POL0_PHA1) ? 1 : 0) + \ - (defined(CH32V003_SPI_CLK_MODE_POL1_PHA0) ? 1 : 0) + \ - (defined(CH32V003_SPI_CLK_MODE_POL1_PHA1) ? 1 : 0)) == 0 -#warning "none of the CH32V003_SPI_CLK_MODE_ options were defined!" + (defined(CH32V003_SPI_CLK_MODE_POL0_PHA1) ? 1 : 0) + \ + (defined(CH32V003_SPI_CLK_MODE_POL1_PHA0) ? 1 : 0) + \ + (defined(CH32V003_SPI_CLK_MODE_POL1_PHA1) ? 1 : 0)) == 0 + #warning "none of the CH32V003_SPI_CLK_MODE_ options were defined!" #endif #if ((defined(CH32V003_SPI_NSS_HARDWARE_PC0) ? 1 : 0) + \ - (defined(CH32V003_SPI_NSS_HARDWARE_PC1) ? 1 : 0) + \ - (defined(CH32V003_SPI_NSS_SOFTWARE_PC3) ? 1 : 0) + \ - (defined(CH32V003_SPI_NSS_SOFTWARE_PC4) ? 1 : 0) + \ - (defined(CH32V003_SPI_NSS_SOFTWARE_ANY_MANUAL) ? 1 : 0)) > 1 -#warning "more than one of the CH32V003_SPI_NSS_ options were defined!" + (defined(CH32V003_SPI_NSS_HARDWARE_PC1) ? 1 : 0) + \ + (defined(CH32V003_SPI_NSS_SOFTWARE_PC3) ? 1 : 0) + \ + (defined(CH32V003_SPI_NSS_SOFTWARE_PC4) ? 1 : 0) + \ + (defined(CH32V003_SPI_NSS_SOFTWARE_ANY_MANUAL) ? 1 : 0)) > 1 + #warning "more than one of the CH32V003_SPI_NSS_ options were defined!" #endif #if ((defined(CH32V003_SPI_NSS_HARDWARE_PC0) ? 1 : 0) + \ - (defined(CH32V003_SPI_NSS_HARDWARE_PC1) ? 1 : 0) + \ - (defined(CH32V003_SPI_NSS_SOFTWARE_PC3) ? 1 : 0) + \ - (defined(CH32V003_SPI_NSS_SOFTWARE_PC4) ? 1 : 0) + \ - (defined(CH32V003_SPI_NSS_SOFTWARE_ANY_MANUAL) ? 1 : 0)) == 0 -#warning "none of the CH32V003_SPI_NSS_ options were defined!" + (defined(CH32V003_SPI_NSS_HARDWARE_PC1) ? 1 : 0) + \ + (defined(CH32V003_SPI_NSS_SOFTWARE_PC3) ? 1 : 0) + \ + (defined(CH32V003_SPI_NSS_SOFTWARE_PC4) ? 1 : 0) + \ + (defined(CH32V003_SPI_NSS_SOFTWARE_ANY_MANUAL) ? 1 : 0)) == 0 + #warning "none of the CH32V003_SPI_NSS_ options were defined!" #endif -// ######## small function definitions, static inline -static inline void SPI_init() -{ - SPI_poweron(); - // reset control register - SPI1->CTLR1 = 0; - // set prescaler - SPI1->CTLR1 |= SPI_CTLR1_BR & (SPI_CLK_PRESCALER << 3); +//######## small function definitions, static inline +static inline void SPI_init() { + SPI_poweron(); + + // reset control register + SPI1->CTLR1 = 0; -// set clock polarity and phase -#if defined(CH32V003_SPI_CLK_MODE_POL0_PHA0) - SPI1->CTLR1 |= (SPI_CPOL_Low | SPI_CPHA_1Edge); -#elif defined(CH32V003_SPI_CLK_MODE_POL0_PHA1) - SPI1->CTLR1 |= (SPI_CPOL_Low | SPI_CPHA_2Edge); -#elif defined(CH32V003_SPI_CLK_MODE_POL1_PHA0) - SPI1->CTLR1 |= (SPI_CPOL_High | SPI_CPHA_1Edge); -#elif defined(CH32V003_SPI_CLK_MODE_POL1_PHA1) - SPI1->CTLR1 |= (SPI_CPOL_High | SPI_CPHA_2Edge); -#endif + // set prescaler + SPI1->CTLR1 |= SPI_CTLR1_BR & (SPI_CLK_PRESCALER<<3); -// configure NSS pin, master mode -#if defined(CH32V003_SPI_NSS_HARDWARE_PC0) - // _NSS (negative slave select) on PC0, 10MHz Output, alt func, push-pull1 - SPI1->CTLR1 |= SPI_NSS_Hard; // NSS hardware control mode - GPIOC->CFGLR &= ~(0xf << (4 * 0)); - GPIOC->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP_AF) << (4 * 0); - AFIO->PCFR1 |= GPIO_Remap_SPI1; // remap NSS (C1) to _NSS (C0) - SPI1->CTLR2 |= SPI_CTLR2_SSOE; // pull _NSS high -#elif defined(CH32V003_SPI_NSS_HARDWARE_PC1) - // NSS (negative slave select) on PC1, 10MHz Output, alt func, push-pull1 - SPI1->CTLR1 |= SPI_NSS_Hard; // NSS hardware control mode - GPIOC->CFGLR &= ~(0xf << (4 * 1)); - GPIOC->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP_AF) << (4 * 1); - SPI1->CTLR2 |= SPI_CTLR2_SSOE; // pull _NSS high -#elif defined(CH32V003_SPI_NSS_SOFTWARE_PC3) - SPI1->CTLR1 |= SPI_NSS_Soft; // SSM NSS software control mode - GPIOC->CFGLR &= ~(0xf << (4 * 3)); - GPIOC->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP_AF) << (4 * 3); -#elif defined(CH32V003_SPI_NSS_SOFTWARE_PC4) - SPI1->CTLR1 |= SPI_NSS_Soft; // SSM NSS software control mode - GPIOC->CFGLR &= ~(0xf << (4 * 4)); - GPIOC->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP_AF) << (4 * 4); -#elif defined(CH32V003_SPI_NSS_SOFTWARE_ANY_MANUAL) - SPI1->CTLR1 |= SPI_NSS_Soft; // SSM NSS software control mode -#endif + // set clock polarity and phase + #if defined(CH32V003_SPI_CLK_MODE_POL0_PHA0) + SPI1->CTLR1 |= (SPI_CPOL_Low | SPI_CPHA_1Edge); + #elif defined (CH32V003_SPI_CLK_MODE_POL0_PHA1) + SPI1->CTLR1 |= (SPI_CPOL_Low | SPI_CPHA_2Edge); + #elif defined (CH32V003_SPI_CLK_MODE_POL1_PHA0) + SPI1->CTLR1 |= (SPI_CPOL_High | SPI_CPHA_1Edge); + #elif defined (CH32V003_SPI_CLK_MODE_POL1_PHA1) + SPI1->CTLR1 |= (SPI_CPOL_High | SPI_CPHA_2Edge); + #endif + + // configure NSS pin, master mode + #if defined(CH32V003_SPI_NSS_HARDWARE_PC0) + // _NSS (negative slave select) on PC0, 10MHz Output, alt func, push-pull1 + SPI1->CTLR1 |= SPI_NSS_Hard; // NSS hardware control mode + GPIOC->CFGLR &= ~(0xf<<(4*0)); + GPIOC->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP_AF)<<(4*0); + AFIO->PCFR1 |= GPIO_Remap_SPI1; // remap NSS (C1) to _NSS (C0) + SPI1->CTLR2 |= SPI_CTLR2_SSOE; // pull _NSS high + #elif defined(CH32V003_SPI_NSS_HARDWARE_PC1) + // NSS (negative slave select) on PC1, 10MHz Output, alt func, push-pull1 + SPI1->CTLR1 |= SPI_NSS_Hard; // NSS hardware control mode + GPIOC->CFGLR &= ~(0xf<<(4*1)); + GPIOC->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP_AF)<<(4*1); + SPI1->CTLR2 |= SPI_CTLR2_SSOE; // pull _NSS high + #elif defined(CH32V003_SPI_NSS_SOFTWARE_PC3) + SPI1->CTLR1 |= SPI_NSS_Soft; // SSM NSS software control mode + GPIOC->CFGLR &= ~(0xf<<(4*3)); + GPIOC->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP_AF)<<(4*3); + #elif defined(CH32V003_SPI_NSS_SOFTWARE_PC4) + SPI1->CTLR1 |= SPI_NSS_Soft; // SSM NSS software control mode + GPIOC->CFGLR &= ~(0xf<<(4*4)); + GPIOC->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP_AF)<<(4*4); + #elif defined(CH32V003_SPI_NSS_SOFTWARE_ANY_MANUAL) + SPI1->CTLR1 |= SPI_NSS_Soft; // SSM NSS software control mode + #endif - // SCK on PC5, 10MHz Output, alt func, push-pull - GPIOC->CFGLR &= ~(0xf << (4 * 5)); - GPIOC->CFGLR |= (GPIO_Speed_50MHz | GPIO_CNF_OUT_PP_AF) << (4 * 5); + // SCK on PC5, 10MHz Output, alt func, push-pull + GPIOC->CFGLR &= ~(0xf<<(4*5)); + GPIOC->CFGLR |= (GPIO_Speed_50MHz | GPIO_CNF_OUT_PP_AF)<<(4*5); - // CH32V003 is master - SPI1->CTLR1 |= SPI_Mode_Master; + // CH32V003 is master + SPI1->CTLR1 |= SPI_Mode_Master; + + // set data direction and configure data pins + #if defined(CH32V003_SPI_DIRECTION_2LINE_TXRX) + SPI1->CTLR1 |= SPI_Direction_2Lines_FullDuplex; -// set data direction and configure data pins -#if defined(CH32V003_SPI_DIRECTION_2LINE_TXRX) - SPI1->CTLR1 |= SPI_Direction_2Lines_FullDuplex; + // MOSI on PC6, 10MHz Output, alt func, push-pull + GPIOC->CFGLR &= ~(0xf<<(4*6)); + GPIOC->CFGLR |= (GPIO_Speed_50MHz | GPIO_CNF_OUT_PP_AF)<<(4*6); + + // MISO on PC7, 10MHz input, floating + GPIOC->CFGLR &= ~(0xf<<(4*7)); + GPIOC->CFGLR |= GPIO_CNF_IN_FLOATING<<(4*7); + #elif defined(CH32V003_SPI_DIRECTION_1LINE_TX) + SPI1->CTLR1 |= SPI_Direction_1Line_Tx; - // MOSI on PC6, 10MHz Output, alt func, push-pull - GPIOC->CFGLR &= ~(0xf << (4 * 6)); - GPIOC->CFGLR |= (GPIO_Speed_50MHz | GPIO_CNF_OUT_PP_AF) << (4 * 6); - - // MISO on PC7, 10MHz input, floating - GPIOC->CFGLR &= ~(0xf << (4 * 7)); - GPIOC->CFGLR |= GPIO_CNF_IN_FLOATING << (4 * 7); -#elif defined(CH32V003_SPI_DIRECTION_1LINE_TX) - SPI1->CTLR1 |= SPI_Direction_1Line_Tx; - - // MOSI on PC6, 10MHz Output, alt func, push-pull - GPIOC->CFGLR &= ~(0xf << (4 * 6)); - GPIOC->CFGLR |= (GPIO_Speed_50MHz | GPIO_CNF_OUT_PP_AF) << (4 * 6); -#endif + // MOSI on PC6, 10MHz Output, alt func, push-pull + GPIOC->CFGLR &= ~(0xf<<(4*6)); + GPIOC->CFGLR |= (GPIO_Speed_50MHz | GPIO_CNF_OUT_PP_AF)<<(4*6); + #endif } -static inline void SPI_begin_8() -{ - SPI1->CTLR1 &= ~(SPI_CTLR1_DFF); // DFF 16bit data-length enable, writable only when SPE is 0 - SPI1->CTLR1 |= SPI_CTLR1_SPE; +static inline void SPI_begin_8() { + SPI1->CTLR1 &= ~(SPI_CTLR1_DFF); // DFF 16bit data-length enable, writable only when SPE is 0 + SPI1->CTLR1 |= SPI_CTLR1_SPE; } -static inline void SPI_begin_16() -{ - SPI1->CTLR1 |= SPI_CTLR1_DFF; // DFF 16bit data-length enable, writable only when SPE is 0 - SPI1->CTLR1 |= SPI_CTLR1_SPE; +static inline void SPI_begin_16() { + SPI1->CTLR1 |= SPI_CTLR1_DFF; // DFF 16bit data-length enable, writable only when SPE is 0 + SPI1->CTLR1 |= SPI_CTLR1_SPE; } -static inline void SPI_end() -{ - SPI1->CTLR1 &= ~(SPI_CTLR1_SPE); +static inline void SPI_end() { + SPI1->CTLR1 &= ~(SPI_CTLR1_SPE); } #if defined(CH32V003_SPI_NSS_SOFTWARE_PC3) -static inline void SPI_NSS_software_high() -{ - GPIOC->BSHR = (1 << 3); +static inline void SPI_NSS_software_high() { + GPIOC->BSHR = (1<<3); } -static inline void SPI_NSS_software_low() -{ - GPIOC->BSHR = (1 << (16 + 3)); +static inline void SPI_NSS_software_low() { + GPIOC->BSHR = (1<<(16+3)); } -#elif defined(CH32V003_SPI_NSS_SOFTWARE_PC4) -static inline void SPI_NSS_software_high() -{ - GPIOC->BSHR = (1 << 4); +#elif defined(CH32V003_SPI_NSS_SOFTWARE_PC4) +static inline void SPI_NSS_software_high() { + GPIOC->BSHR = (1<<4); } -static inline void SPI_NSS_software_low() -{ - GPIOC->BSHR = (1 << (16 + 4)); +static inline void SPI_NSS_software_low() { + GPIOC->BSHR = (1<<(16+4)); } #endif -static inline uint8_t SPI_read_8() -{ - return SPI1->DATAR; +static inline uint8_t SPI_read_8() { + return SPI1->DATAR; } -static inline uint16_t SPI_read_16() -{ - return SPI1->DATAR; +static inline uint16_t SPI_read_16() { + return SPI1->DATAR; } -static inline void SPI_write_8(uint8_t data) -{ - SPI1->DATAR = data; +static inline void SPI_write_8(uint8_t data) { + SPI1->DATAR = data; } -static inline void SPI_write_16(uint16_t data) -{ - SPI1->DATAR = data; +static inline void SPI_write_16(uint16_t data) { + SPI1->DATAR = data; } -static inline uint8_t SPI_transfer_8(uint8_t data) -{ -#if defined(CH32V003_SPI_NSS_SOFTWARE_PC3) || defined(CH32V003_SPI_NSS_SOFTWARE_PC4) - SPI_NSS_software_high(); -#endif - SPI_write_8(data); - SPI_wait_TX_complete(); - asm volatile("nop"); - SPI_wait_RX_available(); -#if defined(CH32V003_SPI_NSS_SOFTWARE_PC3) || defined(CH32V003_SPI_NSS_SOFTWARE_PC4) - SPI_NSS_software_low(); -#endif - return SPI_read_8(); +static inline uint8_t SPI_transfer_8(uint8_t data) { + #if defined(CH32V003_SPI_NSS_SOFTWARE_PC3) || defined(CH32V003_SPI_NSS_SOFTWARE_PC4) + SPI_NSS_software_high(); + #endif + SPI_write_8(data); + SPI_wait_TX_complete(); + asm volatile("nop"); + SPI_wait_RX_available(); + #if defined(CH32V003_SPI_NSS_SOFTWARE_PC3) || defined(CH32V003_SPI_NSS_SOFTWARE_PC4) + SPI_NSS_software_low(); + #endif + return SPI_read_8(); } -static inline uint16_t SPI_transfer_16(uint16_t data) -{ -#if defined(CH32V003_SPI_NSS_SOFTWARE_PC3) || defined(CH32V003_SPI_NSS_SOFTWARE_PC4) - SPI_NSS_software_high(); -#endif - SPI_write_16(data); - SPI_wait_TX_complete(); - asm volatile("nop"); - SPI_wait_RX_available(); -#if defined(CH32V003_SPI_NSS_SOFTWARE_PC3) || defined(CH32V003_SPI_NSS_SOFTWARE_PC4) - SPI_NSS_software_low(); -#endif - return SPI_read_16(); +static inline uint16_t SPI_transfer_16(uint16_t data) { + #if defined(CH32V003_SPI_NSS_SOFTWARE_PC3) || defined(CH32V003_SPI_NSS_SOFTWARE_PC4) + SPI_NSS_software_high(); + #endif + SPI_write_16(data); + SPI_wait_TX_complete(); + asm volatile("nop"); + SPI_wait_RX_available(); + #if defined(CH32V003_SPI_NSS_SOFTWARE_PC3) || defined(CH32V003_SPI_NSS_SOFTWARE_PC4) + SPI_NSS_software_low(); + #endif + return SPI_read_16(); } -static inline void SPI_poweroff() -{ - SPI_end(); - RCC->APB2PCENR &= ~RCC_APB2Periph_SPI1; +static inline void SPI_poweroff() { + SPI_end(); + RCC->APB2PCENR &= ~RCC_APB2Periph_SPI1; } -static inline void SPI_poweron() -{ - RCC->APB2PCENR |= RCC_APB2Periph_GPIOC | RCC_APB2Periph_SPI1; +static inline void SPI_poweron() { + RCC->APB2PCENR |= RCC_APB2Periph_GPIOC | RCC_APB2Periph_SPI1; } -static inline void kill_interrrupts() -{ - EXT1_INTENR_backup = EXTI->INTENR; - // zero the interrupt enable register to disable all interrupts - EXTI->INTENR = 0; +static inline void kill_interrrupts() { + EXT1_INTENR_backup = EXTI->INTENR; + // zero the interrupt enable register to disable all interrupts + EXTI->INTENR = 0; } -static inline void restore_interrupts() -{ - EXTI->INTENR = EXT1_INTENR_backup; +static inline void restore_interrupts() { + EXTI->INTENR = EXT1_INTENR_backup; } -// ######## small internal function definitions, static inline -static inline void SPI_wait_TX_complete() -{ - while (!(SPI1->STATR & SPI_STATR_TXE)) {} + + +//######## small internal function definitions, static inline +static inline void SPI_wait_TX_complete() { + while(!(SPI1->STATR & SPI_STATR_TXE)) {} } -static inline uint8_t SPI_is_RX_empty() -{ - return SPI1->STATR & SPI_STATR_RXNE; +static inline uint8_t SPI_is_RX_empty() { + return SPI1->STATR & SPI_STATR_RXNE; } -static inline void SPI_wait_RX_available() -{ - while (!(SPI1->STATR & SPI_STATR_RXNE)) {} +static inline void SPI_wait_RX_available() { + while(!(SPI1->STATR & SPI_STATR_RXNE)) {} } -static inline void SPI_wait_not_busy() -{ - while ((SPI1->STATR & SPI_STATR_BSY) != 0) {} +static inline void SPI_wait_not_busy() { + while((SPI1->STATR & SPI_STATR_BSY) != 0) {} } -static inline void SPI_wait_transmit_finished() -{ - SPI_wait_TX_complete(); - SPI_wait_not_busy(); +static inline void SPI_wait_transmit_finished() { + SPI_wait_TX_complete(); + SPI_wait_not_busy(); } -// ######## implementation block -// #define CH32V003_SPI_IMPLEMENTATION //enable so LSP can give you text colors while working on the implementation block, disable for normal use of the library + +//######## implementation block +//#define CH32V003_SPI_IMPLEMENTATION //enable so LSP can give you text colors while working on the implementation block, disable for normal use of the library #if defined(CH32V003_SPI_IMPLEMENTATION) -// no functions here because I think all of the functions are small enough to static inline +//no functions here because I think all of the functions are small enough to static inline #endif // CH32V003_SPI_IMPLEMENTATION #endif // CH32V003_SPI_H diff --git a/src/extralibs/ch32v003_touch.h b/src/extralibs/ch32v003_touch.h index 44f42e2..825f7e8 100644 --- a/src/extralibs/ch32v003_touch.h +++ b/src/extralibs/ch32v003_touch.h @@ -3,42 +3,44 @@ /** ADC-based Capactive Touch Control. - see cap_touch_adc.c for an example. + see cap_touch_adc.c for an example. - // Enable GPIOD, C and ADC - RCC->APB2PCENR |= RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOD | RCC_APB2Periph_GPIOC | RCC_APB2Periph_ADC1; - InitTouchADC(); + // Enable GPIOD, C and ADC + RCC->APB2PCENR |= RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOD | RCC_APB2Periph_GPIOC | RCC_APB2Periph_ADC1; + InitTouchADC(); - // Then do this any time you want to read some touches. - sum[0] += ReadTouchPin( GPIOA, 2, 0, iterations ); - sum[1] += ReadTouchPin( GPIOA, 1, 1, iterations ); - sum[2] += ReadTouchPin( GPIOC, 4, 2, iterations ); - sum[3] += ReadTouchPin( GPIOD, 2, 3, iterations ); - sum[4] += ReadTouchPin( GPIOD, 3, 4, iterations ); - sum[5] += ReadTouchPin( GPIOD, 5, 5, iterations ); - sum[6] += ReadTouchPin( GPIOD, 6, 6, iterations ); - sum[7] += ReadTouchPin( GPIOD, 4, 7, iterations ); + // Then do this any time you want to read some touches. + sum[0] += ReadTouchPin( GPIOA, 2, 0, iterations ); + sum[1] += ReadTouchPin( GPIOA, 1, 1, iterations ); + sum[2] += ReadTouchPin( GPIOC, 4, 2, iterations ); + sum[3] += ReadTouchPin( GPIOD, 2, 3, iterations ); + sum[4] += ReadTouchPin( GPIOD, 3, 4, iterations ); + sum[5] += ReadTouchPin( GPIOD, 5, 5, iterations ); + sum[6] += ReadTouchPin( GPIOD, 6, 6, iterations ); + sum[7] += ReadTouchPin( GPIOD, 4, 7, iterations ); */ -#define TOUCH_ADC_SAMPLE_TIME 2 // Tricky: Don't change this without a lot of experimentation. + + +#define TOUCH_ADC_SAMPLE_TIME 2 // Tricky: Don't change this without a lot of experimentation. // Can either be 0 or 1. // If 0: Measurement low and rises high. So more pressed is smaller number. // If 1: Higher number = harder press. Good to pair with TOUCH_FLAT. // If you are doing more prox, use mode 0, otherwise, use mode 1. -#define TOUCH_SLOPE 1 +#define TOUCH_SLOPE 1 // If you set this to 1, it will glitch the line, so it will only read // anything reasonable if the capacitance can overcome that initial spike. // Typically, it seems if you use this you probbly don't need to do // any pre-use calibration. -#define TOUCH_FLAT 0 +#define TOUCH_FLAT 0 // Macro used for force-alingining ADC timing #define FORCEALIGNADC \ - asm volatile( \ - "\n\ + asm volatile( \ + "\n\ .balign 4\n\ andi a2, %[cyccnt], 3\n\ c.slli a2, 1\n\ @@ -48,172 +50,169 @@ jalr a2, 1\n\ .long 0x00010001\n\ .long 0x00010001\n\ - " ::[cyccnt] "r"(SysTick->CNT) : "a1", "a2"); + "\ + :: [cyccnt]"r"(SysTick->CNT) : "a1", "a2"\ + ); -static void InitTouchADC(); -void InitTouchADC() + +static void InitTouchADC( ); +void InitTouchADC( ) { - // ADCCLK = 24 MHz => RCC_ADCPRE = 0: divide sys clock by 2 - RCC->CFGR0 &= ~(0x1F << 11); + // ADCCLK = 24 MHz => RCC_ADCPRE = 0: divide sys clock by 2 + RCC->CFGR0 &= ~(0x1F<<11); - // Set up single conversion on chl 2 - ADC1->RSQR1 = 0; - ADC1->RSQR2 = 0; + // Set up single conversion on chl 2 + ADC1->RSQR1 = 0; + ADC1->RSQR2 = 0; - // turn on ADC and set rule group to sw trig - ADC1->CTLR2 |= ADC_ADON | ADC_EXTSEL; - - // Reset calibration - ADC1->CTLR2 |= ADC_RSTCAL; - while (ADC1->CTLR2 & ADC_RSTCAL) - ; - - // Calibrate - ADC1->CTLR2 |= ADC_CAL; - while (ADC1->CTLR2 & ADC_CAL) - ; + // turn on ADC and set rule group to sw trig + ADC1->CTLR2 |= ADC_ADON | ADC_EXTSEL; + + // Reset calibration + ADC1->CTLR2 |= ADC_RSTCAL; + while(ADC1->CTLR2 & ADC_RSTCAL); + + // Calibrate + ADC1->CTLR2 |= ADC_CAL; + while(ADC1->CTLR2 & ADC_CAL); } // Run from RAM to get even more stable timing. // This function call takes about 8.1uS to execute. -static uint32_t ReadTouchPin(GPIO_TypeDef *io, int portpin, int adcno, int iterations) __attribute__((noinline, section(".srodata"))); -uint32_t ReadTouchPin(GPIO_TypeDef *io, int portpin, int adcno, int iterations) +static uint32_t ReadTouchPin( GPIO_TypeDef * io, int portpin, int adcno, int iterations ) __attribute__((noinline, section(".srodata"))); +uint32_t ReadTouchPin( GPIO_TypeDef * io, int portpin, int adcno, int iterations ) { - uint32_t ret = 0; + uint32_t ret = 0; - __disable_irq(); - FORCEALIGNADC - ADC1->RSQR3 = adcno; - ADC1->SAMPTR2 = TOUCH_ADC_SAMPLE_TIME << (3 * adcno); - __enable_irq(); + __disable_irq(); + FORCEALIGNADC + ADC1->RSQR3 = adcno; + ADC1->SAMPTR2 = TOUCH_ADC_SAMPLE_TIME<<(3*adcno); + __enable_irq(); - uint32_t CFGBASE = io->CFGLR & (~(0xf << (4 * portpin))); - uint32_t CFGFLOAT = ((GPIO_CFGLR_IN_PUPD) << (4 * portpin)) | CFGBASE; - uint32_t CFGDRIVE = (GPIO_CFGLR_OUT_2Mhz_PP) << (4 * portpin) | CFGBASE; + uint32_t CFGBASE = io->CFGLR & (~(0xf<<(4*portpin))); + uint32_t CFGFLOAT = ((GPIO_CFGLR_IN_PUPD)<<(4*portpin)) | CFGBASE; + uint32_t CFGDRIVE = (GPIO_CFGLR_OUT_2Mhz_PP)<<(4*portpin) | CFGBASE; + + // If we run multiple times with slightly different wait times, we can + // reduce the impact of the ADC's DNL. - // If we run multiple times with slightly different wait times, we can - // reduce the impact of the ADC's DNL. #if TOUCH_FLAT == 1 -#define RELEASEIO \ - io->BSHR = 1 << (portpin + 16 * TOUCH_SLOPE); \ - io->CFGLR = CFGFLOAT; +#define RELEASEIO io->BSHR = 1<<(portpin+16*TOUCH_SLOPE); io->CFGLR = CFGFLOAT; #else -#define RELEASEIO \ - io->CFGLR = CFGFLOAT; \ - io->BSHR = 1 << (portpin + 16 * TOUCH_SLOPE); +#define RELEASEIO io->CFGLR = CFGFLOAT; io->BSHR = 1<<(portpin+16*TOUCH_SLOPE); #endif -#define INNER_LOOP(n) \ - { \ - /* Only lock IRQ for a very narrow window. */ \ - __disable_irq(); \ - FORCEALIGNADC \ - \ - /* Tricky - we start the ADC BEFORE we transition the pin. By doing \ - this We are catching it onthe slope much more effectively. */ \ - ADC1->CTLR2 = ADC_SWSTART | ADC_ADON | ADC_EXTSEL; \ - \ - ADD_N_NOPS(n) \ - \ - RELEASEIO \ - \ - /* Sampling actually starts here, somewhere, so we can let other \ - interrupts run */ \ - __enable_irq(); \ - while (!(ADC1->STATR & ADC_EOC)) \ - ; \ - io->CFGLR = CFGDRIVE; \ - io->BSHR = 1 << (portpin + (16 * (1 - TOUCH_SLOPE))); \ - ret += ADC1->RDATAR; \ - } +#define INNER_LOOP( n ) \ + { \ + /* Only lock IRQ for a very narrow window. */ \ + __disable_irq(); \ + FORCEALIGNADC \ + \ + /* Tricky - we start the ADC BEFORE we transition the pin. By doing \ + this We are catching it onthe slope much more effectively. */ \ + ADC1->CTLR2 = ADC_SWSTART | ADC_ADON | ADC_EXTSEL; \ + \ + ADD_N_NOPS( n ) \ + \ + RELEASEIO \ + \ + /* Sampling actually starts here, somewhere, so we can let other \ + interrupts run */ \ + __enable_irq(); \ + while(!(ADC1->STATR & ADC_EOC)); \ + io->CFGLR = CFGDRIVE; \ + io->BSHR = 1<<(portpin+(16*(1-TOUCH_SLOPE))); \ + ret += ADC1->RDATAR; \ + } - int i; - for (i = 0; i < iterations; i++) - { - // Wait a variable amount of time based on loop iteration, in order - // to get a variety of RC points and minimize DNL. + int i; + for( i = 0; i < iterations; i++ ) + { + // Wait a variable amount of time based on loop iteration, in order + // to get a variety of RC points and minimize DNL. - INNER_LOOP(0); - INNER_LOOP(2); - INNER_LOOP(4); - } + INNER_LOOP( 0 ); + INNER_LOOP( 2 ); + INNER_LOOP( 4 ); + } - return ret; + return ret; } // Run from RAM to get even more stable timing. // This function call takes about 8.1uS to execute. -static uint32_t ReadTouchPinSafe(GPIO_TypeDef *io, int portpin, int adcno, int iterations) __attribute__((noinline, section(".srodata"))); -uint32_t ReadTouchPinSafe(GPIO_TypeDef *io, int portpin, int adcno, int iterations) +static uint32_t ReadTouchPinSafe( GPIO_TypeDef * io, int portpin, int adcno, int iterations ) __attribute__((noinline, section(".srodata"))); +uint32_t ReadTouchPinSafe( GPIO_TypeDef * io, int portpin, int adcno, int iterations ) { - uint32_t ret = 0; + uint32_t ret = 0; - ADC1->RSQR3 = adcno; - ADC1->SAMPTR2 = TOUCH_ADC_SAMPLE_TIME << (3 * adcno); + ADC1->RSQR3 = adcno; + ADC1->SAMPTR2 = TOUCH_ADC_SAMPLE_TIME<<(3*adcno); - // If we run multiple times with slightly different wait times, we can - // reduce the impact of the ADC's DNL. + // If we run multiple times with slightly different wait times, we can + // reduce the impact of the ADC's DNL. -#define INNER_LOOP_SAFE(n) \ - { \ - /* Only lock IRQ for a very narrow window. */ \ - __disable_irq(); \ - \ - FORCEALIGNADC \ - \ - /* Tricky - we start the ADC BEFORE we transition the pin. By doing \ - this We are catching it onthe slope much more effectively. */ \ - ADC1->CTLR2 = ADC_SWSTART | ADC_ADON | ADC_EXTSEL; \ - \ - ADD_N_NOPS(n) \ - \ - io->CFGLR = ((GPIO_CFGLR_IN_PUPD) << (4 * portpin)) | (io->CFGLR & (~(0xf << (4 * portpin)))); \ - io->BSHR = 1 << (portpin + 16 * TOUCH_SLOPE); \ - \ - /* Sampling actually starts here, somewhere, so we can let other \ - interrupts run */ \ - __enable_irq(); \ - while (!(ADC1->STATR & ADC_EOC)) \ - ; \ - __disable_irq(); \ - io->CFGLR = (GPIO_CFGLR_OUT_2Mhz_PP) << (4 * portpin) | (io->CFGLR & (~(0xf << (4 * portpin)))); \ - __enable_irq(); \ - io->BSHR = 1 << (portpin + (16 * (1 - TOUCH_SLOPE))); \ - ret += ADC1->RDATAR; \ - } +#define INNER_LOOP_SAFE( n ) \ + { \ + /* Only lock IRQ for a very narrow window. */ \ + __disable_irq(); \ + \ + FORCEALIGNADC \ + \ + /* Tricky - we start the ADC BEFORE we transition the pin. By doing \ + this We are catching it onthe slope much more effectively. */ \ + ADC1->CTLR2 = ADC_SWSTART | ADC_ADON | ADC_EXTSEL; \ + \ + ADD_N_NOPS( n ) \ + \ + io->CFGLR = ((GPIO_CFGLR_IN_PUPD)<<(4*portpin)) | (io->CFGLR & (~(0xf<<(4*portpin)))); \ + io->BSHR = 1<<(portpin+16*TOUCH_SLOPE); \ + \ + /* Sampling actually starts here, somewhere, so we can let other \ + interrupts run */ \ + __enable_irq(); \ + while(!(ADC1->STATR & ADC_EOC)); \ + __disable_irq(); \ + io->CFGLR = (GPIO_CFGLR_OUT_2Mhz_PP)<<(4*portpin) | (io->CFGLR & (~(0xf<<(4*portpin)))); \ + __enable_irq(); \ + io->BSHR = 1<<(portpin+(16*(1-TOUCH_SLOPE))); \ + ret += ADC1->RDATAR; \ + } - int i; - for (i = 0; i < iterations; i++) - { - // Wait a variable amount of time based on loop iteration, in order - // to get a variety of RC points and minimize DNL. + int i; + for( i = 0; i < iterations; i++ ) + { + // Wait a variable amount of time based on loop iteration, in order + // to get a variety of RC points and minimize DNL. - INNER_LOOP_SAFE(0); - INNER_LOOP_SAFE(2); - INNER_LOOP_SAFE(4); - } + INNER_LOOP_SAFE( 0 ); + INNER_LOOP_SAFE( 2 ); + INNER_LOOP_SAFE( 4 ); + } - return ret; + return ret; } + #endif /* * MIT License - * + * * Copyright (c) 2023 Valve Corporation - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -222,3 +221,4 @@ uint32_t ReadTouchPinSafe(GPIO_TypeDef *io, int portpin, int adcno, int i * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ + diff --git a/src/extralibs/ch32v307gigabit.h b/src/extralibs/ch32v307gigabit.h index 4af9137..60ca030 100644 --- a/src/extralibs/ch32v307gigabit.h +++ b/src/extralibs/ch32v307gigabit.h @@ -2,7 +2,7 @@ #define _CH32V307GIGABIT_H /* This file is written against the RTL8211E - */ +*/ // #define CH32V307GIGABIT_MCO25 1 // #define CH32V307GIGABIT_PHYADDRESS 0 @@ -34,515 +34,515 @@ // ETH DMA structure definition (From ch32v30x_eth.c typedef struct { - uint32_t volatile Status; /* Status */ - uint32_t ControlBufferSize; /* Control and Buffer1, Buffer2 lengths */ - uint32_t Buffer1Addr; /* Buffer1 address pointer */ - uint32_t Buffer2NextDescAddr; /* Buffer2 or next descriptor address pointer */ + uint32_t volatile Status; /* Status */ + uint32_t ControlBufferSize; /* Control and Buffer1, Buffer2 lengths */ + uint32_t Buffer1Addr; /* Buffer1 address pointer */ + uint32_t Buffer2NextDescAddr; /* Buffer2 or next descriptor address pointer */ } ETH_DMADESCTypeDef; // You must provide: -void ch32v307ethHandleReconfig(int link, int speed, int duplex); +void ch32v307ethHandleReconfig( int link, int speed, int duplex ); // Return non-zero to suppress OWN return (for if you are still holding onto the buffer) -int ch32v307ethInitHandlePacket(uint8_t *data, int frame_length, ETH_DMADESCTypeDef *dmadesc); +int ch32v307ethInitHandlePacket( uint8_t * data, int frame_length, ETH_DMADESCTypeDef * dmadesc ); -void ch32v307ethInitHandleTXC(void); +void ch32v307ethInitHandleTXC( void ); // This library provides: -static void ch32v307ethGetMacInUC(uint8_t *mac); -static int ch32v307ethInit(void); -static int ch32v307ethTransmitStatic(uint8_t *buffer, uint32_t length, int enable_txc); // Does not copy. -static int ch32v307ethTickPhy(void); +static void ch32v307ethGetMacInUC( uint8_t * mac ); +static int ch32v307ethInit( void ); +static int ch32v307ethTransmitStatic(uint8_t * buffer, uint32_t length, int enable_txc); // Does not copy. +static int ch32v307ethTickPhy( void ); // Data pursuent to ethernet. -uint8_t ch32v307eth_mac[6] = {0}; -uint16_t ch32v307eth_phyid = 0; // 0xc916 = RTL8211FS / 0xc915 = RTL8211E-VB -ETH_DMADESCTypeDef ch32v307eth_DMARxDscrTab[CH32V307GIGABIT_RXBUFNB] __attribute__((aligned(4))); // MAC receive descriptor, 4-byte aligned -ETH_DMADESCTypeDef ch32v307eth_DMATxDscrTab[CH32V307GIGABIT_TXBUFNB] __attribute__((aligned(4))); // MAC send descriptor, 4-byte aligned -uint8_t ch32v307eth_MACRxBuf[CH32V307GIGABIT_RXBUFNB * CH32V307GIGABIT_BUFFSIZE] __attribute__((aligned(4))); // MAC receive buffer, 4-byte aligned -ETH_DMADESCTypeDef *pDMARxGet; -ETH_DMADESCTypeDef *pDMATxSet; +uint8_t ch32v307eth_mac[6] = { 0 }; +uint16_t ch32v307eth_phyid = 0; // 0xc916 = RTL8211FS / 0xc915 = RTL8211E-VB +ETH_DMADESCTypeDef ch32v307eth_DMARxDscrTab[CH32V307GIGABIT_RXBUFNB] __attribute__((aligned(4))); // MAC receive descriptor, 4-byte aligned +ETH_DMADESCTypeDef ch32v307eth_DMATxDscrTab[CH32V307GIGABIT_TXBUFNB] __attribute__((aligned(4))); // MAC send descriptor, 4-byte aligned +uint8_t ch32v307eth_MACRxBuf[CH32V307GIGABIT_RXBUFNB*CH32V307GIGABIT_BUFFSIZE] __attribute__((aligned(4))); // MAC receive buffer, 4-byte aligned +ETH_DMADESCTypeDef * pDMARxGet; +ETH_DMADESCTypeDef * pDMATxSet; + // Internal functions -static int ch32v307ethPHYRegWrite(uint32_t reg, uint32_t val); -static int ch32v307ethPHYRegAsyncRead(int reg, int *value); -static int ch32v307ethPHYRegRead(uint32_t reg); +static int ch32v307ethPHYRegWrite( uint32_t reg, uint32_t val ); +static int ch32v307ethPHYRegAsyncRead( int reg, int * value ); +static int ch32v307ethPHYRegRead( uint32_t reg ); -static int ch32v307ethPHYRegAsyncRead(int reg, int *value) +static int ch32v307ethPHYRegAsyncRead( int reg, int * value ) { - static uint8_t reg_request_count = 0; + static uint8_t reg_request_count = 0; - uint32_t miiar = ETH->MACMIIAR; - if (miiar & ETH_MACMIIAR_MB) - { - return -1; - } - if (((miiar & ETH_MACMIIAR_MR) >> 6) != reg || reg_request_count < 2) - { - ETH->MACMIIAR = ETH_MACMIIAR_CR_Div42 /* = 0, per 27.1.8.1.4 */ | - ((uint32_t)CH32V307GIGABIT_PHYADDRESS << 11) | // ETH_MACMIIAR_PA - (((uint32_t)reg << 6) & ETH_MACMIIAR_MR) | - (0 /*!ETH_MACMIIAR_MW*/) | ETH_MACMIIAR_MB; - reg_request_count++; - return -1; - } - reg_request_count = 0; - *value = ETH->MACMIIDR; - ETH->MACMIIAR |= ETH_MACMIIAR_MR; // Poison register. - return 0; + uint32_t miiar = ETH->MACMIIAR; + if( miiar & ETH_MACMIIAR_MB ) + { + return -1; + } + if( ( ( miiar & ETH_MACMIIAR_MR ) >> 6 ) != reg || reg_request_count < 2 ) + { + ETH->MACMIIAR = ETH_MACMIIAR_CR_Div42 /* = 0, per 27.1.8.1.4 */ | + ((uint32_t)CH32V307GIGABIT_PHYADDRESS << 11) | // ETH_MACMIIAR_PA + (((uint32_t)reg << 6) & ETH_MACMIIAR_MR) | + (0 /*!ETH_MACMIIAR_MW*/) | ETH_MACMIIAR_MB; + reg_request_count++; + return -1; + } + reg_request_count = 0; + *value = ETH->MACMIIDR; + ETH->MACMIIAR |= ETH_MACMIIAR_MR; // Poison register. + return 0; } static int ch32v307ethTickPhy(void) { - int speed, linked, duplex; - const int reg = (ch32v307eth_phyid == 0xc916) ? 0x1a : 0x11; // PHYSR (different on each part) - int miidr; - if (ch32v307ethPHYRegAsyncRead(reg, &miidr)) return -1; + int speed, linked, duplex; + const int reg = (ch32v307eth_phyid == 0xc916) ? 0x1a : 0x11; // PHYSR (different on each part) + int miidr; + if( ch32v307ethPHYRegAsyncRead( reg, &miidr ) ) return -1; - printf("REG: %02x / %04x / %04x\n", reg, miidr, ch32v307eth_phyid); + printf( "REG: %02x / %04x / %04x\n", reg, miidr, ch32v307eth_phyid ); - if (reg == 0x1a) - { - speed = ((miidr >> 4) & 3); - linked = ((miidr >> 2) & 1); - duplex = ((miidr >> 3) & 1); - } - else - { - speed = ((miidr >> 14) & 3); - linked = ((miidr >> 10) & 1); - duplex = ((miidr >> 13) & 1); - } + if( reg == 0x1a ) + { + speed = ((miidr>>4)&3); + linked = ((miidr>>2)&1); + duplex = ((miidr>>3)&1); + } + else + { + speed = ((miidr>>14)&3); + linked = ((miidr>>10)&1); + duplex = ((miidr>>13)&1); + } - printf("LINK INFO: %d %d %d\n", speed, linked, duplex); - if (linked) - { - uint32_t oldmaccr = ETH->MACCR; - uint32_t newmaccr = (oldmaccr & ~((1 << 11) | (3 << 14))) | (speed << 14) | (duplex << 11); - if (newmaccr != oldmaccr) - { - ETH->MACCR = newmaccr; - ch32v307ethHandleReconfig(linked, speed, duplex); - return 1; - } - } - return 0; + printf( "LINK INFO: %d %d %d\n", speed, linked, duplex ); + if( linked ) + { + uint32_t oldmaccr = ETH->MACCR; + uint32_t newmaccr = (oldmaccr & ~( ( 1<<11 ) | (3<<14) ) ) | (speed<<14) | ( duplex<<11); + if( newmaccr != oldmaccr ) + { + ETH->MACCR = newmaccr; + ch32v307ethHandleReconfig( linked, speed, duplex ); + return 1; + } + } + return 0; } + // Based on ETH_WritePHYRegister -static int ch32v307ethPHYRegWrite(uint32_t reg, uint32_t val) +static int ch32v307ethPHYRegWrite( uint32_t reg, uint32_t val ) { - ETH->MACMIIDR = val; - ETH->MACMIIAR = ETH_MACMIIAR_CR_Div42 /* = 0, per 27.1.8.1.4 */ | - (((uint32_t)CH32V307GIGABIT_PHYADDRESS << 11)) | // ETH_MACMIIAR_PA - (((uint32_t)reg << 6) & ETH_MACMIIAR_MR) | - ETH_MACMIIAR_MW | ETH_MACMIIAR_MB; + ETH->MACMIIDR = val; + ETH->MACMIIAR = ETH_MACMIIAR_CR_Div42 /* = 0, per 27.1.8.1.4 */ | + (((uint32_t)CH32V307GIGABIT_PHYADDRESS << 11)) | // ETH_MACMIIAR_PA + (((uint32_t)reg << 6) & ETH_MACMIIAR_MR) | + ETH_MACMIIAR_MW | ETH_MACMIIAR_MB; - uint32_t timeout = 0x100000; - while ((ETH->MACMIIAR & ETH_MACMIIAR_MB) && --timeout) - ; + uint32_t timeout = 0x100000; + while( ( ETH->MACMIIAR & ETH_MACMIIAR_MB ) && --timeout ); - // If timeout = 0, is an error. - return timeout ? 0 : -1; + // If timeout = 0, is an error. + return timeout ? 0 : -1; } -static int ch32v307ethPHYRegRead(uint32_t reg) +static int ch32v307ethPHYRegRead( uint32_t reg ) { - ETH->MACMIIAR = ETH_MACMIIAR_CR_Div42 /* = 0, per 27.1.8.1.4 */ | - ((uint32_t)CH32V307GIGABIT_PHYADDRESS << 11) | // ETH_MACMIIAR_PA - (((uint32_t)reg << 6) & ETH_MACMIIAR_MR) | - (0 /*!ETH_MACMIIAR_MW*/) | ETH_MACMIIAR_MB; + ETH->MACMIIAR = ETH_MACMIIAR_CR_Div42 /* = 0, per 27.1.8.1.4 */ | + ((uint32_t)CH32V307GIGABIT_PHYADDRESS << 11) | // ETH_MACMIIAR_PA + (((uint32_t)reg << 6) & ETH_MACMIIAR_MR) | + (0 /*!ETH_MACMIIAR_MW*/) | ETH_MACMIIAR_MB; - uint32_t timeout = 0x100000; - while ((ETH->MACMIIAR & ETH_MACMIIAR_MB) && --timeout) - ; + uint32_t timeout = 0x100000; + while( ( ETH->MACMIIAR & ETH_MACMIIAR_MB ) && --timeout ); - // If timeout = 0, is an error. - return timeout ? ETH->MACMIIDR : -1; + // If timeout = 0, is an error. + return timeout ? ETH->MACMIIDR : -1; } -static void ch32v307ethGetMacInUC(uint8_t *mac) + +static void ch32v307ethGetMacInUC( uint8_t * mac ) { - // Mac is backwards. - const uint8_t *macaddr = (const uint8_t *)(ROM_CFG_USERADR_ID + 5); - for (int i = 0; i < 6; i++) - { - mac[i] = *(macaddr--); - } + // Mac is backwards. + const uint8_t *macaddr = (const uint8_t *)(ROM_CFG_USERADR_ID+5); + for( int i = 0; i < 6; i++ ) + { + mac[i] = *(macaddr--); + } } -static int ch32v307ethInit(void) +static int ch32v307ethInit( void ) { - int i; + int i; #ifdef CH32V307GIGABIT_PHY_RSTB - funPinMode(CH32V307GIGABIT_PHY_RSTB, GPIO_CFGLR_OUT_50Mhz_PP); // PHY_RSTB (For reset) - funDigitalWrite(CH32V307GIGABIT_PHY_RSTB, FUN_LOW); + funPinMode( CH32V307GIGABIT_PHY_RSTB, GPIO_CFGLR_OUT_50Mhz_PP ); //PHY_RSTB (For reset) + funDigitalWrite( CH32V307GIGABIT_PHY_RSTB, FUN_LOW ); #endif - // Configure strapping. - funPinMode(PA1, GPIO_CFGLR_IN_PUPD); // GMII_RXD3 - funPinMode(PA0, GPIO_CFGLR_IN_PUPD); // GMII_RXD2 - funPinMode(PC3, GPIO_CFGLR_IN_PUPD); // GMII_RXD1 - funPinMode(PC2, GPIO_CFGLR_IN_PUPD); // GMII_RXD0 - funDigitalWrite(PA1, FUN_HIGH); - funDigitalWrite(PA0, FUN_HIGH); - funDigitalWrite(PC3, FUN_HIGH); // No TX Delay - funDigitalWrite(PC2, FUN_HIGH); + // Configure strapping. + funPinMode( PA1, GPIO_CFGLR_IN_PUPD ); // GMII_RXD3 + funPinMode( PA0, GPIO_CFGLR_IN_PUPD ); // GMII_RXD2 + funPinMode( PC3, GPIO_CFGLR_IN_PUPD ); // GMII_RXD1 + funPinMode( PC2, GPIO_CFGLR_IN_PUPD ); // GMII_RXD0 + funDigitalWrite( PA1, FUN_HIGH ); + funDigitalWrite( PA0, FUN_HIGH ); + funDigitalWrite( PC3, FUN_HIGH ); // No TX Delay + funDigitalWrite( PC2, FUN_HIGH ); - // Pull-up MDIO - funPinMode(PD9, GPIO_CFGLR_OUT_50Mhz_PP); // Pull-up control (DO NOT CHECK IN, ADD RESISTOR) - funDigitalWrite(PD9, FUN_HIGH); + // Pull-up MDIO + funPinMode( PD9, GPIO_CFGLR_OUT_50Mhz_PP ); //Pull-up control (DO NOT CHECK IN, ADD RESISTOR) + funDigitalWrite( PD9, FUN_HIGH ); - // Will be required later. - RCC->APB2PCENR |= RCC_APB2Periph_AFIO; + // Will be required later. + RCC->APB2PCENR |= RCC_APB2Periph_AFIO; - // https://cnlohr.github.io/microclockoptimizer/?chipSelect=ch32vx05_7%2Cd8c&HSI=1,8&HSE=0,8&PREDIV2=1,1&PLL2CLK=1,7&PLL2VCO=0,72&PLL3CLK=1,1&PLL3VCO=0,100&PREDIV1SRC=1,0&PREDIV1=1,2&PLLSRC=1,0&PLL=0,4&PLLVCO=1,144&SYSCLK=1,2& - // Clock Tree: - // 8MHz Input - // PREDIV2 = 2 (1 in register) = 4MHz - // PLL2 = 9 (7 in register) = 36MHz / PLL2VCO = 72MHz - // PLL3CLK = 12.5 (1 in register) = 50MHz = 100MHz VCO - // PREDIV1SRC = HSE (1 in register) = 8MHz - // PREDIV1 = 2 (1 in register). - // PLLSRC = PREDIV1 (0 in register) = 4MHz - // PLL = 18 (0 in register) = 72MHz - // PLLVCO = 144MHz - // SYSCLK = PLLVCO = 144MHz - // Use EXT_125M (ETH1G_SRC) + // https://cnlohr.github.io/microclockoptimizer/?chipSelect=ch32vx05_7%2Cd8c&HSI=1,8&HSE=0,8&PREDIV2=1,1&PLL2CLK=1,7&PLL2VCO=0,72&PLL3CLK=1,1&PLL3VCO=0,100&PREDIV1SRC=1,0&PREDIV1=1,2&PLLSRC=1,0&PLL=0,4&PLLVCO=1,144&SYSCLK=1,2& + // Clock Tree: + // 8MHz Input + // PREDIV2 = 2 (1 in register) = 4MHz + // PLL2 = 9 (7 in register) = 36MHz / PLL2VCO = 72MHz + // PLL3CLK = 12.5 (1 in register) = 50MHz = 100MHz VCO + // PREDIV1SRC = HSE (1 in register) = 8MHz + // PREDIV1 = 2 (1 in register). + // PLLSRC = PREDIV1 (0 in register) = 4MHz + // PLL = 18 (0 in register) = 72MHz + // PLLVCO = 144MHz + // SYSCLK = PLLVCO = 144MHz + // Use EXT_125M (ETH1G_SRC) - // Switch processor back to HSI so we don't eat dirt. - RCC->CFGR0 = (RCC->CFGR0 & ~RCC_SW) | RCC_SW_HSI; + // Switch processor back to HSI so we don't eat dirt. + RCC->CFGR0 = (RCC->CFGR0 & ~RCC_SW) | RCC_SW_HSI; - // Setup clock tree. - RCC->CFGR2 |= - (1 << RCC_PREDIV2_OFFSET) | // PREDIV = /2; Prediv Freq = 4MHz - (1 << RCC_PLL3MUL_OFFSET) | // PLL3 = x12.5 (PLL3 = 50MHz) - (2 << RCC_ETH1GSRC_OFFSET) | // External source for RGMII - (7 << RCC_PLL2MUL_OFFSET) | // PLL2 = x9 (PLL2 = 36MHz) - (1 << RCC_PREDIV1_OFFSET) | // PREDIV1 = /2; Prediv freq = 50MHz - 0; + // Setup clock tree. + RCC->CFGR2 |= + (1<CTLR |= RCC_PLL3ON | RCC_PLL2ON; - int timeout; + // Power on PLLs + RCC->CTLR |= RCC_PLL3ON | RCC_PLL2ON; + int timeout; - for (timeout = 10000; timeout > 0; timeout--) - if (RCC->CTLR & RCC_PLL3RDY) break; - if (timeout == 0) return -5; - for (timeout = 10000; timeout > 0; timeout--) - if (RCC->CTLR & RCC_PLL2RDY) break; - if (timeout == 0) return -6; + for( timeout = 10000; timeout > 0; timeout--) if (RCC->CTLR & RCC_PLL3RDY) break; + if( timeout == 0 ) return -5; + for( timeout = 10000; timeout > 0; timeout--) if (RCC->CTLR & RCC_PLL2RDY) break; + if( timeout == 0 ) return -6; - // PLL = x18 (0 in register) - RCC->CFGR0 = (RCC->CFGR0 & ~(0xf << 18)) | 0; - RCC->CTLR |= RCC_PLLON; + // PLL = x18 (0 in register) + RCC->CFGR0 = ( RCC->CFGR0 & ~(0xf<<18)) | 0; + RCC->CTLR |= RCC_PLLON; - for (timeout = 10000; timeout > 0; timeout--) - if (RCC->CTLR & RCC_PLLRDY) break; - if (timeout == 0) return -7; + for( timeout = 10000; timeout > 0; timeout--) if (RCC->CTLR & RCC_PLLRDY) break; + if( timeout == 0 ) return -7; - // Switch to PLL. + // Switch to PLL. #ifdef CH32V307GIGABIT_MCO25 - RCC->CFGR0 = (RCC->CFGR0 & ~RCC_SW) | RCC_SW_PLL | (9 << 24); // And output clock on PA8 + RCC->CFGR0 = (RCC->CFGR0 & ~RCC_SW) | RCC_SW_PLL | (9<<24); // And output clock on PA8 #else - RCC->CFGR0 = (RCC->CFGR0 & ~RCC_SW) | RCC_SW_PLL; + RCC->CFGR0 = (RCC->CFGR0 & ~RCC_SW) | RCC_SW_PLL; #endif - // For clock in. - funPinMode(PB1, GPIO_CFGLR_IN_FLOAT); // GMII_CLK125 + // For clock in. + funPinMode( PB1, GPIO_CFGLR_IN_FLOAT ); //GMII_CLK125 - RCC->CFGR2 |= RCC_ETH1G_125M_EN; // Enable 125MHz clock. + RCC->CFGR2 |= RCC_ETH1G_125M_EN; // Enable 125MHz clock. - // Power on and reset. - RCC->AHBPCENR |= RCC_ETHMACEN | RCC_ETHMACTXEN | RCC_ETHMACRXEN; - RCC->AHBRSTR |= RCC_ETHMACRST; - RCC->AHBRSTR &= ~RCC_ETHMACRST; + // Power on and reset. + RCC->AHBPCENR |= RCC_ETHMACEN | RCC_ETHMACTXEN | RCC_ETHMACRXEN; + RCC->AHBRSTR |= RCC_ETHMACRST; + RCC->AHBRSTR &=~RCC_ETHMACRST; - ETH->DMABMR |= ETH_DMABMR_SR; + ETH->DMABMR |= ETH_DMABMR_SR; - // Wait for reset to complete. - for (timeout = 10000; timeout > 0 && (ETH->DMABMR & ETH_DMABMR_SR); timeout--) - { - Delay_Us(10); - } + // Wait for reset to complete. + for( timeout = 10000; timeout > 0 && (ETH->DMABMR & ETH_DMABMR_SR); timeout-- ) + { + Delay_Us(10); + } - // Use RGMII - EXTEN->EXTEN_CTR |= EXTEN_ETH_RGMII_SEL; // EXTEN_ETH_RGMII_SEL; + // Use RGMII + EXTEN->EXTEN_CTR |= EXTEN_ETH_RGMII_SEL; //EXTEN_ETH_RGMII_SEL; - funPinMode(PB13, GPIO_CFGLR_OUT_50Mhz_AF_PP); // GMII_MDIO - funPinMode(PB12, GPIO_CFGLR_OUT_50Mhz_AF_PP); // GMII_MDC + funPinMode( PB13, GPIO_CFGLR_OUT_50Mhz_AF_PP ); //GMII_MDIO + funPinMode( PB12, GPIO_CFGLR_OUT_50Mhz_AF_PP ); //GMII_MDC - // For clock output to Ethernet module. - funPinMode(PA8, GPIO_CFGLR_OUT_50Mhz_AF_PP); // PHY_CKTAL + // For clock output to Ethernet module. + funPinMode( PA8, GPIO_CFGLR_OUT_50Mhz_AF_PP ); // PHY_CKTAL - // Release PHY from reset. + // Release PHY from reset. #ifdef CH32V307GIGABIT_PHY_RSTB - funDigitalWrite(CH32V307GIGABIT_PHY_RSTB, FUN_HIGH); + funDigitalWrite( CH32V307GIGABIT_PHY_RSTB, FUN_HIGH ); #endif - Delay_Ms(25); // Waiting for PHY to exit sleep. This is inconsistent at 23ms (But only on the RTL8211FS) None is needed on the RTL8211E + Delay_Ms(25); // Waiting for PHY to exit sleep. This is inconsistent at 23ms (But only on the RTL8211FS) None is needed on the RTL8211E - funPinMode(PB0, GPIO_CFGLR_OUT_50Mhz_AF_PP); // GMII_TXD3 - funPinMode(PC5, GPIO_CFGLR_OUT_50Mhz_AF_PP); // GMII_TXD2 - funPinMode(PC4, GPIO_CFGLR_OUT_50Mhz_AF_PP); // GMII_TXD1 - funPinMode(PA7, GPIO_CFGLR_OUT_50Mhz_AF_PP); // GMII_TXD0 - funPinMode(PA3, GPIO_CFGLR_OUT_50Mhz_AF_PP); // GMII_TXCTL - funPinMode(PA2, GPIO_CFGLR_OUT_50Mhz_AF_PP); // GMII_TXC - funPinMode(PA1, GPIO_CFGLR_IN_PUPD); // GMII_RXD3 - funPinMode(PA0, GPIO_CFGLR_IN_PUPD); // GMII_RXD2 - funPinMode(PC3, GPIO_CFGLR_IN_PUPD); // GMII_RXD1 - funPinMode(PC2, GPIO_CFGLR_IN_PUPD); // GMII_RXD0 - funPinMode(PC1, GPIO_CFGLR_IN_PUPD); // GMII_RXCTL - funPinMode(PC0, GPIO_CFGLR_IN_FLOAT); // GMII_RXC + funPinMode( PB0, GPIO_CFGLR_OUT_50Mhz_AF_PP ); // GMII_TXD3 + funPinMode( PC5, GPIO_CFGLR_OUT_50Mhz_AF_PP ); // GMII_TXD2 + funPinMode( PC4, GPIO_CFGLR_OUT_50Mhz_AF_PP ); // GMII_TXD1 + funPinMode( PA7, GPIO_CFGLR_OUT_50Mhz_AF_PP ); // GMII_TXD0 + funPinMode( PA3, GPIO_CFGLR_OUT_50Mhz_AF_PP ); // GMII_TXCTL + funPinMode( PA2, GPIO_CFGLR_OUT_50Mhz_AF_PP ); // GMII_TXC + funPinMode( PA1, GPIO_CFGLR_IN_PUPD ); // GMII_RXD3 + funPinMode( PA0, GPIO_CFGLR_IN_PUPD ); // GMII_RXD2 + funPinMode( PC3, GPIO_CFGLR_IN_PUPD ); // GMII_RXD1 + funPinMode( PC2, GPIO_CFGLR_IN_PUPD ); // GMII_RXD0 + funPinMode( PC1, GPIO_CFGLR_IN_PUPD ); // GMII_RXCTL + funPinMode( PC0, GPIO_CFGLR_IN_FLOAT ); // GMII_RXC - funDigitalWrite(PA1, FUN_HIGH); // SELGRV = 3.3V - funDigitalWrite(PA0, FUN_HIGH); // TXDelay = 1 - funDigitalWrite(PC3, FUN_HIGH); // AN[0] = 1 - funDigitalWrite(PC2, FUN_HIGH); // AN[1] = 1 - funDigitalWrite(PC1, FUN_LOW); // PHYAD[0] + funDigitalWrite( PA1, FUN_HIGH ); // SELGRV = 3.3V + funDigitalWrite( PA0, FUN_HIGH ); // TXDelay = 1 + funDigitalWrite( PC3, FUN_HIGH ); // AN[0] = 1 + funDigitalWrite( PC2, FUN_HIGH ); // AN[1] = 1 + funDigitalWrite( PC1, FUN_LOW ); // PHYAD[0] - // Configure MDC/MDIO - // Conflicting notes - some say /42, others don't. - ETH->MACMIIAR = ETH_MACMIIAR_CR_Div42; + // Configure MDC/MDIO + // Conflicting notes - some say /42, others don't. + ETH->MACMIIAR = ETH_MACMIIAR_CR_Div42; - // Update MACCR - ETH->MACCR = - (CH32V307GIGABIT_CFG_CLOCK_DELAY << 29) | // No clock delay - (0 << 23) | // Max RX = 2kB (Revisit if looking into jumbo frames) - (0 << 22) | // Max TX = 2kB (Revisit if looking into jumbo frames) - (0 << 21) | // Rated Drive (instead of energy savings mode) (10M PHY only) - (1 << 20) | // Bizarre re-use of termination resistor terminology? (10M PHY Only) - (0 << 17) | // IFG = 0, 96-bit guard time. - (0 << 14) | // FES = 2 = GBE, 1=100MBit/s (UNSET TO START) - (0 << 12) | // Self Loop = 0 - (0 << 11) | // Full-Duplex Mode (UNSET TO START) - (1 << 10) | // IPCO = 1, Check TCP, UDP, ICMP header checksums. - (1 << 7) | // APCS (automatically strip frames) - (1 << 3) | // TE (Transmit enable!) - (1 << 2) | // RE (Receive Enable) - (CH32V307GIGABIT_CFG_CLOCK_PHASE << 1) | // TCF = 0 (Potentailly change if clocking is wrong) - 0; + // Update MACCR + ETH->MACCR = + ( CH32V307GIGABIT_CFG_CLOCK_DELAY << 29 ) | // No clock delay + ( 0 << 23 ) | // Max RX = 2kB (Revisit if looking into jumbo frames) + ( 0 << 22 ) | // Max TX = 2kB (Revisit if looking into jumbo frames) + ( 0 << 21 ) | // Rated Drive (instead of energy savings mode) (10M PHY only) + ( 1 << 20 ) | // Bizarre re-use of termination resistor terminology? (10M PHY Only) + ( 0 << 17 ) | // IFG = 0, 96-bit guard time. + ( 0 << 14 ) | // FES = 2 = GBE, 1=100MBit/s (UNSET TO START) + ( 0 << 12 ) | // Self Loop = 0 + ( 0 << 11 ) | // Full-Duplex Mode (UNSET TO START) + ( 1 << 10 ) | // IPCO = 1, Check TCP, UDP, ICMP header checksums. + ( 1 << 7 ) | // APCS (automatically strip frames) + ( 1 << 3 ) | // TE (Transmit enable!) + ( 1 << 2 ) | // RE (Receive Enable) + ( CH32V307GIGABIT_CFG_CLOCK_PHASE << 1 ) | // TCF = 0 (Potentailly change if clocking is wrong) + 0; - Delay_Ms(25); // Waiting for PHY to exit sleep. This is inconsistent at 19ms. + Delay_Ms(25); // Waiting for PHY to exit sleep. This is inconsistent at 19ms. - // Reset the physical layer - ch32v307ethPHYRegWrite(PHY_BCR, - PHY_Reset | - 1 << 12 | // Auto negotiate - 1 << 8 | // Duplex - 1 << 6 | // Speed Bit. - 0); + // Reset the physical layer + ch32v307ethPHYRegWrite( PHY_BCR, + PHY_Reset | + 1<<12 | // Auto negotiate + 1<<8 | // Duplex + 1<<6 | // Speed Bit. + 0 ); - // De-assert reset. - ch32v307ethPHYRegWrite(PHY_BCR, - 1 << 12 | // Auto negotiate - 1 << 8 | // Duplex - 1 << 6 | // Speed Bit. - 0); + // De-assert reset. + ch32v307ethPHYRegWrite( PHY_BCR, + 1<<12 | // Auto negotiate + 1<<8 | // Duplex + 1<<6 | // Speed Bit. + 0 ); - ch32v307ethPHYRegRead(0x03); - ch32v307eth_phyid = ch32v307ethPHYRegRead(0x03); // Read twice to be safe. - if (ch32v307eth_phyid == 0xc916) - ch32v307ethPHYRegWrite(0x1F, 0x0a43); // RTL8211FS needs page select. + ch32v307ethPHYRegRead( 0x03 ); + ch32v307eth_phyid = ch32v307ethPHYRegRead( 0x03 ); // Read twice to be safe. + if( ch32v307eth_phyid == 0xc916 ) + ch32v307ethPHYRegWrite( 0x1F, 0x0a43 ); // RTL8211FS needs page select. - ch32v307ethGetMacInUC(ch32v307eth_mac); + ch32v307ethGetMacInUC( ch32v307eth_mac ); - ETH->MACA0HR = (uint32_t)((ch32v307eth_mac[5] << 8) | ch32v307eth_mac[4]); - ETH->MACA0LR = (uint32_t)(ch32v307eth_mac[0] | (ch32v307eth_mac[1] << 8) | (ch32v307eth_mac[2] << 16) | (ch32v307eth_mac[3] << 24)); + ETH->MACA0HR = (uint32_t)((ch32v307eth_mac[5]<<8) | ch32v307eth_mac[4]); + ETH->MACA0LR = (uint32_t)(ch32v307eth_mac[0] | (ch32v307eth_mac[1]<<8) | (ch32v307eth_mac[2]<<16) | (ch32v307eth_mac[3]<<24)); - ETH->MACFFR = (uint32_t)(ETH_ReceiveAll_Disable | - ETH_SourceAddrFilter_Disable | - ETH_PassControlFrames_BlockAll | - ETH_BroadcastFramesReception_Enable | - ETH_DestinationAddrFilter_Normal | - ETH_PromiscuousMode_Disable | - ETH_MulticastFramesFilter_Perfect | - ETH_UnicastFramesFilter_Perfect); + ETH->MACFFR = (uint32_t)(ETH_ReceiveAll_Disable | + ETH_SourceAddrFilter_Disable | + ETH_PassControlFrames_BlockAll | + ETH_BroadcastFramesReception_Enable | + ETH_DestinationAddrFilter_Normal | + ETH_PromiscuousMode_Disable | + ETH_MulticastFramesFilter_Perfect | + ETH_UnicastFramesFilter_Perfect); - ETH->MACHTHR = (uint32_t)0; - ETH->MACHTLR = (uint32_t)0; - ETH->MACVLANTR = (uint32_t)(ETH_VLANTagComparison_16Bit); + ETH->MACHTHR = (uint32_t)0; + ETH->MACHTLR = (uint32_t)0; + ETH->MACVLANTR = (uint32_t)(ETH_VLANTagComparison_16Bit); - ETH->MACFCR = 0; // No pause frames. + ETH->MACFCR = 0; // No pause frames. - // Configure RX/TX chains. - ETH_DMADESCTypeDef *tdesc; - for (i = 0; i < CH32V307GIGABIT_TXBUFNB; i++) - { - tdesc = ch32v307eth_DMATxDscrTab + i; - tdesc->ControlBufferSize = 0; - tdesc->Status = ETH_DMATxDesc_TCH | ETH_DMATxDesc_IC | ETH_DMATxDesc_FS; - tdesc->Buffer1Addr = (uint32_t)0; // Populate with data. - tdesc->Buffer2NextDescAddr = (i < CH32V307GIGABIT_TXBUFNB - 1) ? ((uint32_t)(ch32v307eth_DMATxDscrTab + i + 1)) : (uint32_t)ch32v307eth_DMATxDscrTab; - } - ETH->DMATDLAR = (uint32_t)ch32v307eth_DMATxDscrTab; - for (i = 0; i < CH32V307GIGABIT_RXBUFNB; i++) - { - tdesc = ch32v307eth_DMARxDscrTab + i; - tdesc->Status = ETH_DMARxDesc_OWN; - tdesc->ControlBufferSize = ETH_DMARxDesc_RCH | (uint32_t)CH32V307GIGABIT_BUFFSIZE; - tdesc->Buffer1Addr = (uint32_t)(&ch32v307eth_MACRxBuf[i * CH32V307GIGABIT_BUFFSIZE]); - tdesc->Buffer2NextDescAddr = (i < CH32V307GIGABIT_RXBUFNB - 1) ? (uint32_t)(ch32v307eth_DMARxDscrTab + i + 1) : (uint32_t)(ch32v307eth_DMARxDscrTab); - } - ETH->DMARDLAR = (uint32_t)ch32v307eth_DMARxDscrTab; + // Configure RX/TX chains. + ETH_DMADESCTypeDef *tdesc; + for(i = 0; i < CH32V307GIGABIT_TXBUFNB; i++) + { + tdesc = ch32v307eth_DMATxDscrTab + i; + tdesc->ControlBufferSize = 0; + tdesc->Status = ETH_DMATxDesc_TCH | ETH_DMATxDesc_IC | ETH_DMATxDesc_FS; + tdesc->Buffer1Addr = (uint32_t)0; // Populate with data. + tdesc->Buffer2NextDescAddr = (i < CH32V307GIGABIT_TXBUFNB - 1) ? ((uint32_t)(ch32v307eth_DMATxDscrTab + i + 1)) : (uint32_t)ch32v307eth_DMATxDscrTab; + } + ETH->DMATDLAR = (uint32_t)ch32v307eth_DMATxDscrTab; + for(i = 0; i < CH32V307GIGABIT_RXBUFNB; i++) + { + tdesc = ch32v307eth_DMARxDscrTab + i; + tdesc->Status = ETH_DMARxDesc_OWN; + tdesc->ControlBufferSize = ETH_DMARxDesc_RCH | (uint32_t)CH32V307GIGABIT_BUFFSIZE; + tdesc->Buffer1Addr = (uint32_t)(&ch32v307eth_MACRxBuf[i * CH32V307GIGABIT_BUFFSIZE]); + tdesc->Buffer2NextDescAddr = (i < CH32V307GIGABIT_RXBUFNB - 1) ? (uint32_t)(ch32v307eth_DMARxDscrTab + i + 1) : (uint32_t)(ch32v307eth_DMARxDscrTab); + } + ETH->DMARDLAR = (uint32_t)ch32v307eth_DMARxDscrTab; - pDMARxGet = ch32v307eth_DMARxDscrTab; - pDMATxSet = ch32v307eth_DMATxDscrTab; + pDMARxGet = ch32v307eth_DMARxDscrTab; + pDMATxSet = ch32v307eth_DMATxDscrTab; - // Receive a good frame half interrupt mask. - // Receive CRC error frame half interrupt mask. - // For the future: Why do we want this? - ETH->MMCTIMR = ETH_MMCTIMR_TGFM; - ETH->MMCRIMR = ETH_MMCRIMR_RGUFM | ETH_MMCRIMR_RFCEM; + // Receive a good frame half interrupt mask. + // Receive CRC error frame half interrupt mask. + // For the future: Why do we want this? + ETH->MMCTIMR = ETH_MMCTIMR_TGFM; + ETH->MMCRIMR = ETH_MMCRIMR_RGUFM | ETH_MMCRIMR_RFCEM; - ETH->DMAIER = ETH_DMA_IT_NIS | // Normal interrupt enable. - ETH_DMA_IT_R | // Receive - ETH_DMA_IT_T | // Transmit - ETH_DMA_IT_AIS | // Abnormal interrupt - ETH_DMA_IT_RBU; // Receive buffer unavailable interrupt enable + ETH->DMAIER = ETH_DMA_IT_NIS | // Normal interrupt enable. + ETH_DMA_IT_R | // Receive + ETH_DMA_IT_T | // Transmit + ETH_DMA_IT_AIS | // Abnormal interrupt + ETH_DMA_IT_RBU; // Receive buffer unavailable interrupt enable - NVIC_EnableIRQ(ETH_IRQn); + NVIC_EnableIRQ( ETH_IRQn ); - // Actually enable receiving process. - ETH->DMAOMR = ETH_DMAOMR_SR | ETH_DMAOMR_ST | ETH_DMAOMR_TSF | ETH_DMAOMR_FEF; + // Actually enable receiving process. + ETH->DMAOMR = ETH_DMAOMR_SR | ETH_DMAOMR_ST | ETH_DMAOMR_TSF | ETH_DMAOMR_FEF; - return 0; + return 0; } -void ETH_IRQHandler(void) __attribute__((interrupt)); -void ETH_IRQHandler(void) +void ETH_IRQHandler( void ) __attribute__((interrupt)); +void ETH_IRQHandler( void ) { uint32_t int_sta; - do - { - int_sta = ETH->DMASR; - if ((int_sta & (ETH_DMA_IT_AIS | ETH_DMA_IT_NIS)) == 0) - { - break; - } + do + { + int_sta = ETH->DMASR; + if ( ( int_sta & ( ETH_DMA_IT_AIS | ETH_DMA_IT_NIS ) ) == 0 ) + { + break; + } - // Off nominal situations. - if (int_sta & ETH_DMA_IT_AIS) - { - // Receive buffer unavailable interrupt enable. - if (int_sta & ETH_DMA_IT_RBU) - { - ETH->DMASR = ETH_DMA_IT_RBU; - if ((INFO->CHIPID & 0xf0) == 0x10) - { - ((ETH_DMADESCTypeDef *)(((ETH_DMADESCTypeDef *)(ETH->DMACHRDR))->Buffer2NextDescAddr))->Status = ETH_DMARxDesc_OWN; - ETH->DMARPDR = 0; - } - } - ETH->DMASR = ETH_DMA_IT_AIS; - } + // Off nominal situations. + if (int_sta & ETH_DMA_IT_AIS) + { + // Receive buffer unavailable interrupt enable. + if (int_sta & ETH_DMA_IT_RBU) + { + ETH->DMASR = ETH_DMA_IT_RBU; + if((INFO->CHIPID & 0xf0) == 0x10) + { + ((ETH_DMADESCTypeDef *)(((ETH_DMADESCTypeDef *)(ETH->DMACHRDR))->Buffer2NextDescAddr))->Status = ETH_DMARxDesc_OWN; + ETH->DMARPDR = 0; + } + } + ETH->DMASR = ETH_DMA_IT_AIS; + } - // Nominal interrupts. - if (int_sta & ETH_DMA_IT_NIS) - { - if (int_sta & ETH_DMA_IT_R) - { - // Received a packet, normally. - // Status is in Table 27-17 Definitions of RDes0 - do - { - // XXX TODO: Is this a good place to acknowledge? REVISIT: Should this go lower? - // XXX TODO: Restructure this to allow for - ETH->DMASR = ETH_DMA_IT_R; + // Nominal interrupts. + if( int_sta & ETH_DMA_IT_NIS ) + { + if( int_sta & ETH_DMA_IT_R ) + { + // Received a packet, normally. + // Status is in Table 27-17 Definitions of RDes0 + do + { + // XXX TODO: Is this a good place to acknowledge? REVISIT: Should this go lower? + // XXX TODO: Restructure this to allow for + ETH->DMASR = ETH_DMA_IT_R; - uint32_t status = pDMARxGet->Status; - if (status & ETH_DMARxDesc_OWN) break; + uint32_t status = pDMARxGet->Status; + if( status & ETH_DMARxDesc_OWN ) break; - // We only have a valid packet in a specific situation. - // So, we take the status, then mask off the bits we care about - // And see if they're equal to the ones that need to be set/unset. - const uint32_t mask = - ETH_DMARxDesc_OWN | - ETH_DMARxDesc_LS | - ETH_DMARxDesc_ES | - ETH_DMARxDesc_FS; - const uint32_t eq = - 0 | - ETH_DMARxDesc_LS | - 0 | - ETH_DMARxDesc_FS; + // We only have a valid packet in a specific situation. + // So, we take the status, then mask off the bits we care about + // And see if they're equal to the ones that need to be set/unset. + const uint32_t mask = + ETH_DMARxDesc_OWN | + ETH_DMARxDesc_LS | + ETH_DMARxDesc_ES | + ETH_DMARxDesc_FS; + const uint32_t eq = + 0 | + ETH_DMARxDesc_LS | + 0 | + ETH_DMARxDesc_FS; - int suppress_own = 0; + int suppress_own = 0; - if ((status & mask) == eq) - { - int32_t frame_length = ((status & ETH_DMARxDesc_FL) >> ETH_DMARXDESC_FRAME_LENGTHSHIFT) - 4; - if (frame_length > 0) - { - uint8_t *data = (uint8_t *)pDMARxGet->Buffer1Addr; - suppress_own = ch32v307ethInitHandlePacket(data, frame_length, pDMARxGet); - } - } - // Otherwise, Invalid Packet + if( ( status & mask ) == eq ) + { + int32_t frame_length = ((status & ETH_DMARxDesc_FL) >> ETH_DMARXDESC_FRAME_LENGTHSHIFT) - 4; + if( frame_length > 0 ) + { + uint8_t * data = (uint8_t*)pDMARxGet->Buffer1Addr; + suppress_own = ch32v307ethInitHandlePacket( data, frame_length, pDMARxGet ); + } + } + // Otherwise, Invalid Packet - // Relinquish control back to underlying hardware. - if (!suppress_own) - pDMARxGet->Status = ETH_DMARxDesc_OWN; + // Relinquish control back to underlying hardware. + if( !suppress_own ) + pDMARxGet->Status = ETH_DMARxDesc_OWN; - // Tricky logic for figuring out the next packet. Originally - // discussed in ch32v30x_eth.c in ETH_DropRxPkt - if ((pDMARxGet->ControlBufferSize & ETH_DMARxDesc_RCH) != (uint32_t)RESET) - pDMARxGet = (ETH_DMADESCTypeDef *)(pDMARxGet->Buffer2NextDescAddr); - else - { - if ((pDMARxGet->ControlBufferSize & ETH_DMARxDesc_RER) != (uint32_t)RESET) - pDMARxGet = (ETH_DMADESCTypeDef *)(ETH->DMARDLAR); - else - pDMARxGet = (ETH_DMADESCTypeDef *)((uint32_t)pDMARxGet + 0x10 + ((ETH->DMABMR & ETH_DMABMR_DSL) >> 2)); - } - } while (1); - } - if (int_sta & ETH_DMA_IT_T) - { - ch32v307ethInitHandleTXC(); - ETH->DMASR = ETH_DMA_IT_T; - } - ETH->DMASR = ETH_DMA_IT_NIS; - } - } while (1); + // Tricky logic for figuring out the next packet. Originally + // discussed in ch32v30x_eth.c in ETH_DropRxPkt + if((pDMARxGet->ControlBufferSize & ETH_DMARxDesc_RCH) != (uint32_t)RESET) + pDMARxGet = (ETH_DMADESCTypeDef *)(pDMARxGet->Buffer2NextDescAddr); + else + { + if((pDMARxGet->ControlBufferSize & ETH_DMARxDesc_RER) != (uint32_t)RESET) + pDMARxGet = (ETH_DMADESCTypeDef *)(ETH->DMARDLAR); + else + pDMARxGet = (ETH_DMADESCTypeDef *)((uint32_t)pDMARxGet + 0x10 + ((ETH->DMABMR & ETH_DMABMR_DSL) >> 2)); + } + } while( 1 ); + } + if( int_sta & ETH_DMA_IT_T ) + { + ch32v307ethInitHandleTXC(); + ETH->DMASR = ETH_DMA_IT_T; + } + ETH->DMASR = ETH_DMA_IT_NIS; + } + } while( 1 ); } -static int ch32v307ethTransmitStatic(uint8_t *buffer, uint32_t length, int enable_txc) +static int ch32v307ethTransmitStatic(uint8_t * buffer, uint32_t length, int enable_txc) { - // The official SDK waits until ETH_DMATxDesc_TTSS is set. - // This also provides a transmit timestamp, which could be - // used for PTP. - // But we don't want to do that. - // We just want to go. If anyone cares, they can check later. + // The official SDK waits until ETH_DMATxDesc_TTSS is set. + // This also provides a transmit timestamp, which could be + // used for PTP. + // But we don't want to do that. + // We just want to go. If anyone cares, they can check later. - if (pDMATxSet->Status & ETH_DMATxDesc_OWN) - { - ETH->DMATPDR = 0; - return -1; - } + if( pDMATxSet->Status & ETH_DMATxDesc_OWN ) + { + ETH->DMATPDR = 0; + return -1; + } pDMATxSet->ControlBufferSize = (length & ETH_DMATxDesc_TBS1); - pDMATxSet->Buffer1Addr = (uint32_t)buffer; + pDMATxSet->Buffer1Addr = (uint32_t)buffer; - // Status is in Table 27-12 "Definitions of TDes0 bits" - enable_txc = enable_txc ? ETH_DMATxDesc_IC : 0; - pDMATxSet->Status = - ETH_DMATxDesc_LS | // Last Segment (This is all you need to have to transmit) - ETH_DMATxDesc_FS | // First Segment (Beginning of transmission) - enable_txc | // Interrupt when complete - ETH_DMATxDesc_TCH | // Next Descriptor Address Valid - ETH_DMATxDesc_CIC_TCPUDPICMP_Full | // Do all header checksums. - ETH_DMATxDesc_OWN; // Own back to hardware + // Status is in Table 27-12 "Definitions of TDes0 bits" + enable_txc = enable_txc ? ETH_DMATxDesc_IC : 0; + pDMATxSet->Status = + ETH_DMATxDesc_LS | // Last Segment (This is all you need to have to transmit) + ETH_DMATxDesc_FS | // First Segment (Beginning of transmission) + enable_txc | // Interrupt when complete + ETH_DMATxDesc_TCH | // Next Descriptor Address Valid + ETH_DMATxDesc_CIC_TCPUDPICMP_Full | // Do all header checksums. + ETH_DMATxDesc_OWN; // Own back to hardware - pDMATxSet = (ETH_DMADESCTypeDef *)pDMATxSet->Buffer2NextDescAddr; + pDMATxSet = (ETH_DMADESCTypeDef*)pDMATxSet->Buffer2NextDescAddr; - ETH->DMASR = ETH_DMASR_TBUS; // This resets the transmit process (or "starts" it) - ETH->DMATPDR = 0; + ETH->DMASR = ETH_DMASR_TBUS; // This resets the transmit process (or "starts" it) + ETH->DMATPDR = 0; - return 0; + return 0; } + #endif + diff --git a/src/extralibs/font_8x8.h b/src/extralibs/font_8x8.h index 4cf7511..815d5b2 100644 --- a/src/extralibs/font_8x8.h +++ b/src/extralibs/font_8x8.h @@ -6,2564 +6,2564 @@ const static unsigned char fontdata[] = { - /* 0 0x00 '^@' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 1 0x01 '^A' */ - 0x7e, /* 01111110 */ - 0x81, /* 10000001 */ - 0xa5, /* 10100101 */ - 0x81, /* 10000001 */ - 0xbd, /* 10111101 */ - 0x99, /* 10011001 */ - 0x81, /* 10000001 */ - 0x7e, /* 01111110 */ - - /* 2 0x02 '^B' */ - 0x7e, /* 01111110 */ - 0xff, /* 11111111 */ - 0xdb, /* 11011011 */ - 0xff, /* 11111111 */ - 0xc3, /* 11000011 */ - 0xe7, /* 11100111 */ - 0xff, /* 11111111 */ - 0x7e, /* 01111110 */ - - /* 3 0x03 '^C' */ - 0x6c, /* 01101100 */ - 0xfe, /* 11111110 */ - 0xfe, /* 11111110 */ - 0xfe, /* 11111110 */ - 0x7c, /* 01111100 */ - 0x38, /* 00111000 */ - 0x10, /* 00010000 */ - 0x00, /* 00000000 */ - - /* 4 0x04 '^D' */ - 0x10, /* 00010000 */ - 0x38, /* 00111000 */ - 0x7c, /* 01111100 */ - 0xfe, /* 11111110 */ - 0x7c, /* 01111100 */ - 0x38, /* 00111000 */ - 0x10, /* 00010000 */ - 0x00, /* 00000000 */ - - /* 5 0x05 '^E' */ - 0x38, /* 00111000 */ - 0x7c, /* 01111100 */ - 0x38, /* 00111000 */ - 0xfe, /* 11111110 */ - 0xfe, /* 11111110 */ - 0xd6, /* 11010110 */ - 0x10, /* 00010000 */ - 0x38, /* 00111000 */ - - /* 6 0x06 '^F' */ - 0x10, /* 00010000 */ - 0x38, /* 00111000 */ - 0x7c, /* 01111100 */ - 0xfe, /* 11111110 */ - 0xfe, /* 11111110 */ - 0x7c, /* 01111100 */ - 0x10, /* 00010000 */ - 0x38, /* 00111000 */ - - /* 7 0x07 '^G' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x3c, /* 00111100 */ - 0x3c, /* 00111100 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 8 0x08 '^H' */ - 0xff, /* 11111111 */ - 0xff, /* 11111111 */ - 0xe7, /* 11100111 */ - 0xc3, /* 11000011 */ - 0xc3, /* 11000011 */ - 0xe7, /* 11100111 */ - 0xff, /* 11111111 */ - 0xff, /* 11111111 */ - - /* 9 0x09 '^I' */ - 0x00, /* 00000000 */ - 0x3c, /* 00111100 */ - 0x66, /* 01100110 */ - 0x42, /* 01000010 */ - 0x42, /* 01000010 */ - 0x66, /* 01100110 */ - 0x3c, /* 00111100 */ - 0x00, /* 00000000 */ - - /* 10 0x0a '^J' */ - 0xff, /* 11111111 */ - 0xc3, /* 11000011 */ - 0x99, /* 10011001 */ - 0xbd, /* 10111101 */ - 0xbd, /* 10111101 */ - 0x99, /* 10011001 */ - 0xc3, /* 11000011 */ - 0xff, /* 11111111 */ - - /* 11 0x0b '^K' */ - 0x0f, /* 00001111 */ - 0x07, /* 00000111 */ - 0x0f, /* 00001111 */ - 0x7d, /* 01111101 */ - 0xcc, /* 11001100 */ - 0xcc, /* 11001100 */ - 0xcc, /* 11001100 */ - 0x78, /* 01111000 */ - - /* 12 0x0c '^L' */ - 0x3c, /* 00111100 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x3c, /* 00111100 */ - 0x18, /* 00011000 */ - 0x7e, /* 01111110 */ - 0x18, /* 00011000 */ - - /* 13 0x0d '^M' */ - 0x3f, /* 00111111 */ - 0x33, /* 00110011 */ - 0x3f, /* 00111111 */ - 0x30, /* 00110000 */ - 0x30, /* 00110000 */ - 0x70, /* 01110000 */ - 0xf0, /* 11110000 */ - 0xe0, /* 11100000 */ - - /* 14 0x0e '^N' */ - 0x7f, /* 01111111 */ - 0x63, /* 01100011 */ - 0x7f, /* 01111111 */ - 0x63, /* 01100011 */ - 0x63, /* 01100011 */ - 0x67, /* 01100111 */ - 0xe6, /* 11100110 */ - 0xc0, /* 11000000 */ - - /* 15 0x0f '^O' */ - 0x18, /* 00011000 */ - 0xdb, /* 11011011 */ - 0x3c, /* 00111100 */ - 0xe7, /* 11100111 */ - 0xe7, /* 11100111 */ - 0x3c, /* 00111100 */ - 0xdb, /* 11011011 */ - 0x18, /* 00011000 */ - - /* 16 0x10 '^P' */ - 0x80, /* 10000000 */ - 0xe0, /* 11100000 */ - 0xf8, /* 11111000 */ - 0xfe, /* 11111110 */ - 0xf8, /* 11111000 */ - 0xe0, /* 11100000 */ - 0x80, /* 10000000 */ - 0x00, /* 00000000 */ - - /* 17 0x11 '^Q' */ - 0x02, /* 00000010 */ - 0x0e, /* 00001110 */ - 0x3e, /* 00111110 */ - 0xfe, /* 11111110 */ - 0x3e, /* 00111110 */ - 0x0e, /* 00001110 */ - 0x02, /* 00000010 */ - 0x00, /* 00000000 */ - - /* 18 0x12 '^R' */ - 0x18, /* 00011000 */ - 0x3c, /* 00111100 */ - 0x7e, /* 01111110 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x7e, /* 01111110 */ - 0x3c, /* 00111100 */ - 0x18, /* 00011000 */ - - /* 19 0x13 '^S' */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x00, /* 00000000 */ - 0x66, /* 01100110 */ - 0x00, /* 00000000 */ - - /* 20 0x14 '^T' */ - 0x7f, /* 01111111 */ - 0xdb, /* 11011011 */ - 0xdb, /* 11011011 */ - 0x7b, /* 01111011 */ - 0x1b, /* 00011011 */ - 0x1b, /* 00011011 */ - 0x1b, /* 00011011 */ - 0x00, /* 00000000 */ - - /* 21 0x15 '^U' */ - 0x3e, /* 00111110 */ - 0x61, /* 01100001 */ - 0x3c, /* 00111100 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x3c, /* 00111100 */ - 0x86, /* 10000110 */ - 0x7c, /* 01111100 */ - - /* 22 0x16 '^V' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x7e, /* 01111110 */ - 0x7e, /* 01111110 */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ - - /* 23 0x17 '^W' */ - 0x18, /* 00011000 */ - 0x3c, /* 00111100 */ - 0x7e, /* 01111110 */ - 0x18, /* 00011000 */ - 0x7e, /* 01111110 */ - 0x3c, /* 00111100 */ - 0x18, /* 00011000 */ - 0xff, /* 11111111 */ - - /* 24 0x18 '^X' */ - 0x18, /* 00011000 */ - 0x3c, /* 00111100 */ - 0x7e, /* 01111110 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - - /* 25 0x19 '^Y' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x7e, /* 01111110 */ - 0x3c, /* 00111100 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - - /* 26 0x1a '^Z' */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x0c, /* 00001100 */ - 0xfe, /* 11111110 */ - 0x0c, /* 00001100 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 27 0x1b '^[' */ - 0x00, /* 00000000 */ - 0x30, /* 00110000 */ - 0x60, /* 01100000 */ - 0xfe, /* 11111110 */ - 0x60, /* 01100000 */ - 0x30, /* 00110000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 28 0x1c '^\' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xc0, /* 11000000 */ - 0xc0, /* 11000000 */ - 0xc0, /* 11000000 */ - 0xfe, /* 11111110 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 29 0x1d '^]' */ - 0x00, /* 00000000 */ - 0x24, /* 00100100 */ - 0x66, /* 01100110 */ - 0xff, /* 11111111 */ - 0x66, /* 01100110 */ - 0x24, /* 00100100 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 30 0x1e '^^' */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x3c, /* 00111100 */ - 0x7e, /* 01111110 */ - 0xff, /* 11111111 */ - 0xff, /* 11111111 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 31 0x1f '^_' */ - 0x00, /* 00000000 */ - 0xff, /* 11111111 */ - 0xff, /* 11111111 */ - 0x7e, /* 01111110 */ - 0x3c, /* 00111100 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 32 0x20 ' ' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 33 0x21 '!' */ - 0x18, /* 00011000 */ - 0x3c, /* 00111100 */ - 0x3c, /* 00111100 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - - /* 34 0x22 '"' */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x24, /* 00100100 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 35 0x23 '#' */ - 0x6c, /* 01101100 */ - 0x6c, /* 01101100 */ - 0xfe, /* 11111110 */ - 0x6c, /* 01101100 */ - 0xfe, /* 11111110 */ - 0x6c, /* 01101100 */ - 0x6c, /* 01101100 */ - 0x00, /* 00000000 */ - - /* 36 0x24 '$' */ - 0x18, /* 00011000 */ - 0x3e, /* 00111110 */ - 0x60, /* 01100000 */ - 0x3c, /* 00111100 */ - 0x06, /* 00000110 */ - 0x7c, /* 01111100 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - - /* 37 0x25 '%' */ - 0x00, /* 00000000 */ - 0xc6, /* 11000110 */ - 0xcc, /* 11001100 */ - 0x18, /* 00011000 */ - 0x30, /* 00110000 */ - 0x66, /* 01100110 */ - 0xc6, /* 11000110 */ - 0x00, /* 00000000 */ - - /* 38 0x26 '&' */ - 0x38, /* 00111000 */ - 0x6c, /* 01101100 */ - 0x38, /* 00111000 */ - 0x76, /* 01110110 */ - 0xdc, /* 11011100 */ - 0xcc, /* 11001100 */ - 0x76, /* 01110110 */ - 0x00, /* 00000000 */ - - /* 39 0x27 ''' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x30, /* 00110000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 40 0x28 '(' */ - 0x0c, /* 00001100 */ - 0x18, /* 00011000 */ - 0x30, /* 00110000 */ - 0x30, /* 00110000 */ - 0x30, /* 00110000 */ - 0x18, /* 00011000 */ - 0x0c, /* 00001100 */ - 0x00, /* 00000000 */ - - /* 41 0x29 ')' */ - 0x30, /* 00110000 */ - 0x18, /* 00011000 */ - 0x0c, /* 00001100 */ - 0x0c, /* 00001100 */ - 0x0c, /* 00001100 */ - 0x18, /* 00011000 */ - 0x30, /* 00110000 */ - 0x00, /* 00000000 */ - - /* 42 0x2a '*' */ - 0x00, /* 00000000 */ - 0x66, /* 01100110 */ - 0x3c, /* 00111100 */ - 0xff, /* 11111111 */ - 0x3c, /* 00111100 */ - 0x66, /* 01100110 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 43 0x2b '+' */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x7e, /* 01111110 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 44 0x2c ',' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x30, /* 00110000 */ - - /* 45 0x2d '-' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 46 0x2e '.' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - - /* 47 0x2f '/' */ - 0x06, /* 00000110 */ - 0x0c, /* 00001100 */ - 0x18, /* 00011000 */ - 0x30, /* 00110000 */ - 0x60, /* 01100000 */ - 0xc0, /* 11000000 */ - 0x80, /* 10000000 */ - 0x00, /* 00000000 */ - - /* 48 0x30 '0' */ - 0x38, /* 00111000 */ - 0x6c, /* 01101100 */ - 0xc6, /* 11000110 */ - 0xd6, /* 11010110 */ - 0xc6, /* 11000110 */ - 0x6c, /* 01101100 */ - 0x38, /* 00111000 */ - 0x00, /* 00000000 */ - - /* 49 0x31 '1' */ - 0x18, /* 00011000 */ - 0x38, /* 00111000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ - - /* 50 0x32 '2' */ - 0x7c, /* 01111100 */ - 0xc6, /* 11000110 */ - 0x06, /* 00000110 */ - 0x1c, /* 00011100 */ - 0x30, /* 00110000 */ - 0x66, /* 01100110 */ - 0xfe, /* 11111110 */ - 0x00, /* 00000000 */ - - /* 51 0x33 '3' */ - 0x7c, /* 01111100 */ - 0xc6, /* 11000110 */ - 0x06, /* 00000110 */ - 0x3c, /* 00111100 */ - 0x06, /* 00000110 */ - 0xc6, /* 11000110 */ - 0x7c, /* 01111100 */ - 0x00, /* 00000000 */ - - /* 52 0x34 '4' */ - 0x1c, /* 00011100 */ - 0x3c, /* 00111100 */ - 0x6c, /* 01101100 */ - 0xcc, /* 11001100 */ - 0xfe, /* 11111110 */ - 0x0c, /* 00001100 */ - 0x1e, /* 00011110 */ - 0x00, /* 00000000 */ - - /* 53 0x35 '5' */ - 0xfe, /* 11111110 */ - 0xc0, /* 11000000 */ - 0xc0, /* 11000000 */ - 0xfc, /* 11111100 */ - 0x06, /* 00000110 */ - 0xc6, /* 11000110 */ - 0x7c, /* 01111100 */ - 0x00, /* 00000000 */ - - /* 54 0x36 '6' */ - 0x38, /* 00111000 */ - 0x60, /* 01100000 */ - 0xc0, /* 11000000 */ - 0xfc, /* 11111100 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x7c, /* 01111100 */ - 0x00, /* 00000000 */ - - /* 55 0x37 '7' */ - 0xfe, /* 11111110 */ - 0xc6, /* 11000110 */ - 0x0c, /* 00001100 */ - 0x18, /* 00011000 */ - 0x30, /* 00110000 */ - 0x30, /* 00110000 */ - 0x30, /* 00110000 */ - 0x00, /* 00000000 */ - - /* 56 0x38 '8' */ - 0x7c, /* 01111100 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x7c, /* 01111100 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x7c, /* 01111100 */ - 0x00, /* 00000000 */ - - /* 57 0x39 '9' */ - 0x7c, /* 01111100 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x7e, /* 01111110 */ - 0x06, /* 00000110 */ - 0x0c, /* 00001100 */ - 0x78, /* 01111000 */ - 0x00, /* 00000000 */ - - /* 58 0x3a ':' */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - - /* 59 0x3b ';' */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x30, /* 00110000 */ - - /* 60 0x3c '<' */ - 0x06, /* 00000110 */ - 0x0c, /* 00001100 */ - 0x18, /* 00011000 */ - 0x30, /* 00110000 */ - 0x18, /* 00011000 */ - 0x0c, /* 00001100 */ - 0x06, /* 00000110 */ - 0x00, /* 00000000 */ - - /* 61 0x3d '=' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 62 0x3e '>' */ - 0x60, /* 01100000 */ - 0x30, /* 00110000 */ - 0x18, /* 00011000 */ - 0x0c, /* 00001100 */ - 0x18, /* 00011000 */ - 0x30, /* 00110000 */ - 0x60, /* 01100000 */ - 0x00, /* 00000000 */ - - /* 63 0x3f '?' */ - 0x7c, /* 01111100 */ - 0xc6, /* 11000110 */ - 0x0c, /* 00001100 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - - /* 64 0x40 '@' */ - 0x7c, /* 01111100 */ - 0xc6, /* 11000110 */ - 0xde, /* 11011110 */ - 0xde, /* 11011110 */ - 0xde, /* 11011110 */ - 0xc0, /* 11000000 */ - 0x78, /* 01111000 */ - 0x00, /* 00000000 */ - - /* 65 0x41 'A' */ - 0x38, /* 00111000 */ - 0x6c, /* 01101100 */ - 0xc6, /* 11000110 */ - 0xfe, /* 11111110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x00, /* 00000000 */ - - /* 66 0x42 'B' */ - 0xfc, /* 11111100 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x7c, /* 01111100 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0xfc, /* 11111100 */ - 0x00, /* 00000000 */ - - /* 67 0x43 'C' */ - 0x3c, /* 00111100 */ - 0x66, /* 01100110 */ - 0xc0, /* 11000000 */ - 0xc0, /* 11000000 */ - 0xc0, /* 11000000 */ - 0x66, /* 01100110 */ - 0x3c, /* 00111100 */ - 0x00, /* 00000000 */ - - /* 68 0x44 'D' */ - 0xf8, /* 11111000 */ - 0x6c, /* 01101100 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x6c, /* 01101100 */ - 0xf8, /* 11111000 */ - 0x00, /* 00000000 */ - - /* 69 0x45 'E' */ - 0xfe, /* 11111110 */ - 0x62, /* 01100010 */ - 0x68, /* 01101000 */ - 0x78, /* 01111000 */ - 0x68, /* 01101000 */ - 0x62, /* 01100010 */ - 0xfe, /* 11111110 */ - 0x00, /* 00000000 */ - - /* 70 0x46 'F' */ - 0xfe, /* 11111110 */ - 0x62, /* 01100010 */ - 0x68, /* 01101000 */ - 0x78, /* 01111000 */ - 0x68, /* 01101000 */ - 0x60, /* 01100000 */ - 0xf0, /* 11110000 */ - 0x00, /* 00000000 */ - - /* 71 0x47 'G' */ - 0x3c, /* 00111100 */ - 0x66, /* 01100110 */ - 0xc0, /* 11000000 */ - 0xc0, /* 11000000 */ - 0xce, /* 11001110 */ - 0x66, /* 01100110 */ - 0x3a, /* 00111010 */ - 0x00, /* 00000000 */ - - /* 72 0x48 'H' */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xfe, /* 11111110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x00, /* 00000000 */ - - /* 73 0x49 'I' */ - 0x3c, /* 00111100 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x3c, /* 00111100 */ - 0x00, /* 00000000 */ - - /* 74 0x4a 'J' */ - 0x1e, /* 00011110 */ - 0x0c, /* 00001100 */ - 0x0c, /* 00001100 */ - 0x0c, /* 00001100 */ - 0xcc, /* 11001100 */ - 0xcc, /* 11001100 */ - 0x78, /* 01111000 */ - 0x00, /* 00000000 */ - - /* 75 0x4b 'K' */ - 0xe6, /* 11100110 */ - 0x66, /* 01100110 */ - 0x6c, /* 01101100 */ - 0x78, /* 01111000 */ - 0x6c, /* 01101100 */ - 0x66, /* 01100110 */ - 0xe6, /* 11100110 */ - 0x00, /* 00000000 */ - - /* 76 0x4c 'L' */ - 0xf0, /* 11110000 */ - 0x60, /* 01100000 */ - 0x60, /* 01100000 */ - 0x60, /* 01100000 */ - 0x62, /* 01100010 */ - 0x66, /* 01100110 */ - 0xfe, /* 11111110 */ - 0x00, /* 00000000 */ - - /* 77 0x4d 'M' */ - 0xc6, /* 11000110 */ - 0xee, /* 11101110 */ - 0xfe, /* 11111110 */ - 0xfe, /* 11111110 */ - 0xd6, /* 11010110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x00, /* 00000000 */ - - /* 78 0x4e 'N' */ - 0xc6, /* 11000110 */ - 0xe6, /* 11100110 */ - 0xf6, /* 11110110 */ - 0xde, /* 11011110 */ - 0xce, /* 11001110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x00, /* 00000000 */ - - /* 79 0x4f 'O' */ - 0x7c, /* 01111100 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x7c, /* 01111100 */ - 0x00, /* 00000000 */ - - /* 80 0x50 'P' */ - 0xfc, /* 11111100 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x7c, /* 01111100 */ - 0x60, /* 01100000 */ - 0x60, /* 01100000 */ - 0xf0, /* 11110000 */ - 0x00, /* 00000000 */ - - /* 81 0x51 'Q' */ - 0x7c, /* 01111100 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xce, /* 11001110 */ - 0x7c, /* 01111100 */ - 0x0e, /* 00001110 */ - - /* 82 0x52 'R' */ - 0xfc, /* 11111100 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x7c, /* 01111100 */ - 0x6c, /* 01101100 */ - 0x66, /* 01100110 */ - 0xe6, /* 11100110 */ - 0x00, /* 00000000 */ - - /* 83 0x53 'S' */ - 0x3c, /* 00111100 */ - 0x66, /* 01100110 */ - 0x30, /* 00110000 */ - 0x18, /* 00011000 */ - 0x0c, /* 00001100 */ - 0x66, /* 01100110 */ - 0x3c, /* 00111100 */ - 0x00, /* 00000000 */ - - /* 84 0x54 'T' */ - 0x7e, /* 01111110 */ - 0x7e, /* 01111110 */ - 0x5a, /* 01011010 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x3c, /* 00111100 */ - 0x00, /* 00000000 */ - - /* 85 0x55 'U' */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x7c, /* 01111100 */ - 0x00, /* 00000000 */ - - /* 86 0x56 'V' */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x6c, /* 01101100 */ - 0x38, /* 00111000 */ - 0x00, /* 00000000 */ - - /* 87 0x57 'W' */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xd6, /* 11010110 */ - 0xd6, /* 11010110 */ - 0xfe, /* 11111110 */ - 0x6c, /* 01101100 */ - 0x00, /* 00000000 */ - - /* 88 0x58 'X' */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x6c, /* 01101100 */ - 0x38, /* 00111000 */ - 0x6c, /* 01101100 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x00, /* 00000000 */ - - /* 89 0x59 'Y' */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x3c, /* 00111100 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x3c, /* 00111100 */ - 0x00, /* 00000000 */ - - /* 90 0x5a 'Z' */ - 0xfe, /* 11111110 */ - 0xc6, /* 11000110 */ - 0x8c, /* 10001100 */ - 0x18, /* 00011000 */ - 0x32, /* 00110010 */ - 0x66, /* 01100110 */ - 0xfe, /* 11111110 */ - 0x00, /* 00000000 */ - - /* 91 0x5b '[' */ - 0x3c, /* 00111100 */ - 0x30, /* 00110000 */ - 0x30, /* 00110000 */ - 0x30, /* 00110000 */ - 0x30, /* 00110000 */ - 0x30, /* 00110000 */ - 0x3c, /* 00111100 */ - 0x00, /* 00000000 */ - - /* 92 0x5c '\' */ - 0xc0, /* 11000000 */ - 0x60, /* 01100000 */ - 0x30, /* 00110000 */ - 0x18, /* 00011000 */ - 0x0c, /* 00001100 */ - 0x06, /* 00000110 */ - 0x02, /* 00000010 */ - 0x00, /* 00000000 */ - - /* 93 0x5d ']' */ - 0x3c, /* 00111100 */ - 0x0c, /* 00001100 */ - 0x0c, /* 00001100 */ - 0x0c, /* 00001100 */ - 0x0c, /* 00001100 */ - 0x0c, /* 00001100 */ - 0x3c, /* 00111100 */ - 0x00, /* 00000000 */ - - /* 94 0x5e '^' */ - 0x10, /* 00010000 */ - 0x38, /* 00111000 */ - 0x6c, /* 01101100 */ - 0xc6, /* 11000110 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 95 0x5f '_' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xff, /* 11111111 */ - - /* 96 0x60 '`' */ - 0x30, /* 00110000 */ - 0x18, /* 00011000 */ - 0x0c, /* 00001100 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 97 0x61 'a' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x78, /* 01111000 */ - 0x0c, /* 00001100 */ - 0x7c, /* 01111100 */ - 0xcc, /* 11001100 */ - 0x76, /* 01110110 */ - 0x00, /* 00000000 */ - - /* 98 0x62 'b' */ - 0xe0, /* 11100000 */ - 0x60, /* 01100000 */ - 0x7c, /* 01111100 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0xdc, /* 11011100 */ - 0x00, /* 00000000 */ - - /* 99 0x63 'c' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x7c, /* 01111100 */ - 0xc6, /* 11000110 */ - 0xc0, /* 11000000 */ - 0xc6, /* 11000110 */ - 0x7c, /* 01111100 */ - 0x00, /* 00000000 */ - - /* 100 0x64 'd' */ - 0x1c, /* 00011100 */ - 0x0c, /* 00001100 */ - 0x7c, /* 01111100 */ - 0xcc, /* 11001100 */ - 0xcc, /* 11001100 */ - 0xcc, /* 11001100 */ - 0x76, /* 01110110 */ - 0x00, /* 00000000 */ - - /* 101 0x65 'e' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x7c, /* 01111100 */ - 0xc6, /* 11000110 */ - 0xfe, /* 11111110 */ - 0xc0, /* 11000000 */ - 0x7c, /* 01111100 */ - 0x00, /* 00000000 */ - - /* 102 0x66 'f' */ - 0x3c, /* 00111100 */ - 0x66, /* 01100110 */ - 0x60, /* 01100000 */ - 0xf8, /* 11111000 */ - 0x60, /* 01100000 */ - 0x60, /* 01100000 */ - 0xf0, /* 11110000 */ - 0x00, /* 00000000 */ - - /* 103 0x67 'g' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x76, /* 01110110 */ - 0xcc, /* 11001100 */ - 0xcc, /* 11001100 */ - 0x7c, /* 01111100 */ - 0x0c, /* 00001100 */ - 0xf8, /* 11111000 */ - - /* 104 0x68 'h' */ - 0xe0, /* 11100000 */ - 0x60, /* 01100000 */ - 0x6c, /* 01101100 */ - 0x76, /* 01110110 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0xe6, /* 11100110 */ - 0x00, /* 00000000 */ - - /* 105 0x69 'i' */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x38, /* 00111000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x3c, /* 00111100 */ - 0x00, /* 00000000 */ - - /* 106 0x6a 'j' */ - 0x06, /* 00000110 */ - 0x00, /* 00000000 */ - 0x06, /* 00000110 */ - 0x06, /* 00000110 */ - 0x06, /* 00000110 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x3c, /* 00111100 */ - - /* 107 0x6b 'k' */ - 0xe0, /* 11100000 */ - 0x60, /* 01100000 */ - 0x66, /* 01100110 */ - 0x6c, /* 01101100 */ - 0x78, /* 01111000 */ - 0x6c, /* 01101100 */ - 0xe6, /* 11100110 */ - 0x00, /* 00000000 */ - - /* 108 0x6c 'l' */ - 0x38, /* 00111000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x3c, /* 00111100 */ - 0x00, /* 00000000 */ - - /* 109 0x6d 'm' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xec, /* 11101100 */ - 0xfe, /* 11111110 */ - 0xd6, /* 11010110 */ - 0xd6, /* 11010110 */ - 0xd6, /* 11010110 */ - 0x00, /* 00000000 */ - - /* 110 0x6e 'n' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xdc, /* 11011100 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x00, /* 00000000 */ - - /* 111 0x6f 'o' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x7c, /* 01111100 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x7c, /* 01111100 */ - 0x00, /* 00000000 */ - - /* 112 0x70 'p' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xdc, /* 11011100 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x7c, /* 01111100 */ - 0x60, /* 01100000 */ - 0xf0, /* 11110000 */ - - /* 113 0x71 'q' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x76, /* 01110110 */ - 0xcc, /* 11001100 */ - 0xcc, /* 11001100 */ - 0x7c, /* 01111100 */ - 0x0c, /* 00001100 */ - 0x1e, /* 00011110 */ - - /* 114 0x72 'r' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xdc, /* 11011100 */ - 0x76, /* 01110110 */ - 0x60, /* 01100000 */ - 0x60, /* 01100000 */ - 0xf0, /* 11110000 */ - 0x00, /* 00000000 */ - - /* 115 0x73 's' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x7e, /* 01111110 */ - 0xc0, /* 11000000 */ - 0x7c, /* 01111100 */ - 0x06, /* 00000110 */ - 0xfc, /* 11111100 */ - 0x00, /* 00000000 */ - - /* 116 0x74 't' */ - 0x30, /* 00110000 */ - 0x30, /* 00110000 */ - 0xfc, /* 11111100 */ - 0x30, /* 00110000 */ - 0x30, /* 00110000 */ - 0x36, /* 00110110 */ - 0x1c, /* 00011100 */ - 0x00, /* 00000000 */ - - /* 117 0x75 'u' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xcc, /* 11001100 */ - 0xcc, /* 11001100 */ - 0xcc, /* 11001100 */ - 0xcc, /* 11001100 */ - 0x76, /* 01110110 */ - 0x00, /* 00000000 */ - - /* 118 0x76 'v' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x6c, /* 01101100 */ - 0x38, /* 00111000 */ - 0x00, /* 00000000 */ - - /* 119 0x77 'w' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xc6, /* 11000110 */ - 0xd6, /* 11010110 */ - 0xd6, /* 11010110 */ - 0xfe, /* 11111110 */ - 0x6c, /* 01101100 */ - 0x00, /* 00000000 */ - - /* 120 0x78 'x' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xc6, /* 11000110 */ - 0x6c, /* 01101100 */ - 0x38, /* 00111000 */ - 0x6c, /* 01101100 */ - 0xc6, /* 11000110 */ - 0x00, /* 00000000 */ - - /* 121 0x79 'y' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x7e, /* 01111110 */ - 0x06, /* 00000110 */ - 0xfc, /* 11111100 */ - - /* 122 0x7a 'z' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x7e, /* 01111110 */ - 0x4c, /* 01001100 */ - 0x18, /* 00011000 */ - 0x32, /* 00110010 */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ - - /* 123 0x7b '{' */ - 0x0e, /* 00001110 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x70, /* 01110000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x0e, /* 00001110 */ - 0x00, /* 00000000 */ - - /* 124 0x7c '|' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - - /* 125 0x7d '}' */ - 0x70, /* 01110000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x0e, /* 00001110 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x70, /* 01110000 */ - 0x00, /* 00000000 */ - - /* 126 0x7e '~' */ - 0x76, /* 01110110 */ - 0xdc, /* 11011100 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 127 0x7f '' */ - 0x00, /* 00000000 */ - 0x10, /* 00010000 */ - 0x38, /* 00111000 */ - 0x6c, /* 01101100 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xfe, /* 11111110 */ - 0x00, /* 00000000 */ - - /* 128 0x80 '€' */ - 0x7c, /* 01111100 */ - 0xc6, /* 11000110 */ - 0xc0, /* 11000000 */ - 0xc0, /* 11000000 */ - 0xc6, /* 11000110 */ - 0x7c, /* 01111100 */ - 0x0c, /* 00001100 */ - 0x78, /* 01111000 */ - - /* 129 0x81 '' */ - 0xcc, /* 11001100 */ - 0x00, /* 00000000 */ - 0xcc, /* 11001100 */ - 0xcc, /* 11001100 */ - 0xcc, /* 11001100 */ - 0xcc, /* 11001100 */ - 0x76, /* 01110110 */ - 0x00, /* 00000000 */ - - /* 130 0x82 '‚' */ - 0x0c, /* 00001100 */ - 0x18, /* 00011000 */ - 0x7c, /* 01111100 */ - 0xc6, /* 11000110 */ - 0xfe, /* 11111110 */ - 0xc0, /* 11000000 */ - 0x7c, /* 01111100 */ - 0x00, /* 00000000 */ - - /* 131 0x83 'ƒ' */ - 0x7c, /* 01111100 */ - 0x82, /* 10000010 */ - 0x78, /* 01111000 */ - 0x0c, /* 00001100 */ - 0x7c, /* 01111100 */ - 0xcc, /* 11001100 */ - 0x76, /* 01110110 */ - 0x00, /* 00000000 */ - - /* 132 0x84 '„' */ - 0xc6, /* 11000110 */ - 0x00, /* 00000000 */ - 0x78, /* 01111000 */ - 0x0c, /* 00001100 */ - 0x7c, /* 01111100 */ - 0xcc, /* 11001100 */ - 0x76, /* 01110110 */ - 0x00, /* 00000000 */ - - /* 133 0x85 '…' */ - 0x30, /* 00110000 */ - 0x18, /* 00011000 */ - 0x78, /* 01111000 */ - 0x0c, /* 00001100 */ - 0x7c, /* 01111100 */ - 0xcc, /* 11001100 */ - 0x76, /* 01110110 */ - 0x00, /* 00000000 */ - - /* 134 0x86 '†' */ - 0x30, /* 00110000 */ - 0x30, /* 00110000 */ - 0x78, /* 01111000 */ - 0x0c, /* 00001100 */ - 0x7c, /* 01111100 */ - 0xcc, /* 11001100 */ - 0x76, /* 01110110 */ - 0x00, /* 00000000 */ - - /* 135 0x87 '‡' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x7e, /* 01111110 */ - 0xc0, /* 11000000 */ - 0xc0, /* 11000000 */ - 0x7e, /* 01111110 */ - 0x0c, /* 00001100 */ - 0x38, /* 00111000 */ - - /* 136 0x88 'ˆ' */ - 0x7c, /* 01111100 */ - 0x82, /* 10000010 */ - 0x7c, /* 01111100 */ - 0xc6, /* 11000110 */ - 0xfe, /* 11111110 */ - 0xc0, /* 11000000 */ - 0x7c, /* 01111100 */ - 0x00, /* 00000000 */ - - /* 137 0x89 '‰' */ - 0xc6, /* 11000110 */ - 0x00, /* 00000000 */ - 0x7c, /* 01111100 */ - 0xc6, /* 11000110 */ - 0xfe, /* 11111110 */ - 0xc0, /* 11000000 */ - 0x7c, /* 01111100 */ - 0x00, /* 00000000 */ - - /* 138 0x8a 'Š' */ - 0x30, /* 00110000 */ - 0x18, /* 00011000 */ - 0x7c, /* 01111100 */ - 0xc6, /* 11000110 */ - 0xfe, /* 11111110 */ - 0xc0, /* 11000000 */ - 0x7c, /* 01111100 */ - 0x00, /* 00000000 */ - - /* 139 0x8b '‹' */ - 0x66, /* 01100110 */ - 0x00, /* 00000000 */ - 0x38, /* 00111000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x3c, /* 00111100 */ - 0x00, /* 00000000 */ - - /* 140 0x8c 'Œ' */ - 0x7c, /* 01111100 */ - 0x82, /* 10000010 */ - 0x38, /* 00111000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x3c, /* 00111100 */ - 0x00, /* 00000000 */ - - /* 141 0x8d '' */ - 0x30, /* 00110000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x38, /* 00111000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x3c, /* 00111100 */ - 0x00, /* 00000000 */ - - /* 142 0x8e 'Ž' */ - 0xc6, /* 11000110 */ - 0x38, /* 00111000 */ - 0x6c, /* 01101100 */ - 0xc6, /* 11000110 */ - 0xfe, /* 11111110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x00, /* 00000000 */ - - /* 143 0x8f '' */ - 0x38, /* 00111000 */ - 0x6c, /* 01101100 */ - 0x7c, /* 01111100 */ - 0xc6, /* 11000110 */ - 0xfe, /* 11111110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x00, /* 00000000 */ - - /* 144 0x90 '' */ - 0x18, /* 00011000 */ - 0x30, /* 00110000 */ - 0xfe, /* 11111110 */ - 0xc0, /* 11000000 */ - 0xf8, /* 11111000 */ - 0xc0, /* 11000000 */ - 0xfe, /* 11111110 */ - 0x00, /* 00000000 */ - - /* 145 0x91 '‘' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x7e, /* 01111110 */ - 0x18, /* 00011000 */ - 0x7e, /* 01111110 */ - 0xd8, /* 11011000 */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ - - /* 146 0x92 '’' */ - 0x3e, /* 00111110 */ - 0x6c, /* 01101100 */ - 0xcc, /* 11001100 */ - 0xfe, /* 11111110 */ - 0xcc, /* 11001100 */ - 0xcc, /* 11001100 */ - 0xce, /* 11001110 */ - 0x00, /* 00000000 */ - - /* 147 0x93 '“' */ - 0x7c, /* 01111100 */ - 0x82, /* 10000010 */ - 0x7c, /* 01111100 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x7c, /* 01111100 */ - 0x00, /* 00000000 */ - - /* 148 0x94 '”' */ - 0xc6, /* 11000110 */ - 0x00, /* 00000000 */ - 0x7c, /* 01111100 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x7c, /* 01111100 */ - 0x00, /* 00000000 */ - - /* 149 0x95 '•' */ - 0x30, /* 00110000 */ - 0x18, /* 00011000 */ - 0x7c, /* 01111100 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x7c, /* 01111100 */ - 0x00, /* 00000000 */ - - /* 150 0x96 '–' */ - 0x78, /* 01111000 */ - 0x84, /* 10000100 */ - 0x00, /* 00000000 */ - 0xcc, /* 11001100 */ - 0xcc, /* 11001100 */ - 0xcc, /* 11001100 */ - 0x76, /* 01110110 */ - 0x00, /* 00000000 */ - - /* 151 0x97 '—' */ - 0x60, /* 01100000 */ - 0x30, /* 00110000 */ - 0xcc, /* 11001100 */ - 0xcc, /* 11001100 */ - 0xcc, /* 11001100 */ - 0xcc, /* 11001100 */ - 0x76, /* 01110110 */ - 0x00, /* 00000000 */ - - /* 152 0x98 '˜' */ - 0xc6, /* 11000110 */ - 0x00, /* 00000000 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x7e, /* 01111110 */ - 0x06, /* 00000110 */ - 0xfc, /* 11111100 */ - - /* 153 0x99 '™' */ - 0xc6, /* 11000110 */ - 0x38, /* 00111000 */ - 0x6c, /* 01101100 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x6c, /* 01101100 */ - 0x38, /* 00111000 */ - 0x00, /* 00000000 */ - - /* 154 0x9a 'š' */ - 0xc6, /* 11000110 */ - 0x00, /* 00000000 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x7c, /* 01111100 */ - 0x00, /* 00000000 */ - - /* 155 0x9b '›' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x7e, /* 01111110 */ - 0xc0, /* 11000000 */ - 0xc0, /* 11000000 */ - 0x7e, /* 01111110 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - - /* 156 0x9c 'œ' */ - 0x38, /* 00111000 */ - 0x6c, /* 01101100 */ - 0x64, /* 01100100 */ - 0xf0, /* 11110000 */ - 0x60, /* 01100000 */ - 0x66, /* 01100110 */ - 0xfc, /* 11111100 */ - 0x00, /* 00000000 */ - - /* 157 0x9d '' */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x3c, /* 00111100 */ - 0x7e, /* 01111110 */ - 0x18, /* 00011000 */ - 0x7e, /* 01111110 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - - /* 158 0x9e 'ž' */ - 0xf8, /* 11111000 */ - 0xcc, /* 11001100 */ - 0xcc, /* 11001100 */ - 0xfa, /* 11111010 */ - 0xc6, /* 11000110 */ - 0xcf, /* 11001111 */ - 0xc6, /* 11000110 */ - 0xc7, /* 11000111 */ - - /* 159 0x9f 'Ÿ' */ - 0x0e, /* 00001110 */ - 0x1b, /* 00011011 */ - 0x18, /* 00011000 */ - 0x3c, /* 00111100 */ - 0x18, /* 00011000 */ - 0xd8, /* 11011000 */ - 0x70, /* 01110000 */ - 0x00, /* 00000000 */ - - /* 160 0xa0 ' ' */ - 0x18, /* 00011000 */ - 0x30, /* 00110000 */ - 0x78, /* 01111000 */ - 0x0c, /* 00001100 */ - 0x7c, /* 01111100 */ - 0xcc, /* 11001100 */ - 0x76, /* 01110110 */ - 0x00, /* 00000000 */ - - /* 161 0xa1 '¡' */ - 0x0c, /* 00001100 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x38, /* 00111000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x3c, /* 00111100 */ - 0x00, /* 00000000 */ - - /* 162 0xa2 '¢' */ - 0x0c, /* 00001100 */ - 0x18, /* 00011000 */ - 0x7c, /* 01111100 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x7c, /* 01111100 */ - 0x00, /* 00000000 */ - - /* 163 0xa3 '£' */ - 0x18, /* 00011000 */ - 0x30, /* 00110000 */ - 0xcc, /* 11001100 */ - 0xcc, /* 11001100 */ - 0xcc, /* 11001100 */ - 0xcc, /* 11001100 */ - 0x76, /* 01110110 */ - 0x00, /* 00000000 */ - - /* 164 0xa4 '¤' */ - 0x76, /* 01110110 */ - 0xdc, /* 11011100 */ - 0x00, /* 00000000 */ - 0xdc, /* 11011100 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x00, /* 00000000 */ - - /* 165 0xa5 '¥' */ - 0x76, /* 01110110 */ - 0xdc, /* 11011100 */ - 0x00, /* 00000000 */ - 0xe6, /* 11100110 */ - 0xf6, /* 11110110 */ - 0xde, /* 11011110 */ - 0xce, /* 11001110 */ - 0x00, /* 00000000 */ - - /* 166 0xa6 '¦' */ - 0x3c, /* 00111100 */ - 0x6c, /* 01101100 */ - 0x6c, /* 01101100 */ - 0x3e, /* 00111110 */ - 0x00, /* 00000000 */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 167 0xa7 '§' */ - 0x38, /* 00111000 */ - 0x6c, /* 01101100 */ - 0x6c, /* 01101100 */ - 0x38, /* 00111000 */ - 0x00, /* 00000000 */ - 0x7c, /* 01111100 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 168 0xa8 '¨' */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x30, /* 00110000 */ - 0x63, /* 01100011 */ - 0x3e, /* 00111110 */ - 0x00, /* 00000000 */ - - /* 169 0xa9 '©' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xfe, /* 11111110 */ - 0xc0, /* 11000000 */ - 0xc0, /* 11000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 170 0xaa 'ª' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xfe, /* 11111110 */ - 0x06, /* 00000110 */ - 0x06, /* 00000110 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 171 0xab '«' */ - 0x63, /* 01100011 */ - 0xe6, /* 11100110 */ - 0x6c, /* 01101100 */ - 0x7e, /* 01111110 */ - 0x33, /* 00110011 */ - 0x66, /* 01100110 */ - 0xcc, /* 11001100 */ - 0x0f, /* 00001111 */ - - /* 172 0xac '¬' */ - 0x63, /* 01100011 */ - 0xe6, /* 11100110 */ - 0x6c, /* 01101100 */ - 0x7a, /* 01111010 */ - 0x36, /* 00110110 */ - 0x6a, /* 01101010 */ - 0xdf, /* 11011111 */ - 0x06, /* 00000110 */ - - /* 173 0xad '­' */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x3c, /* 00111100 */ - 0x3c, /* 00111100 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - - /* 174 0xae '®' */ - 0x00, /* 00000000 */ - 0x33, /* 00110011 */ - 0x66, /* 01100110 */ - 0xcc, /* 11001100 */ - 0x66, /* 01100110 */ - 0x33, /* 00110011 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 175 0xaf '¯' */ - 0x00, /* 00000000 */ - 0xcc, /* 11001100 */ - 0x66, /* 01100110 */ - 0x33, /* 00110011 */ - 0x66, /* 01100110 */ - 0xcc, /* 11001100 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 176 0xb0 '°' */ - 0x22, /* 00100010 */ - 0x88, /* 10001000 */ - 0x22, /* 00100010 */ - 0x88, /* 10001000 */ - 0x22, /* 00100010 */ - 0x88, /* 10001000 */ - 0x22, /* 00100010 */ - 0x88, /* 10001000 */ - - /* 177 0xb1 '±' */ - 0x55, /* 01010101 */ - 0xaa, /* 10101010 */ - 0x55, /* 01010101 */ - 0xaa, /* 10101010 */ - 0x55, /* 01010101 */ - 0xaa, /* 10101010 */ - 0x55, /* 01010101 */ - 0xaa, /* 10101010 */ - - /* 178 0xb2 '²' */ - 0x77, /* 01110111 */ - 0xdd, /* 11011101 */ - 0x77, /* 01110111 */ - 0xdd, /* 11011101 */ - 0x77, /* 01110111 */ - 0xdd, /* 11011101 */ - 0x77, /* 01110111 */ - 0xdd, /* 11011101 */ - - /* 179 0xb3 '³' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - - /* 180 0xb4 '´' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0xf8, /* 11111000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - - /* 181 0xb5 'µ' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0xf8, /* 11111000 */ - 0x18, /* 00011000 */ - 0xf8, /* 11111000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - - /* 182 0xb6 '¶' */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0xf6, /* 11110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - - /* 183 0xb7 '·' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xfe, /* 11111110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - - /* 184 0xb8 '¸' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xf8, /* 11111000 */ - 0x18, /* 00011000 */ - 0xf8, /* 11111000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - - /* 185 0xb9 '¹' */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0xf6, /* 11110110 */ - 0x06, /* 00000110 */ - 0xf6, /* 11110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - - /* 186 0xba 'º' */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - - /* 187 0xbb '»' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xfe, /* 11111110 */ - 0x06, /* 00000110 */ - 0xf6, /* 11110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - - /* 188 0xbc '¼' */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0xf6, /* 11110110 */ - 0x06, /* 00000110 */ - 0xfe, /* 11111110 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 189 0xbd '½' */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0xfe, /* 11111110 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 190 0xbe '¾' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0xf8, /* 11111000 */ - 0x18, /* 00011000 */ - 0xf8, /* 11111000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 191 0xbf '¿' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xf8, /* 11111000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - - /* 192 0xc0 'À' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x1f, /* 00011111 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 193 0xc1 'Á' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0xff, /* 11111111 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 194 0xc2 'Â' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xff, /* 11111111 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - - /* 195 0xc3 'Ã' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x1f, /* 00011111 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - - /* 196 0xc4 'Ä' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xff, /* 11111111 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 197 0xc5 'Å' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0xff, /* 11111111 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - - /* 198 0xc6 'Æ' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x1f, /* 00011111 */ - 0x18, /* 00011000 */ - 0x1f, /* 00011111 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - - /* 199 0xc7 'Ç' */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x37, /* 00110111 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - - /* 200 0xc8 'È' */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x37, /* 00110111 */ - 0x30, /* 00110000 */ - 0x3f, /* 00111111 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 201 0xc9 'É' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x3f, /* 00111111 */ - 0x30, /* 00110000 */ - 0x37, /* 00110111 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - - /* 202 0xca 'Ê' */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0xf7, /* 11110111 */ - 0x00, /* 00000000 */ - 0xff, /* 11111111 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 203 0xcb 'Ë' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xff, /* 11111111 */ - 0x00, /* 00000000 */ - 0xf7, /* 11110111 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - - /* 204 0xcc 'Ì' */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x37, /* 00110111 */ - 0x30, /* 00110000 */ - 0x37, /* 00110111 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - - /* 205 0xcd 'Í' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xff, /* 11111111 */ - 0x00, /* 00000000 */ - 0xff, /* 11111111 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 206 0xce 'Î' */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0xf7, /* 11110111 */ - 0x00, /* 00000000 */ - 0xf7, /* 11110111 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - - /* 207 0xcf 'Ï' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0xff, /* 11111111 */ - 0x00, /* 00000000 */ - 0xff, /* 11111111 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 208 0xd0 'Ð' */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0xff, /* 11111111 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 209 0xd1 'Ñ' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xff, /* 11111111 */ - 0x00, /* 00000000 */ - 0xff, /* 11111111 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - - /* 210 0xd2 'Ò' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xff, /* 11111111 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - - /* 211 0xd3 'Ó' */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x3f, /* 00111111 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 212 0xd4 'Ô' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x1f, /* 00011111 */ - 0x18, /* 00011000 */ - 0x1f, /* 00011111 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 213 0xd5 'Õ' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x1f, /* 00011111 */ - 0x18, /* 00011000 */ - 0x1f, /* 00011111 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - - /* 214 0xd6 'Ö' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x3f, /* 00111111 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - - /* 215 0xd7 '×' */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0xff, /* 11111111 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - - /* 216 0xd8 'Ø' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0xff, /* 11111111 */ - 0x18, /* 00011000 */ - 0xff, /* 11111111 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - - /* 217 0xd9 'Ù' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0xf8, /* 11111000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 218 0xda 'Ú' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x1f, /* 00011111 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - - /* 219 0xdb 'Û' */ - 0xff, /* 11111111 */ - 0xff, /* 11111111 */ - 0xff, /* 11111111 */ - 0xff, /* 11111111 */ - 0xff, /* 11111111 */ - 0xff, /* 11111111 */ - 0xff, /* 11111111 */ - 0xff, /* 11111111 */ - - /* 220 0xdc 'Ü' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xff, /* 11111111 */ - 0xff, /* 11111111 */ - 0xff, /* 11111111 */ - 0xff, /* 11111111 */ - - /* 221 0xdd 'Ý' */ - 0xf0, /* 11110000 */ - 0xf0, /* 11110000 */ - 0xf0, /* 11110000 */ - 0xf0, /* 11110000 */ - 0xf0, /* 11110000 */ - 0xf0, /* 11110000 */ - 0xf0, /* 11110000 */ - 0xf0, /* 11110000 */ - - /* 222 0xde 'Þ' */ - 0x0f, /* 00001111 */ - 0x0f, /* 00001111 */ - 0x0f, /* 00001111 */ - 0x0f, /* 00001111 */ - 0x0f, /* 00001111 */ - 0x0f, /* 00001111 */ - 0x0f, /* 00001111 */ - 0x0f, /* 00001111 */ - - /* 223 0xdf 'ß' */ - 0xff, /* 11111111 */ - 0xff, /* 11111111 */ - 0xff, /* 11111111 */ - 0xff, /* 11111111 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 224 0xe0 'à' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x76, /* 01110110 */ - 0xdc, /* 11011100 */ - 0xc8, /* 11001000 */ - 0xdc, /* 11011100 */ - 0x76, /* 01110110 */ - 0x00, /* 00000000 */ - - /* 225 0xe1 'á' */ - 0x78, /* 01111000 */ - 0xcc, /* 11001100 */ - 0xcc, /* 11001100 */ - 0xd8, /* 11011000 */ - 0xcc, /* 11001100 */ - 0xc6, /* 11000110 */ - 0xcc, /* 11001100 */ - 0x00, /* 00000000 */ - - /* 226 0xe2 'â' */ - 0xfe, /* 11111110 */ - 0xc6, /* 11000110 */ - 0xc0, /* 11000000 */ - 0xc0, /* 11000000 */ - 0xc0, /* 11000000 */ - 0xc0, /* 11000000 */ - 0xc0, /* 11000000 */ - 0x00, /* 00000000 */ - - /* 227 0xe3 'ã' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xfe, /* 11111110 */ - 0x6c, /* 01101100 */ - 0x6c, /* 01101100 */ - 0x6c, /* 01101100 */ - 0x6c, /* 01101100 */ - 0x00, /* 00000000 */ - - /* 228 0xe4 'ä' */ - 0xfe, /* 11111110 */ - 0xc6, /* 11000110 */ - 0x60, /* 01100000 */ - 0x30, /* 00110000 */ - 0x60, /* 01100000 */ - 0xc6, /* 11000110 */ - 0xfe, /* 11111110 */ - 0x00, /* 00000000 */ - - /* 229 0xe5 'å' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x7e, /* 01111110 */ - 0xd8, /* 11011000 */ - 0xd8, /* 11011000 */ - 0xd8, /* 11011000 */ - 0x70, /* 01110000 */ - 0x00, /* 00000000 */ - - /* 230 0xe6 'æ' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x7c, /* 01111100 */ - 0xc0, /* 11000000 */ - - /* 231 0xe7 'ç' */ - 0x00, /* 00000000 */ - 0x76, /* 01110110 */ - 0xdc, /* 11011100 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - - /* 232 0xe8 'è' */ - 0x7e, /* 01111110 */ - 0x18, /* 00011000 */ - 0x3c, /* 00111100 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x3c, /* 00111100 */ - 0x18, /* 00011000 */ - 0x7e, /* 01111110 */ - - /* 233 0xe9 'é' */ - 0x38, /* 00111000 */ - 0x6c, /* 01101100 */ - 0xc6, /* 11000110 */ - 0xfe, /* 11111110 */ - 0xc6, /* 11000110 */ - 0x6c, /* 01101100 */ - 0x38, /* 00111000 */ - 0x00, /* 00000000 */ - - /* 234 0xea 'ê' */ - 0x38, /* 00111000 */ - 0x6c, /* 01101100 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x6c, /* 01101100 */ - 0x6c, /* 01101100 */ - 0xee, /* 11101110 */ - 0x00, /* 00000000 */ - - /* 235 0xeb 'ë' */ - 0x0e, /* 00001110 */ - 0x18, /* 00011000 */ - 0x0c, /* 00001100 */ - 0x3e, /* 00111110 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x3c, /* 00111100 */ - 0x00, /* 00000000 */ - - /* 236 0xec 'ì' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x7e, /* 01111110 */ - 0xdb, /* 11011011 */ - 0xdb, /* 11011011 */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 237 0xed 'í' */ - 0x06, /* 00000110 */ - 0x0c, /* 00001100 */ - 0x7e, /* 01111110 */ - 0xdb, /* 11011011 */ - 0xdb, /* 11011011 */ - 0x7e, /* 01111110 */ - 0x60, /* 01100000 */ - 0xc0, /* 11000000 */ - - /* 238 0xee 'î' */ - 0x1e, /* 00011110 */ - 0x30, /* 00110000 */ - 0x60, /* 01100000 */ - 0x7e, /* 01111110 */ - 0x60, /* 01100000 */ - 0x30, /* 00110000 */ - 0x1e, /* 00011110 */ - 0x00, /* 00000000 */ - - /* 239 0xef 'ï' */ - 0x00, /* 00000000 */ - 0x7c, /* 01111100 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0xc6, /* 11000110 */ - 0x00, /* 00000000 */ - - /* 240 0xf0 'ð' */ - 0x00, /* 00000000 */ - 0xfe, /* 11111110 */ - 0x00, /* 00000000 */ - 0xfe, /* 11111110 */ - 0x00, /* 00000000 */ - 0xfe, /* 11111110 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 241 0xf1 'ñ' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x7e, /* 01111110 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ - - /* 242 0xf2 'ò' */ - 0x30, /* 00110000 */ - 0x18, /* 00011000 */ - 0x0c, /* 00001100 */ - 0x18, /* 00011000 */ - 0x30, /* 00110000 */ - 0x00, /* 00000000 */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ - - /* 243 0xf3 'ó' */ - 0x0c, /* 00001100 */ - 0x18, /* 00011000 */ - 0x30, /* 00110000 */ - 0x18, /* 00011000 */ - 0x0c, /* 00001100 */ - 0x00, /* 00000000 */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ - - /* 244 0xf4 'ô' */ - 0x0e, /* 00001110 */ - 0x1b, /* 00011011 */ - 0x1b, /* 00011011 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - - /* 245 0xf5 'õ' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0xd8, /* 11011000 */ - 0xd8, /* 11011000 */ - 0x70, /* 01110000 */ - - /* 246 0xf6 'ö' */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 247 0xf7 '÷' */ - 0x00, /* 00000000 */ - 0x76, /* 01110110 */ - 0xdc, /* 11011100 */ - 0x00, /* 00000000 */ - 0x76, /* 01110110 */ - 0xdc, /* 11011100 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 248 0xf8 'ø' */ - 0x38, /* 00111000 */ - 0x6c, /* 01101100 */ - 0x6c, /* 01101100 */ - 0x38, /* 00111000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 249 0xf9 'ù' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 250 0xfa 'ú' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 251 0xfb 'û' */ - 0x0f, /* 00001111 */ - 0x0c, /* 00001100 */ - 0x0c, /* 00001100 */ - 0x0c, /* 00001100 */ - 0xec, /* 11101100 */ - 0x6c, /* 01101100 */ - 0x3c, /* 00111100 */ - 0x1c, /* 00011100 */ - - /* 252 0xfc 'ü' */ - 0x6c, /* 01101100 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x36, /* 00110110 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 253 0xfd 'ý' */ - 0x78, /* 01111000 */ - 0x0c, /* 00001100 */ - 0x18, /* 00011000 */ - 0x30, /* 00110000 */ - 0x7c, /* 01111100 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 254 0xfe 'þ' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x3c, /* 00111100 */ - 0x3c, /* 00111100 */ - 0x3c, /* 00111100 */ - 0x3c, /* 00111100 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - - /* 255 0xff 'ÿ' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + /* 0 0x00 '^@' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 1 0x01 '^A' */ + 0x7e, /* 01111110 */ + 0x81, /* 10000001 */ + 0xa5, /* 10100101 */ + 0x81, /* 10000001 */ + 0xbd, /* 10111101 */ + 0x99, /* 10011001 */ + 0x81, /* 10000001 */ + 0x7e, /* 01111110 */ + + /* 2 0x02 '^B' */ + 0x7e, /* 01111110 */ + 0xff, /* 11111111 */ + 0xdb, /* 11011011 */ + 0xff, /* 11111111 */ + 0xc3, /* 11000011 */ + 0xe7, /* 11100111 */ + 0xff, /* 11111111 */ + 0x7e, /* 01111110 */ + + /* 3 0x03 '^C' */ + 0x6c, /* 01101100 */ + 0xfe, /* 11111110 */ + 0xfe, /* 11111110 */ + 0xfe, /* 11111110 */ + 0x7c, /* 01111100 */ + 0x38, /* 00111000 */ + 0x10, /* 00010000 */ + 0x00, /* 00000000 */ + + /* 4 0x04 '^D' */ + 0x10, /* 00010000 */ + 0x38, /* 00111000 */ + 0x7c, /* 01111100 */ + 0xfe, /* 11111110 */ + 0x7c, /* 01111100 */ + 0x38, /* 00111000 */ + 0x10, /* 00010000 */ + 0x00, /* 00000000 */ + + /* 5 0x05 '^E' */ + 0x38, /* 00111000 */ + 0x7c, /* 01111100 */ + 0x38, /* 00111000 */ + 0xfe, /* 11111110 */ + 0xfe, /* 11111110 */ + 0xd6, /* 11010110 */ + 0x10, /* 00010000 */ + 0x38, /* 00111000 */ + + /* 6 0x06 '^F' */ + 0x10, /* 00010000 */ + 0x38, /* 00111000 */ + 0x7c, /* 01111100 */ + 0xfe, /* 11111110 */ + 0xfe, /* 11111110 */ + 0x7c, /* 01111100 */ + 0x10, /* 00010000 */ + 0x38, /* 00111000 */ + + /* 7 0x07 '^G' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 8 0x08 '^H' */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0xe7, /* 11100111 */ + 0xc3, /* 11000011 */ + 0xc3, /* 11000011 */ + 0xe7, /* 11100111 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + + /* 9 0x09 '^I' */ + 0x00, /* 00000000 */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0x42, /* 01000010 */ + 0x42, /* 01000010 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* 10 0x0a '^J' */ + 0xff, /* 11111111 */ + 0xc3, /* 11000011 */ + 0x99, /* 10011001 */ + 0xbd, /* 10111101 */ + 0xbd, /* 10111101 */ + 0x99, /* 10011001 */ + 0xc3, /* 11000011 */ + 0xff, /* 11111111 */ + + /* 11 0x0b '^K' */ + 0x0f, /* 00001111 */ + 0x07, /* 00000111 */ + 0x0f, /* 00001111 */ + 0x7d, /* 01111101 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0x78, /* 01111000 */ + + /* 12 0x0c '^L' */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0x7e, /* 01111110 */ + 0x18, /* 00011000 */ + + /* 13 0x0d '^M' */ + 0x3f, /* 00111111 */ + 0x33, /* 00110011 */ + 0x3f, /* 00111111 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x70, /* 01110000 */ + 0xf0, /* 11110000 */ + 0xe0, /* 11100000 */ + + /* 14 0x0e '^N' */ + 0x7f, /* 01111111 */ + 0x63, /* 01100011 */ + 0x7f, /* 01111111 */ + 0x63, /* 01100011 */ + 0x63, /* 01100011 */ + 0x67, /* 01100111 */ + 0xe6, /* 11100110 */ + 0xc0, /* 11000000 */ + + /* 15 0x0f '^O' */ + 0x18, /* 00011000 */ + 0xdb, /* 11011011 */ + 0x3c, /* 00111100 */ + 0xe7, /* 11100111 */ + 0xe7, /* 11100111 */ + 0x3c, /* 00111100 */ + 0xdb, /* 11011011 */ + 0x18, /* 00011000 */ + + /* 16 0x10 '^P' */ + 0x80, /* 10000000 */ + 0xe0, /* 11100000 */ + 0xf8, /* 11111000 */ + 0xfe, /* 11111110 */ + 0xf8, /* 11111000 */ + 0xe0, /* 11100000 */ + 0x80, /* 10000000 */ + 0x00, /* 00000000 */ + + /* 17 0x11 '^Q' */ + 0x02, /* 00000010 */ + 0x0e, /* 00001110 */ + 0x3e, /* 00111110 */ + 0xfe, /* 11111110 */ + 0x3e, /* 00111110 */ + 0x0e, /* 00001110 */ + 0x02, /* 00000010 */ + 0x00, /* 00000000 */ + + /* 18 0x12 '^R' */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x7e, /* 01111110 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x7e, /* 01111110 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + + /* 19 0x13 '^S' */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x00, /* 00000000 */ + 0x66, /* 01100110 */ + 0x00, /* 00000000 */ + + /* 20 0x14 '^T' */ + 0x7f, /* 01111111 */ + 0xdb, /* 11011011 */ + 0xdb, /* 11011011 */ + 0x7b, /* 01111011 */ + 0x1b, /* 00011011 */ + 0x1b, /* 00011011 */ + 0x1b, /* 00011011 */ + 0x00, /* 00000000 */ + + /* 21 0x15 '^U' */ + 0x3e, /* 00111110 */ + 0x61, /* 01100001 */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x86, /* 10000110 */ + 0x7c, /* 01111100 */ + + /* 22 0x16 '^V' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x7e, /* 01111110 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + + /* 23 0x17 '^W' */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x7e, /* 01111110 */ + 0x18, /* 00011000 */ + 0x7e, /* 01111110 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0xff, /* 11111111 */ + + /* 24 0x18 '^X' */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x7e, /* 01111110 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + + /* 25 0x19 '^Y' */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x7e, /* 01111110 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + + /* 26 0x1a '^Z' */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x0c, /* 00001100 */ + 0xfe, /* 11111110 */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 27 0x1b '^[' */ + 0x00, /* 00000000 */ + 0x30, /* 00110000 */ + 0x60, /* 01100000 */ + 0xfe, /* 11111110 */ + 0x60, /* 01100000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 28 0x1c '^\' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 29 0x1d '^]' */ + 0x00, /* 00000000 */ + 0x24, /* 00100100 */ + 0x66, /* 01100110 */ + 0xff, /* 11111111 */ + 0x66, /* 01100110 */ + 0x24, /* 00100100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 30 0x1e '^^' */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x7e, /* 01111110 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 31 0x1f '^_' */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0x7e, /* 01111110 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 32 0x20 ' ' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 33 0x21 '!' */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + + /* 34 0x22 '"' */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x24, /* 00100100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 35 0x23 '#' */ + 0x6c, /* 01101100 */ + 0x6c, /* 01101100 */ + 0xfe, /* 11111110 */ + 0x6c, /* 01101100 */ + 0xfe, /* 11111110 */ + 0x6c, /* 01101100 */ + 0x6c, /* 01101100 */ + 0x00, /* 00000000 */ + + /* 36 0x24 '$' */ + 0x18, /* 00011000 */ + 0x3e, /* 00111110 */ + 0x60, /* 01100000 */ + 0x3c, /* 00111100 */ + 0x06, /* 00000110 */ + 0x7c, /* 01111100 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + + /* 37 0x25 '%' */ + 0x00, /* 00000000 */ + 0xc6, /* 11000110 */ + 0xcc, /* 11001100 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x66, /* 01100110 */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + + /* 38 0x26 '&' */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0x38, /* 00111000 */ + 0x76, /* 01110110 */ + 0xdc, /* 11011100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* 39 0x27 ''' */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 40 0x28 '(' */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x0c, /* 00001100 */ + 0x00, /* 00000000 */ + + /* 41 0x29 ')' */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x0c, /* 00001100 */ + 0x0c, /* 00001100 */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + + /* 42 0x2a '*' */ + 0x00, /* 00000000 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0xff, /* 11111111 */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 43 0x2b '+' */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x7e, /* 01111110 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 44 0x2c ',' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + + /* 45 0x2d '-' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 46 0x2e '.' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + + /* 47 0x2f '/' */ + 0x06, /* 00000110 */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x60, /* 01100000 */ + 0xc0, /* 11000000 */ + 0x80, /* 10000000 */ + 0x00, /* 00000000 */ + + /* 48 0x30 '0' */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0xc6, /* 11000110 */ + 0xd6, /* 11010110 */ + 0xc6, /* 11000110 */ + 0x6c, /* 01101100 */ + 0x38, /* 00111000 */ + 0x00, /* 00000000 */ + + /* 49 0x31 '1' */ + 0x18, /* 00011000 */ + 0x38, /* 00111000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + + /* 50 0x32 '2' */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0x06, /* 00000110 */ + 0x1c, /* 00011100 */ + 0x30, /* 00110000 */ + 0x66, /* 01100110 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + + /* 51 0x33 '3' */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0x06, /* 00000110 */ + 0x3c, /* 00111100 */ + 0x06, /* 00000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* 52 0x34 '4' */ + 0x1c, /* 00011100 */ + 0x3c, /* 00111100 */ + 0x6c, /* 01101100 */ + 0xcc, /* 11001100 */ + 0xfe, /* 11111110 */ + 0x0c, /* 00001100 */ + 0x1e, /* 00011110 */ + 0x00, /* 00000000 */ + + /* 53 0x35 '5' */ + 0xfe, /* 11111110 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0xfc, /* 11111100 */ + 0x06, /* 00000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* 54 0x36 '6' */ + 0x38, /* 00111000 */ + 0x60, /* 01100000 */ + 0xc0, /* 11000000 */ + 0xfc, /* 11111100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* 55 0x37 '7' */ + 0xfe, /* 11111110 */ + 0xc6, /* 11000110 */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + + /* 56 0x38 '8' */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* 57 0x39 '9' */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7e, /* 01111110 */ + 0x06, /* 00000110 */ + 0x0c, /* 00001100 */ + 0x78, /* 01111000 */ + 0x00, /* 00000000 */ + + /* 58 0x3a ':' */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + + /* 59 0x3b ';' */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + + /* 60 0x3c '<' */ + 0x06, /* 00000110 */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x0c, /* 00001100 */ + 0x06, /* 00000110 */ + 0x00, /* 00000000 */ + + /* 61 0x3d '=' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 62 0x3e '>' */ + 0x60, /* 01100000 */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x60, /* 01100000 */ + 0x00, /* 00000000 */ + + /* 63 0x3f '?' */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + + /* 64 0x40 '@' */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xde, /* 11011110 */ + 0xde, /* 11011110 */ + 0xde, /* 11011110 */ + 0xc0, /* 11000000 */ + 0x78, /* 01111000 */ + 0x00, /* 00000000 */ + + /* 65 0x41 'A' */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0xc6, /* 11000110 */ + 0xfe, /* 11111110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + + /* 66 0x42 'B' */ + 0xfc, /* 11111100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x7c, /* 01111100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0xfc, /* 11111100 */ + 0x00, /* 00000000 */ + + /* 67 0x43 'C' */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* 68 0x44 'D' */ + 0xf8, /* 11111000 */ + 0x6c, /* 01101100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x6c, /* 01101100 */ + 0xf8, /* 11111000 */ + 0x00, /* 00000000 */ + + /* 69 0x45 'E' */ + 0xfe, /* 11111110 */ + 0x62, /* 01100010 */ + 0x68, /* 01101000 */ + 0x78, /* 01111000 */ + 0x68, /* 01101000 */ + 0x62, /* 01100010 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + + /* 70 0x46 'F' */ + 0xfe, /* 11111110 */ + 0x62, /* 01100010 */ + 0x68, /* 01101000 */ + 0x78, /* 01111000 */ + 0x68, /* 01101000 */ + 0x60, /* 01100000 */ + 0xf0, /* 11110000 */ + 0x00, /* 00000000 */ + + /* 71 0x47 'G' */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0xce, /* 11001110 */ + 0x66, /* 01100110 */ + 0x3a, /* 00111010 */ + 0x00, /* 00000000 */ + + /* 72 0x48 'H' */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xfe, /* 11111110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + + /* 73 0x49 'I' */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* 74 0x4a 'J' */ + 0x1e, /* 00011110 */ + 0x0c, /* 00001100 */ + 0x0c, /* 00001100 */ + 0x0c, /* 00001100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0x78, /* 01111000 */ + 0x00, /* 00000000 */ + + /* 75 0x4b 'K' */ + 0xe6, /* 11100110 */ + 0x66, /* 01100110 */ + 0x6c, /* 01101100 */ + 0x78, /* 01111000 */ + 0x6c, /* 01101100 */ + 0x66, /* 01100110 */ + 0xe6, /* 11100110 */ + 0x00, /* 00000000 */ + + /* 76 0x4c 'L' */ + 0xf0, /* 11110000 */ + 0x60, /* 01100000 */ + 0x60, /* 01100000 */ + 0x60, /* 01100000 */ + 0x62, /* 01100010 */ + 0x66, /* 01100110 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + + /* 77 0x4d 'M' */ + 0xc6, /* 11000110 */ + 0xee, /* 11101110 */ + 0xfe, /* 11111110 */ + 0xfe, /* 11111110 */ + 0xd6, /* 11010110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + + /* 78 0x4e 'N' */ + 0xc6, /* 11000110 */ + 0xe6, /* 11100110 */ + 0xf6, /* 11110110 */ + 0xde, /* 11011110 */ + 0xce, /* 11001110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + + /* 79 0x4f 'O' */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* 80 0x50 'P' */ + 0xfc, /* 11111100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x7c, /* 01111100 */ + 0x60, /* 01100000 */ + 0x60, /* 01100000 */ + 0xf0, /* 11110000 */ + 0x00, /* 00000000 */ + + /* 81 0x51 'Q' */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xce, /* 11001110 */ + 0x7c, /* 01111100 */ + 0x0e, /* 00001110 */ + + /* 82 0x52 'R' */ + 0xfc, /* 11111100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x7c, /* 01111100 */ + 0x6c, /* 01101100 */ + 0x66, /* 01100110 */ + 0xe6, /* 11100110 */ + 0x00, /* 00000000 */ + + /* 83 0x53 'S' */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x0c, /* 00001100 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* 84 0x54 'T' */ + 0x7e, /* 01111110 */ + 0x7e, /* 01111110 */ + 0x5a, /* 01011010 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* 85 0x55 'U' */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* 86 0x56 'V' */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x6c, /* 01101100 */ + 0x38, /* 00111000 */ + 0x00, /* 00000000 */ + + /* 87 0x57 'W' */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xd6, /* 11010110 */ + 0xd6, /* 11010110 */ + 0xfe, /* 11111110 */ + 0x6c, /* 01101100 */ + 0x00, /* 00000000 */ + + /* 88 0x58 'X' */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x6c, /* 01101100 */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + + /* 89 0x59 'Y' */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* 90 0x5a 'Z' */ + 0xfe, /* 11111110 */ + 0xc6, /* 11000110 */ + 0x8c, /* 10001100 */ + 0x18, /* 00011000 */ + 0x32, /* 00110010 */ + 0x66, /* 01100110 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + + /* 91 0x5b '[' */ + 0x3c, /* 00111100 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* 92 0x5c '\' */ + 0xc0, /* 11000000 */ + 0x60, /* 01100000 */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x0c, /* 00001100 */ + 0x06, /* 00000110 */ + 0x02, /* 00000010 */ + 0x00, /* 00000000 */ + + /* 93 0x5d ']' */ + 0x3c, /* 00111100 */ + 0x0c, /* 00001100 */ + 0x0c, /* 00001100 */ + 0x0c, /* 00001100 */ + 0x0c, /* 00001100 */ + 0x0c, /* 00001100 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* 94 0x5e '^' */ + 0x10, /* 00010000 */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 95 0x5f '_' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + + /* 96 0x60 '`' */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x0c, /* 00001100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 97 0x61 'a' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x78, /* 01111000 */ + 0x0c, /* 00001100 */ + 0x7c, /* 01111100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* 98 0x62 'b' */ + 0xe0, /* 11100000 */ + 0x60, /* 01100000 */ + 0x7c, /* 01111100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0xdc, /* 11011100 */ + 0x00, /* 00000000 */ + + /* 99 0x63 'c' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc0, /* 11000000 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* 100 0x64 'd' */ + 0x1c, /* 00011100 */ + 0x0c, /* 00001100 */ + 0x7c, /* 01111100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* 101 0x65 'e' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xfe, /* 11111110 */ + 0xc0, /* 11000000 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* 102 0x66 'f' */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0x60, /* 01100000 */ + 0xf8, /* 11111000 */ + 0x60, /* 01100000 */ + 0x60, /* 01100000 */ + 0xf0, /* 11110000 */ + 0x00, /* 00000000 */ + + /* 103 0x67 'g' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x76, /* 01110110 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0x7c, /* 01111100 */ + 0x0c, /* 00001100 */ + 0xf8, /* 11111000 */ + + /* 104 0x68 'h' */ + 0xe0, /* 11100000 */ + 0x60, /* 01100000 */ + 0x6c, /* 01101100 */ + 0x76, /* 01110110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0xe6, /* 11100110 */ + 0x00, /* 00000000 */ + + /* 105 0x69 'i' */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x38, /* 00111000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* 106 0x6a 'j' */ + 0x06, /* 00000110 */ + 0x00, /* 00000000 */ + 0x06, /* 00000110 */ + 0x06, /* 00000110 */ + 0x06, /* 00000110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + + /* 107 0x6b 'k' */ + 0xe0, /* 11100000 */ + 0x60, /* 01100000 */ + 0x66, /* 01100110 */ + 0x6c, /* 01101100 */ + 0x78, /* 01111000 */ + 0x6c, /* 01101100 */ + 0xe6, /* 11100110 */ + 0x00, /* 00000000 */ + + /* 108 0x6c 'l' */ + 0x38, /* 00111000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* 109 0x6d 'm' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xec, /* 11101100 */ + 0xfe, /* 11111110 */ + 0xd6, /* 11010110 */ + 0xd6, /* 11010110 */ + 0xd6, /* 11010110 */ + 0x00, /* 00000000 */ + + /* 110 0x6e 'n' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xdc, /* 11011100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x00, /* 00000000 */ + + /* 111 0x6f 'o' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* 112 0x70 'p' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xdc, /* 11011100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x7c, /* 01111100 */ + 0x60, /* 01100000 */ + 0xf0, /* 11110000 */ + + /* 113 0x71 'q' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x76, /* 01110110 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0x7c, /* 01111100 */ + 0x0c, /* 00001100 */ + 0x1e, /* 00011110 */ + + /* 114 0x72 'r' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xdc, /* 11011100 */ + 0x76, /* 01110110 */ + 0x60, /* 01100000 */ + 0x60, /* 01100000 */ + 0xf0, /* 11110000 */ + 0x00, /* 00000000 */ + + /* 115 0x73 's' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0xc0, /* 11000000 */ + 0x7c, /* 01111100 */ + 0x06, /* 00000110 */ + 0xfc, /* 11111100 */ + 0x00, /* 00000000 */ + + /* 116 0x74 't' */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0xfc, /* 11111100 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x36, /* 00110110 */ + 0x1c, /* 00011100 */ + 0x00, /* 00000000 */ + + /* 117 0x75 'u' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* 118 0x76 'v' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x6c, /* 01101100 */ + 0x38, /* 00111000 */ + 0x00, /* 00000000 */ + + /* 119 0x77 'w' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xc6, /* 11000110 */ + 0xd6, /* 11010110 */ + 0xd6, /* 11010110 */ + 0xfe, /* 11111110 */ + 0x6c, /* 01101100 */ + 0x00, /* 00000000 */ + + /* 120 0x78 'x' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xc6, /* 11000110 */ + 0x6c, /* 01101100 */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + + /* 121 0x79 'y' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7e, /* 01111110 */ + 0x06, /* 00000110 */ + 0xfc, /* 11111100 */ + + /* 122 0x7a 'z' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x4c, /* 01001100 */ + 0x18, /* 00011000 */ + 0x32, /* 00110010 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + + /* 123 0x7b '{' */ + 0x0e, /* 00001110 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x70, /* 01110000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x0e, /* 00001110 */ + 0x00, /* 00000000 */ + + /* 124 0x7c '|' */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + + /* 125 0x7d '}' */ + 0x70, /* 01110000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x0e, /* 00001110 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x70, /* 01110000 */ + 0x00, /* 00000000 */ + + /* 126 0x7e '~' */ + 0x76, /* 01110110 */ + 0xdc, /* 11011100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 127 0x7f '' */ + 0x00, /* 00000000 */ + 0x10, /* 00010000 */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + + /* 128 0x80 '€' */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x0c, /* 00001100 */ + 0x78, /* 01111000 */ + + /* 129 0x81 '' */ + 0xcc, /* 11001100 */ + 0x00, /* 00000000 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* 130 0x82 '‚' */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xfe, /* 11111110 */ + 0xc0, /* 11000000 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* 131 0x83 'ƒ' */ + 0x7c, /* 01111100 */ + 0x82, /* 10000010 */ + 0x78, /* 01111000 */ + 0x0c, /* 00001100 */ + 0x7c, /* 01111100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* 132 0x84 '„' */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + 0x78, /* 01111000 */ + 0x0c, /* 00001100 */ + 0x7c, /* 01111100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* 133 0x85 '…' */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x78, /* 01111000 */ + 0x0c, /* 00001100 */ + 0x7c, /* 01111100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* 134 0x86 '†' */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x78, /* 01111000 */ + 0x0c, /* 00001100 */ + 0x7c, /* 01111100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* 135 0x87 '‡' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0x7e, /* 01111110 */ + 0x0c, /* 00001100 */ + 0x38, /* 00111000 */ + + /* 136 0x88 'ˆ' */ + 0x7c, /* 01111100 */ + 0x82, /* 10000010 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xfe, /* 11111110 */ + 0xc0, /* 11000000 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* 137 0x89 '‰' */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xfe, /* 11111110 */ + 0xc0, /* 11000000 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* 138 0x8a 'Š' */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xfe, /* 11111110 */ + 0xc0, /* 11000000 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* 139 0x8b '‹' */ + 0x66, /* 01100110 */ + 0x00, /* 00000000 */ + 0x38, /* 00111000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* 140 0x8c 'Œ' */ + 0x7c, /* 01111100 */ + 0x82, /* 10000010 */ + 0x38, /* 00111000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* 141 0x8d '' */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x38, /* 00111000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* 142 0x8e 'Ž' */ + 0xc6, /* 11000110 */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0xc6, /* 11000110 */ + 0xfe, /* 11111110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + + /* 143 0x8f '' */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xfe, /* 11111110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + + /* 144 0x90 '' */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0xfe, /* 11111110 */ + 0xc0, /* 11000000 */ + 0xf8, /* 11111000 */ + 0xc0, /* 11000000 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + + /* 145 0x91 '‘' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x18, /* 00011000 */ + 0x7e, /* 01111110 */ + 0xd8, /* 11011000 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + + /* 146 0x92 '’' */ + 0x3e, /* 00111110 */ + 0x6c, /* 01101100 */ + 0xcc, /* 11001100 */ + 0xfe, /* 11111110 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xce, /* 11001110 */ + 0x00, /* 00000000 */ + + /* 147 0x93 '“' */ + 0x7c, /* 01111100 */ + 0x82, /* 10000010 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* 148 0x94 '”' */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* 149 0x95 '•' */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* 150 0x96 '–' */ + 0x78, /* 01111000 */ + 0x84, /* 10000100 */ + 0x00, /* 00000000 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* 151 0x97 '—' */ + 0x60, /* 01100000 */ + 0x30, /* 00110000 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* 152 0x98 '˜' */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7e, /* 01111110 */ + 0x06, /* 00000110 */ + 0xfc, /* 11111100 */ + + /* 153 0x99 '™' */ + 0xc6, /* 11000110 */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x6c, /* 01101100 */ + 0x38, /* 00111000 */ + 0x00, /* 00000000 */ + + /* 154 0x9a 'š' */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* 155 0x9b '›' */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x7e, /* 01111110 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0x7e, /* 01111110 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* 156 0x9c 'œ' */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0x64, /* 01100100 */ + 0xf0, /* 11110000 */ + 0x60, /* 01100000 */ + 0x66, /* 01100110 */ + 0xfc, /* 11111100 */ + 0x00, /* 00000000 */ + + /* 157 0x9d '' */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x7e, /* 01111110 */ + 0x18, /* 00011000 */ + 0x7e, /* 01111110 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* 158 0x9e 'ž' */ + 0xf8, /* 11111000 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xfa, /* 11111010 */ + 0xc6, /* 11000110 */ + 0xcf, /* 11001111 */ + 0xc6, /* 11000110 */ + 0xc7, /* 11000111 */ + + /* 159 0x9f 'Ÿ' */ + 0x0e, /* 00001110 */ + 0x1b, /* 00011011 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0xd8, /* 11011000 */ + 0x70, /* 01110000 */ + 0x00, /* 00000000 */ + + /* 160 0xa0 ' ' */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x78, /* 01111000 */ + 0x0c, /* 00001100 */ + 0x7c, /* 01111100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* 161 0xa1 '¡' */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x38, /* 00111000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* 162 0xa2 '¢' */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* 163 0xa3 '£' */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* 164 0xa4 '¤' */ + 0x76, /* 01110110 */ + 0xdc, /* 11011100 */ + 0x00, /* 00000000 */ + 0xdc, /* 11011100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x00, /* 00000000 */ + + /* 165 0xa5 '¥' */ + 0x76, /* 01110110 */ + 0xdc, /* 11011100 */ + 0x00, /* 00000000 */ + 0xe6, /* 11100110 */ + 0xf6, /* 11110110 */ + 0xde, /* 11011110 */ + 0xce, /* 11001110 */ + 0x00, /* 00000000 */ + + /* 166 0xa6 '¦' */ + 0x3c, /* 00111100 */ + 0x6c, /* 01101100 */ + 0x6c, /* 01101100 */ + 0x3e, /* 00111110 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 167 0xa7 '§' */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0x6c, /* 01101100 */ + 0x38, /* 00111000 */ + 0x00, /* 00000000 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 168 0xa8 '¨' */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x63, /* 01100011 */ + 0x3e, /* 00111110 */ + 0x00, /* 00000000 */ + + /* 169 0xa9 '©' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xfe, /* 11111110 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 170 0xaa 'ª' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xfe, /* 11111110 */ + 0x06, /* 00000110 */ + 0x06, /* 00000110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 171 0xab '«' */ + 0x63, /* 01100011 */ + 0xe6, /* 11100110 */ + 0x6c, /* 01101100 */ + 0x7e, /* 01111110 */ + 0x33, /* 00110011 */ + 0x66, /* 01100110 */ + 0xcc, /* 11001100 */ + 0x0f, /* 00001111 */ + + /* 172 0xac '¬' */ + 0x63, /* 01100011 */ + 0xe6, /* 11100110 */ + 0x6c, /* 01101100 */ + 0x7a, /* 01111010 */ + 0x36, /* 00110110 */ + 0x6a, /* 01101010 */ + 0xdf, /* 11011111 */ + 0x06, /* 00000110 */ + + /* 173 0xad '­' */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + + /* 174 0xae '®' */ + 0x00, /* 00000000 */ + 0x33, /* 00110011 */ + 0x66, /* 01100110 */ + 0xcc, /* 11001100 */ + 0x66, /* 01100110 */ + 0x33, /* 00110011 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 175 0xaf '¯' */ + 0x00, /* 00000000 */ + 0xcc, /* 11001100 */ + 0x66, /* 01100110 */ + 0x33, /* 00110011 */ + 0x66, /* 01100110 */ + 0xcc, /* 11001100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 176 0xb0 '°' */ + 0x22, /* 00100010 */ + 0x88, /* 10001000 */ + 0x22, /* 00100010 */ + 0x88, /* 10001000 */ + 0x22, /* 00100010 */ + 0x88, /* 10001000 */ + 0x22, /* 00100010 */ + 0x88, /* 10001000 */ + + /* 177 0xb1 '±' */ + 0x55, /* 01010101 */ + 0xaa, /* 10101010 */ + 0x55, /* 01010101 */ + 0xaa, /* 10101010 */ + 0x55, /* 01010101 */ + 0xaa, /* 10101010 */ + 0x55, /* 01010101 */ + 0xaa, /* 10101010 */ + + /* 178 0xb2 '²' */ + 0x77, /* 01110111 */ + 0xdd, /* 11011101 */ + 0x77, /* 01110111 */ + 0xdd, /* 11011101 */ + 0x77, /* 01110111 */ + 0xdd, /* 11011101 */ + 0x77, /* 01110111 */ + 0xdd, /* 11011101 */ + + /* 179 0xb3 '³' */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* 180 0xb4 '´' */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0xf8, /* 11111000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* 181 0xb5 'µ' */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0xf8, /* 11111000 */ + 0x18, /* 00011000 */ + 0xf8, /* 11111000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* 182 0xb6 '¶' */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0xf6, /* 11110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* 183 0xb7 '·' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xfe, /* 11111110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* 184 0xb8 '¸' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xf8, /* 11111000 */ + 0x18, /* 00011000 */ + 0xf8, /* 11111000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* 185 0xb9 '¹' */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0xf6, /* 11110110 */ + 0x06, /* 00000110 */ + 0xf6, /* 11110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* 186 0xba 'º' */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* 187 0xbb '»' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xfe, /* 11111110 */ + 0x06, /* 00000110 */ + 0xf6, /* 11110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* 188 0xbc '¼' */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0xf6, /* 11110110 */ + 0x06, /* 00000110 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 189 0xbd '½' */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 190 0xbe '¾' */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0xf8, /* 11111000 */ + 0x18, /* 00011000 */ + 0xf8, /* 11111000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 191 0xbf '¿' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xf8, /* 11111000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* 192 0xc0 'À' */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x1f, /* 00011111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 193 0xc1 'Á' */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 194 0xc2 'Â' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* 195 0xc3 'Ã' */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x1f, /* 00011111 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* 196 0xc4 'Ä' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 197 0xc5 'Å' */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0xff, /* 11111111 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* 198 0xc6 'Æ' */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x1f, /* 00011111 */ + 0x18, /* 00011000 */ + 0x1f, /* 00011111 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* 199 0xc7 'Ç' */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x37, /* 00110111 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* 200 0xc8 'È' */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x37, /* 00110111 */ + 0x30, /* 00110000 */ + 0x3f, /* 00111111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 201 0xc9 'É' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x3f, /* 00111111 */ + 0x30, /* 00110000 */ + 0x37, /* 00110111 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* 202 0xca 'Ê' */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0xf7, /* 11110111 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 203 0xcb 'Ë' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0xf7, /* 11110111 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* 204 0xcc 'Ì' */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x37, /* 00110111 */ + 0x30, /* 00110000 */ + 0x37, /* 00110111 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* 205 0xcd 'Í' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 206 0xce 'Î' */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0xf7, /* 11110111 */ + 0x00, /* 00000000 */ + 0xf7, /* 11110111 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* 207 0xcf 'Ï' */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 208 0xd0 'Ð' */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 209 0xd1 'Ñ' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* 210 0xd2 'Ò' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* 211 0xd3 'Ó' */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x3f, /* 00111111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 212 0xd4 'Ô' */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x1f, /* 00011111 */ + 0x18, /* 00011000 */ + 0x1f, /* 00011111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 213 0xd5 'Õ' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x1f, /* 00011111 */ + 0x18, /* 00011000 */ + 0x1f, /* 00011111 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* 214 0xd6 'Ö' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x3f, /* 00111111 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* 215 0xd7 '×' */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0xff, /* 11111111 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* 216 0xd8 'Ø' */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0xff, /* 11111111 */ + 0x18, /* 00011000 */ + 0xff, /* 11111111 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* 217 0xd9 'Ù' */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0xf8, /* 11111000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 218 0xda 'Ú' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x1f, /* 00011111 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* 219 0xdb 'Û' */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + + /* 220 0xdc 'Ü' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + + /* 221 0xdd 'Ý' */ + 0xf0, /* 11110000 */ + 0xf0, /* 11110000 */ + 0xf0, /* 11110000 */ + 0xf0, /* 11110000 */ + 0xf0, /* 11110000 */ + 0xf0, /* 11110000 */ + 0xf0, /* 11110000 */ + 0xf0, /* 11110000 */ + + /* 222 0xde 'Þ' */ + 0x0f, /* 00001111 */ + 0x0f, /* 00001111 */ + 0x0f, /* 00001111 */ + 0x0f, /* 00001111 */ + 0x0f, /* 00001111 */ + 0x0f, /* 00001111 */ + 0x0f, /* 00001111 */ + 0x0f, /* 00001111 */ + + /* 223 0xdf 'ß' */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 224 0xe0 'à' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x76, /* 01110110 */ + 0xdc, /* 11011100 */ + 0xc8, /* 11001000 */ + 0xdc, /* 11011100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* 225 0xe1 'á' */ + 0x78, /* 01111000 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xd8, /* 11011000 */ + 0xcc, /* 11001100 */ + 0xc6, /* 11000110 */ + 0xcc, /* 11001100 */ + 0x00, /* 00000000 */ + + /* 226 0xe2 'â' */ + 0xfe, /* 11111110 */ + 0xc6, /* 11000110 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0x00, /* 00000000 */ + + /* 227 0xe3 'ã' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xfe, /* 11111110 */ + 0x6c, /* 01101100 */ + 0x6c, /* 01101100 */ + 0x6c, /* 01101100 */ + 0x6c, /* 01101100 */ + 0x00, /* 00000000 */ + + /* 228 0xe4 'ä' */ + 0xfe, /* 11111110 */ + 0xc6, /* 11000110 */ + 0x60, /* 01100000 */ + 0x30, /* 00110000 */ + 0x60, /* 01100000 */ + 0xc6, /* 11000110 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + + /* 229 0xe5 'å' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0xd8, /* 11011000 */ + 0xd8, /* 11011000 */ + 0xd8, /* 11011000 */ + 0x70, /* 01110000 */ + 0x00, /* 00000000 */ + + /* 230 0xe6 'æ' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x7c, /* 01111100 */ + 0xc0, /* 11000000 */ + + /* 231 0xe7 'ç' */ + 0x00, /* 00000000 */ + 0x76, /* 01110110 */ + 0xdc, /* 11011100 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + + /* 232 0xe8 'è' */ + 0x7e, /* 01111110 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0x7e, /* 01111110 */ + + /* 233 0xe9 'é' */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0xc6, /* 11000110 */ + 0xfe, /* 11111110 */ + 0xc6, /* 11000110 */ + 0x6c, /* 01101100 */ + 0x38, /* 00111000 */ + 0x00, /* 00000000 */ + + /* 234 0xea 'ê' */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x6c, /* 01101100 */ + 0x6c, /* 01101100 */ + 0xee, /* 11101110 */ + 0x00, /* 00000000 */ + + /* 235 0xeb 'ë' */ + 0x0e, /* 00001110 */ + 0x18, /* 00011000 */ + 0x0c, /* 00001100 */ + 0x3e, /* 00111110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* 236 0xec 'ì' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0xdb, /* 11011011 */ + 0xdb, /* 11011011 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 237 0xed 'í' */ + 0x06, /* 00000110 */ + 0x0c, /* 00001100 */ + 0x7e, /* 01111110 */ + 0xdb, /* 11011011 */ + 0xdb, /* 11011011 */ + 0x7e, /* 01111110 */ + 0x60, /* 01100000 */ + 0xc0, /* 11000000 */ + + /* 238 0xee 'î' */ + 0x1e, /* 00011110 */ + 0x30, /* 00110000 */ + 0x60, /* 01100000 */ + 0x7e, /* 01111110 */ + 0x60, /* 01100000 */ + 0x30, /* 00110000 */ + 0x1e, /* 00011110 */ + 0x00, /* 00000000 */ + + /* 239 0xef 'ï' */ + 0x00, /* 00000000 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + + /* 240 0xf0 'ð' */ + 0x00, /* 00000000 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 241 0xf1 'ñ' */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x7e, /* 01111110 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + + /* 242 0xf2 'ò' */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + + /* 243 0xf3 'ó' */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x0c, /* 00001100 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + + /* 244 0xf4 'ô' */ + 0x0e, /* 00001110 */ + 0x1b, /* 00011011 */ + 0x1b, /* 00011011 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* 245 0xf5 'õ' */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0xd8, /* 11011000 */ + 0xd8, /* 11011000 */ + 0x70, /* 01110000 */ + + /* 246 0xf6 'ö' */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 247 0xf7 '÷' */ + 0x00, /* 00000000 */ + 0x76, /* 01110110 */ + 0xdc, /* 11011100 */ + 0x00, /* 00000000 */ + 0x76, /* 01110110 */ + 0xdc, /* 11011100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 248 0xf8 'ø' */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0x6c, /* 01101100 */ + 0x38, /* 00111000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 249 0xf9 'ù' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 250 0xfa 'ú' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 251 0xfb 'û' */ + 0x0f, /* 00001111 */ + 0x0c, /* 00001100 */ + 0x0c, /* 00001100 */ + 0x0c, /* 00001100 */ + 0xec, /* 11101100 */ + 0x6c, /* 01101100 */ + 0x3c, /* 00111100 */ + 0x1c, /* 00011100 */ + + /* 252 0xfc 'ü' */ + 0x6c, /* 01101100 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 253 0xfd 'ý' */ + 0x78, /* 01111000 */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 254 0xfe 'þ' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x3c, /* 00111100 */ + 0x3c, /* 00111100 */ + 0x3c, /* 00111100 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 255 0xff 'ÿ' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ }; diff --git a/src/extralibs/hsusb_v30x.c b/src/extralibs/hsusb_v30x.c index 73aabfb..055375b 100644 --- a/src/extralibs/hsusb_v30x.c +++ b/src/extralibs/hsusb_v30x.c @@ -2,29 +2,29 @@ #include "ch32fun.h" #include -#define UEP_CTRL_H(n) (((uint16_t *)&USBHSD->UEP0_TX_CTRL)[n * 2]) +#define UEP_CTRL_H(n) (((uint16_t*)&USBHSD->UEP0_TX_CTRL)[n*2]) struct _USBState HSUSBCTX; // based on https://github.com/openwch/ch32v307/blob/main/EVT/EXAM/USB/USBHS/DEVICE/CompositeKM // Mask for the combined USBHSD->INT_FG + USBHSD->INT_ST -#define CRB_U_IS_NAK (1 << 7) -#define CTOG_MATCH_SYNC (1 << 6) -#define CRB_UIF_SETUP_ACT (1 << 5) // CRB_U_SIE_FREE on USBFS -#define CRB_UIF_FIFO_OV (1 << 4) -#define CRB_UIF_HST_SOF (1 << 3) -#define CRB_UIF_SUSPEND (1 << 2) -#define CRB_UIF_TRANSFER (1 << 1) -#define CRB_UIF_BUS_RST (1 << 0) -#define CSETUP_ACT (1 << 15) -#define CRB_UIS_TOG_OK (1 << 14) -#define CMASK_UIS_TOKEN (3 << 12) -#define CMASK_UIS_ENDP (0xf << 8) +#define CRB_U_IS_NAK (1<<7) +#define CTOG_MATCH_SYNC (1<<6) +#define CRB_UIF_SETUP_ACT (1<<5) // CRB_U_SIE_FREE on USBFS +#define CRB_UIF_FIFO_OV (1<<4) +#define CRB_UIF_HST_SOF (1<<3) +#define CRB_UIF_SUSPEND (1<<2) +#define CRB_UIF_TRANSFER (1<<1) +#define CRB_UIF_BUS_RST (1<<0) +#define CSETUP_ACT (1<<15) +#define CRB_UIS_TOG_OK (1<<14) +#define CMASK_UIS_TOKEN (3<<12) +#define CMASK_UIS_ENDP (0xf<<8) -#define CUIS_TOKEN_OUT 0x0 -#define CUIS_TOKEN_SOF 0x1 -#define CUIS_TOKEN_IN 0x2 +#define CUIS_TOKEN_OUT 0x0 +#define CUIS_TOKEN_SOF 0x1 +#define CUIS_TOKEN_IN 0x2 #define CUIS_TOKEN_SETUP 0x3 #if 0 @@ -44,7 +44,7 @@ static inline void DMA7FastCopy( uint8_t * dest, const uint8_t * src, int len ) DMA_MemoryInc_Enable | DMA_PeripheralInc_Enable | DMA_Mode_Normal | DMA_CFGR1_EN; -#if !(FUSB_CURSED_TURBO_DMA == 1) +#if !( FUSB_CURSED_TURBO_DMA == 1 ) // Somehow, it seems to work (unsafely) without this. // Really, though, it's probably fine. while( DMA1_Channel7->CNTR ); @@ -57,595 +57,607 @@ static inline void DMA7FastCopyComplete() { while( DMA1_Channel7->CNTR ); } void USBHS_InternalFinishSetup(); -// void USBHSWakeUp_IRQHandler(void) __attribute((interrupt)); -// void USBHSWakeUp_IRQHandler(void) +//void USBHSWakeUp_IRQHandler(void) __attribute((interrupt)); +//void USBHSWakeUp_IRQHandler(void) //{ // printf( "USBHSWakeUp MSTATUS:%08x MTVAL:%08x MCAUSE:%08x MEPC:%08x\n", (int)__get_MSTATUS(), (int)__get_MTVAL(), (int)__get_MCAUSE(), (int)__get_MEPC() ); -// } +//} extern uint8_t scratchpad[]; -void USBHS_IRQHandler(void) __attribute((interrupt)); -void USBHS_IRQHandler(void) +void USBHS_IRQHandler(void) __attribute((interrupt)); +void USBHS_IRQHandler(void) { - // Based on https://github.com/openwch/ch32v307/blob/main/EVT/EXAM/USB/USBHS/DEVICE/CompositeKM/User/ch32v30x_usbhs_device.c - // Combined FG + ST flag - uint16_t intfgst = *(uint16_t *)(&USBHSD->INT_FG); - int len = 0; - struct _USBState *ctx = &HSUSBCTX; - uint8_t *ctrl0buff = CTRL0BUFF; + // Based on https://github.com/openwch/ch32v307/blob/main/EVT/EXAM/USB/USBHS/DEVICE/CompositeKM/User/ch32v30x_usbhs_device.c + // Combined FG + ST flag + uint16_t intfgst = *(uint16_t*)(&USBHSD->INT_FG); + int len = 0; + struct _USBState * ctx = &HSUSBCTX; + uint8_t * ctrl0buff = CTRL0BUFF; - if (intfgst & (CRB_UIF_SETUP_ACT)) - { - // On the Chapter 22 USB, SETUP Requests are handled here instead of in UIF_TRANSFER, with TOKEN_SETUP. - USBHSD->UEP0_TX_CTRL = USBHS_UEP_T_TOG_DATA1 | USBHS_UEP_T_RES_ACK; - USBHSD->UEP0_RX_CTRL = USBHS_UEP_R_TOG_DATA1 | USBHS_UEP_R_RES_ACK; + if( intfgst & ( CRB_UIF_SETUP_ACT ) ) + { + // On the Chapter 22 USB, SETUP Requests are handled here instead of in UIF_TRANSFER, with TOKEN_SETUP. + USBHSD->UEP0_TX_CTRL = USBHS_UEP_T_TOG_DATA1 | USBHS_UEP_T_RES_ACK; + USBHSD->UEP0_RX_CTRL = USBHS_UEP_R_TOG_DATA1 | USBHS_UEP_R_RES_ACK; - /* Store All Setup Values */ - int USBHS_SetupReqType = HSUSBCTX.USBHS_SetupReqType = pUSBHS_SetupReqPak->bmRequestType; - int USBHS_SetupReqCode = HSUSBCTX.USBHS_SetupReqCode = pUSBHS_SetupReqPak->bRequest; - int USBHS_SetupReqLen = HSUSBCTX.USBHS_SetupReqLen = pUSBHS_SetupReqPak->wLength; - int USBHS_SetupReqIndex = pUSBHS_SetupReqPak->wIndex; - int USBHS_IndexValue = HSUSBCTX.USBHS_IndexValue = (pUSBHS_SetupReqPak->wIndex << 16) | pUSBHS_SetupReqPak->wValue; - len = 0; + /* Store All Setup Values */ + int USBHS_SetupReqType = HSUSBCTX.USBHS_SetupReqType = pUSBHS_SetupReqPak->bmRequestType; + int USBHS_SetupReqCode = HSUSBCTX.USBHS_SetupReqCode = pUSBHS_SetupReqPak->bRequest; + int USBHS_SetupReqLen = HSUSBCTX.USBHS_SetupReqLen = pUSBHS_SetupReqPak->wLength; + int USBHS_SetupReqIndex = pUSBHS_SetupReqPak->wIndex; + int USBHS_IndexValue = HSUSBCTX.USBHS_IndexValue = ( pUSBHS_SetupReqPak->wIndex << 16 ) | pUSBHS_SetupReqPak->wValue; + len = 0; - // printf( "Setup: %d %d %d %d %d\n", USBHS_SetupReqType, USBHS_SetupReqCode, USBHS_SetupReqLen, - // USBHS_SetupReqIndex, USBHS_IndexValue ); + //printf( "Setup: %d %d %d %d %d\n", USBHS_SetupReqType, USBHS_SetupReqCode, USBHS_SetupReqLen, + // USBHS_SetupReqIndex, USBHS_IndexValue ); - if ((USBHS_SetupReqType & USB_REQ_TYP_MASK) != USB_REQ_TYP_STANDARD) - { -#if HUSB_HID_INTERFACES > 0 - if ((USBHS_SetupReqType & USB_REQ_TYP_MASK) == USB_REQ_TYP_CLASS) - { - /* Class Request */ - // printf( "REQ: %d [%02x %02x %04x %04x]\n", USBHS_SetupReqCode, pUSBHS_SetupReqPak->bmRequestType, pUSBHS_SetupReqPak->bRequest, pUSBHS_SetupReqPak->wValue, pUSBHS_SetupReqPak->wLength ); - switch (USBHS_SetupReqCode) - { - case HID_SET_REPORT: + if( ( USBHS_SetupReqType & USB_REQ_TYP_MASK ) != USB_REQ_TYP_STANDARD ) + { +#if HUSB_HID_INTERFACES > 0 + if( ( USBHS_SetupReqType & USB_REQ_TYP_MASK ) == USB_REQ_TYP_CLASS ) + { + /* Class Request */ + //printf( "REQ: %d [%02x %02x %04x %04x]\n", USBHS_SetupReqCode, pUSBHS_SetupReqPak->bmRequestType, pUSBHS_SetupReqPak->bRequest, pUSBHS_SetupReqPak->wValue, pUSBHS_SetupReqPak->wLength ); + switch( USBHS_SetupReqCode ) + { + case HID_SET_REPORT: #if HUSB_HID_USER_REPORTS - len = HandleHidUserSetReportSetup(ctx, pUSBHS_SetupReqPak); - if (len < 0) goto sendstall; - ctx->USBHS_SetupReqLen = len; - USBHSD->UEP0_TX_LEN = 0; - USBHSD->UEP0_RX_CTRL = USBHS_UEP_R_TOG_DATA1 | USBHS_UEP_R_RES_ACK; - USBHSD->UEP0_TX_CTRL = USBHS_UEP_T_TOG_DATA1; - goto replycomplete; - case HID_GET_REPORT: - len = HandleHidUserGetReportSetup(ctx, pUSBHS_SetupReqPak); - if (len < 0) goto sendstall; - ctx->USBHS_SetupReqLen = len; - len = len >= DEF_USBD_UEP0_SIZE ? DEF_USBD_UEP0_SIZE : len; - if (!ctx->pCtrlPayloadPtr) - { - len = HandleHidUserReportDataIn(ctx, ctrl0buff, len); - } - else - { - // DMA7FastCopy( ctrl0buff, ctx->pCtrlPayloadPtr, len ); - memcpy(ctrl0buff, ctx->pCtrlPayloadPtr, len); - ctx->pCtrlPayloadPtr += len; - } - USBHSD->UEP0_TX_LEN = len; - USBHSD->UEP0_TX_CTRL = USBHS_UEP_T_TOG_DATA1 | USBHS_UEP_T_RES_ACK; - ctx->USBHS_SetupReqLen -= len; - goto replycomplete; + len = HandleHidUserSetReportSetup( ctx, pUSBHS_SetupReqPak ); + if( len < 0 ) goto sendstall; + ctx->USBHS_SetupReqLen = len; + USBHSD->UEP0_TX_LEN = 0; + USBHSD->UEP0_RX_CTRL = USBHS_UEP_R_TOG_DATA1 | USBHS_UEP_R_RES_ACK; + USBHSD->UEP0_TX_CTRL = USBHS_UEP_T_TOG_DATA1; + goto replycomplete; + case HID_GET_REPORT: + len = HandleHidUserGetReportSetup( ctx, pUSBHS_SetupReqPak ); + if( len < 0 ) goto sendstall; + ctx->USBHS_SetupReqLen = len; + len = len >= DEF_USBD_UEP0_SIZE ? DEF_USBD_UEP0_SIZE : len; + if( !ctx->pCtrlPayloadPtr ) + { + len = HandleHidUserReportDataIn( ctx, ctrl0buff, len ); + } + else + { + //DMA7FastCopy( ctrl0buff, ctx->pCtrlPayloadPtr, len ); + memcpy( ctrl0buff, ctx->pCtrlPayloadPtr, len ); + ctx->pCtrlPayloadPtr += len; + } + USBHSD->UEP0_TX_LEN = len; + USBHSD->UEP0_TX_CTRL = USBHS_UEP_T_TOG_DATA1 | USBHS_UEP_T_RES_ACK; + ctx->USBHS_SetupReqLen -= len; + goto replycomplete; #endif - break; + break; - case HID_SET_IDLE: - if (USBHS_SetupReqIndex < HUSB_HID_INTERFACES) - HSUSBCTX.USBHS_HidIdle[USBHS_SetupReqIndex] = (uint8_t)(USBHS_IndexValue >> 8); - break; - case HID_SET_PROTOCOL: - if (USBHS_SetupReqIndex < HUSB_HID_INTERFACES) - HSUSBCTX.USBHS_HidProtocol[USBHS_SetupReqIndex] = (uint8_t)USBHS_IndexValue; - break; - case HID_GET_IDLE: - if (USBHS_SetupReqIndex < HUSB_HID_INTERFACES) - { - ctrl0buff[0] = HSUSBCTX.USBHS_HidIdle[USBHS_SetupReqIndex]; - len = 1; - } - break; + case HID_SET_IDLE: + if( USBHS_SetupReqIndex < HUSB_HID_INTERFACES ) + HSUSBCTX.USBHS_HidIdle[ USBHS_SetupReqIndex ] = (uint8_t)( USBHS_IndexValue >> 8 ); + break; + case HID_SET_PROTOCOL: + if ( USBHS_SetupReqIndex < HUSB_HID_INTERFACES ) + HSUSBCTX.USBHS_HidProtocol[USBHS_SetupReqIndex] = (uint8_t)USBHS_IndexValue; + break; - case HID_GET_PROTOCOL: - if (USBHS_SetupReqIndex < HUSB_HID_INTERFACES) - { - ctrl0buff[0] = HSUSBCTX.USBHS_HidProtocol[USBHS_SetupReqIndex]; - len = 1; - } - break; + case HID_GET_IDLE: + if( USBHS_SetupReqIndex < HUSB_HID_INTERFACES ) + { + ctrl0buff[0] = HSUSBCTX.USBHS_HidIdle[ USBHS_SetupReqIndex ]; + len = 1; + } + break; - default: - goto sendstall; - break; - } - } + case HID_GET_PROTOCOL: + if( USBHS_SetupReqIndex < HUSB_HID_INTERFACES ) + { + ctrl0buff[0] = HSUSBCTX.USBHS_HidProtocol[ USBHS_SetupReqIndex ]; + len = 1; + } + break; + + default: + goto sendstall; + break; + } + } #else - ; + ; #endif - } - else - { - /* usb standard request processing */ - switch (USBHS_SetupReqCode) - { - /* get device/configuration/string/report/... descriptors */ - case USB_GET_DESCRIPTOR: - { - const struct descriptor_list_struct *e = descriptor_list; - const struct descriptor_list_struct *e_end = e + DESCRIPTOR_LIST_ENTRIES; - for (; e != e_end; e++) - { - if (e->lIndexValue == USBHS_IndexValue) - { - ctx->pCtrlPayloadPtr = (uint8_t *)e->addr; - len = e->length; - break; - } - } - if (e == e_end) - { - goto sendstall; - } + } + else + { + /* usb standard request processing */ + switch( USBHS_SetupReqCode ) + { + /* get device/configuration/string/report/... descriptors */ + case USB_GET_DESCRIPTOR: + { + const struct descriptor_list_struct * e = descriptor_list; + const struct descriptor_list_struct * e_end = e + DESCRIPTOR_LIST_ENTRIES; + for( ; e != e_end; e++ ) + { + if( e->lIndexValue == USBHS_IndexValue ) + { + ctx->pCtrlPayloadPtr = (uint8_t*)e->addr; + len = e->length; + break; + } + } + if( e == e_end ) + { + goto sendstall; + } - /* Copy Descriptors to Endp0 DMA buffer */ - int totalLen = USBHS_SetupReqLen; - if (totalLen > len) - { - totalLen = len; - } - len = (totalLen >= DEF_USBD_UEP0_SIZE) ? DEF_USBD_UEP0_SIZE : totalLen; - // DMA7FastCopy( ctrl0buff, ctx->pCtrlPayloadPtr, len ); //memcpy( CTRL0BUFF, ctx->pCtrlPayloadPtr, len ); - memcpy(ctrl0buff, ctx->pCtrlPayloadPtr, len); - ctx->USBHS_SetupReqLen = totalLen - len; - ctx->pCtrlPayloadPtr += len; - USBHSD->UEP0_TX_LEN = len; - USBHSD->UEP0_TX_CTRL = USBHS_UEP_T_TOG_DATA1 | USBHS_UEP_T_RES_ACK; - goto replycomplete; - } - /* Set usb address */ - case USB_SET_ADDRESS: - ctx->USBHS_DevAddr = (uint16_t)(ctx->USBHS_IndexValue & 0xFF); - break; + /* Copy Descriptors to Endp0 DMA buffer */ + int totalLen = USBHS_SetupReqLen; + if( totalLen > len ) + { + totalLen = len; + } + len = ( totalLen >= DEF_USBD_UEP0_SIZE ) ? DEF_USBD_UEP0_SIZE : totalLen; + //DMA7FastCopy( ctrl0buff, ctx->pCtrlPayloadPtr, len ); //memcpy( CTRL0BUFF, ctx->pCtrlPayloadPtr, len ); + memcpy( ctrl0buff, ctx->pCtrlPayloadPtr, len ); + ctx->USBHS_SetupReqLen = totalLen - len; + ctx->pCtrlPayloadPtr += len; + USBHSD->UEP0_TX_LEN = len; + USBHSD->UEP0_TX_CTRL = USBHS_UEP_T_TOG_DATA1 | USBHS_UEP_T_RES_ACK; + goto replycomplete; + } - /* Get usb configuration now set */ - case USB_GET_CONFIGURATION: - ctrl0buff[0] = ctx->USBHS_DevConfig; - if (ctx->USBHS_SetupReqLen > 1) - ctx->USBHS_SetupReqLen = 1; - break; + /* Set usb address */ + case USB_SET_ADDRESS: + ctx->USBHS_DevAddr = (uint16_t)( ctx->USBHS_IndexValue & 0xFF ); + break; - /* Set usb configuration to use */ - case USB_SET_CONFIGURATION: - ctx->USBHS_DevConfig = (uint8_t)(ctx->USBHS_IndexValue & 0xFF); - ctx->USBHS_DevEnumStatus = 0x01; - break; + /* Get usb configuration now set */ + case USB_GET_CONFIGURATION: + ctrl0buff[0] = ctx->USBHS_DevConfig; + if( ctx->USBHS_SetupReqLen > 1 ) + ctx->USBHS_SetupReqLen = 1; + break; - /* Clear or disable one usb feature */ - case USB_CLEAR_FEATURE: + /* Set usb configuration to use */ + case USB_SET_CONFIGURATION: + ctx->USBHS_DevConfig = (uint8_t)( ctx->USBHS_IndexValue & 0xFF ); + ctx->USBHS_DevEnumStatus = 0x01; + break; + + /* Clear or disable one usb feature */ + case USB_CLEAR_FEATURE: #if HUSB_SUPPORTS_SLEEP - if ((USBHS_SetupReqType & USB_REQ_RECIP_MASK) == USB_REQ_RECIP_DEVICE) - { - /* clear one device feature */ - if ((uint8_t)(USBHS_IndexValue & 0xFF) == USB_REQ_FEAT_REMOTE_WAKEUP) - { - /* clear usb sleep status, device not prepare to sleep */ - ctx->USBHS_DevSleepStatus &= ~0x01; - } - else - { - goto sendstall; - } - } - else + if( ( USBHS_SetupReqType & USB_REQ_RECIP_MASK ) == USB_REQ_RECIP_DEVICE ) + { + /* clear one device feature */ + if( (uint8_t)( USBHS_IndexValue & 0xFF ) == USB_REQ_FEAT_REMOTE_WAKEUP ) + { + /* clear usb sleep status, device not prepare to sleep */ + ctx->USBHS_DevSleepStatus &= ~0x01; + } + else + { + goto sendstall; + } + } + else #endif - if ((USBHS_SetupReqType & USB_REQ_RECIP_MASK) == USB_REQ_RECIP_ENDP) - { - if ((uint8_t)(USBHS_IndexValue & 0xFF) == USB_REQ_FEAT_ENDP_HALT) - { - /* Clear End-point Feature */ - int ep = USBHS_SetupReqIndex & 0xf; - if ((USBHS_SetupReqIndex & DEF_UEP_IN) && ep < HUSB_CONFIG_EPS) - { - UEP_CTRL_H(ep) = USBHS_UEP_T_TOG_DATA0 | USBHS_UEP_T_RES_NAK; - } - else - { - goto sendstall; - } - } - else - { - goto sendstall; - } - } - else - { - goto sendstall; - } - break; + if( ( USBHS_SetupReqType & USB_REQ_RECIP_MASK ) == USB_REQ_RECIP_ENDP ) + { + if( (uint8_t)( USBHS_IndexValue & 0xFF ) == USB_REQ_FEAT_ENDP_HALT ) + { + /* Clear End-point Feature */ + int ep = USBHS_SetupReqIndex & 0xf; + if( ( USBHS_SetupReqIndex & DEF_UEP_IN ) && ep < HUSB_CONFIG_EPS ) + { + UEP_CTRL_H(ep) = USBHS_UEP_T_TOG_DATA0 | USBHS_UEP_T_RES_NAK; + } + else + { + goto sendstall; + } + } + else + { + goto sendstall; + } + } + else + { + goto sendstall; + } + break; - /* set or enable one usb feature */ - case USB_SET_FEATURE: - if ((USBHS_SetupReqType & USB_REQ_RECIP_MASK) == USB_REQ_RECIP_DEVICE) - { + /* set or enable one usb feature */ + case USB_SET_FEATURE: + if( ( USBHS_SetupReqType & USB_REQ_RECIP_MASK ) == USB_REQ_RECIP_DEVICE ) + { #if HUSB_SUPPORTS_SLEEP - /* Set Device Feature */ - if ((uint8_t)(USBHS_IndexValue & 0xFF) == USB_REQ_FEAT_REMOTE_WAKEUP) - { - /* Set Wake-up flag, device prepare to sleep */ - USBHS_DevSleepStatus |= 0x01; - } - else + /* Set Device Feature */ + if( (uint8_t)( USBHS_IndexValue & 0xFF ) == USB_REQ_FEAT_REMOTE_WAKEUP ) + { + /* Set Wake-up flag, device prepare to sleep */ + USBHS_DevSleepStatus |= 0x01; + } + else #endif - { - goto sendstall; - } - } - else if ((USBHS_SetupReqType & USB_REQ_RECIP_MASK) == USB_REQ_RECIP_ENDP) - { - /* Set Endpoint Feature */ - if ((uint8_t)(USBHS_IndexValue & 0xFF) == USB_REQ_FEAT_ENDP_HALT) - { - int ep = USBHS_SetupReqIndex & 0xf; - if ((USBHS_SetupReqIndex & DEF_UEP_IN) && ep < HUSB_CONFIG_EPS) - UEP_CTRL_H(ep) = (UEP_CTRL_H(ep) & ~USBHS_UEP_T_RES_MASK) | USBHS_UEP_T_RES_STALL; - } - else - goto sendstall; - } - else - goto sendstall; - break; + { + goto sendstall; + } + } + else if( ( USBHS_SetupReqType & USB_REQ_RECIP_MASK ) == USB_REQ_RECIP_ENDP ) + { + /* Set Endpoint Feature */ + if( (uint8_t)( USBHS_IndexValue & 0xFF ) == USB_REQ_FEAT_ENDP_HALT ) + { + int ep = USBHS_SetupReqIndex & 0xf; + if( ( USBHS_SetupReqIndex & DEF_UEP_IN ) && ep < HUSB_CONFIG_EPS ) + UEP_CTRL_H(ep) = ( UEP_CTRL_H(ep) & ~USBHS_UEP_T_RES_MASK ) | USBHS_UEP_T_RES_STALL; + } + else + goto sendstall; + } + else + goto sendstall; + break; - /* This request allows the host to select another setting for the specified interface */ - case USB_GET_INTERFACE: - ctrl0buff[0] = 0x00; - if (USBHS_SetupReqLen > 1) USBHS_SetupReqLen = 1; - break; + /* This request allows the host to select another setting for the specified interface */ + case USB_GET_INTERFACE: + ctrl0buff[0] = 0x00; + if( USBHS_SetupReqLen > 1 ) USBHS_SetupReqLen = 1; + break; - case USB_SET_INTERFACE: - break; + case USB_SET_INTERFACE: + break; - /* host get status of specified device/interface/end-points */ - case USB_GET_STATUS: - ctrl0buff[0] = 0x00; - ctrl0buff[1] = 0x00; - if ((USBHS_SetupReqType & USB_REQ_RECIP_MASK) == USB_REQ_RECIP_DEVICE) - { + /* host get status of specified device/interface/end-points */ + case USB_GET_STATUS: + ctrl0buff[0] = 0x00; + ctrl0buff[1] = 0x00; + if( ( USBHS_SetupReqType & USB_REQ_RECIP_MASK ) == USB_REQ_RECIP_DEVICE ) + { #if FUSB_SUPPORTS_SLEEP - ctrl0buff[0] = (ctx->USBHS_DevSleepStatus & 0x01) << 1; + ctrl0buff[0] = (ctx->USBHS_DevSleepStatus & 0x01)<<1; #else - ctrl0buff[0] = 0x00; + ctrl0buff[0] = 0x00; #endif - } - else if ((USBHS_SetupReqType & USB_REQ_RECIP_MASK) == USB_REQ_RECIP_ENDP) - { - int ep = USBHS_SetupReqIndex & 0xf; - if ((USBHS_SetupReqIndex & DEF_UEP_IN) && ep < HUSB_CONFIG_EPS) - ctrl0buff[0] = (UEP_CTRL_H(ep) & USBHS_UEP_T_RES_MASK) == USBHS_UEP_T_RES_STALL; - else - goto sendstall; - } - else - goto sendstall; - if (USBHS_SetupReqLen > 2) - USBHS_SetupReqLen = 2; - break; + } + else if( ( USBHS_SetupReqType & USB_REQ_RECIP_MASK ) == USB_REQ_RECIP_ENDP ) + { + int ep = USBHS_SetupReqIndex & 0xf; + if( ( USBHS_SetupReqIndex & DEF_UEP_IN ) && ep < HUSB_CONFIG_EPS ) + ctrl0buff[0] = ( UEP_CTRL_H(ep) & USBHS_UEP_T_RES_MASK ) == USBHS_UEP_T_RES_STALL; + else + goto sendstall; + } + else + goto sendstall; + if( USBHS_SetupReqLen > 2 ) + USBHS_SetupReqLen = 2; + break; - default: - goto sendstall; - break; - } - } + default: + goto sendstall; + break; + } + } - { - /* end-point 0 data Tx/Rx */ - if (USBHS_SetupReqType & DEF_UEP_IN) - { - len = (USBHS_SetupReqLen > DEF_USBD_UEP0_SIZE) ? DEF_USBD_UEP0_SIZE : USBHS_SetupReqLen; - USBHS_SetupReqLen -= len; - USBHSD->UEP0_TX_LEN = len; - USBHSD->UEP0_TX_CTRL = USBHS_UEP_T_TOG_DATA1 | USBHS_UEP_T_RES_ACK; - } - else - { - if (USBHS_SetupReqLen == 0) - { - USBHSD->UEP0_TX_LEN = 0; - USBHSD->UEP0_TX_CTRL = USBHS_UEP_T_TOG_DATA1 | USBHS_UEP_T_RES_ACK; - } - else - { - USBHSD->UEP0_RX_CTRL = USBHS_UEP_R_TOG_DATA1 | USBHS_UEP_R_RES_ACK; - } - } - } - goto replycomplete; + { + /* end-point 0 data Tx/Rx */ + if( USBHS_SetupReqType & DEF_UEP_IN ) + { + len = ( USBHS_SetupReqLen > DEF_USBD_UEP0_SIZE )? DEF_USBD_UEP0_SIZE : USBHS_SetupReqLen; + USBHS_SetupReqLen -= len; + USBHSD->UEP0_TX_LEN = len; + USBHSD->UEP0_TX_CTRL = USBHS_UEP_T_TOG_DATA1 | USBHS_UEP_T_RES_ACK; + } + else + { + if( USBHS_SetupReqLen == 0 ) + { + USBHSD->UEP0_TX_LEN = 0; + USBHSD->UEP0_TX_CTRL = USBHS_UEP_T_TOG_DATA1 | USBHS_UEP_T_RES_ACK; + } + else + { + USBHSD->UEP0_RX_CTRL = USBHS_UEP_R_TOG_DATA1 | USBHS_UEP_R_RES_ACK; + } + } + } - // This might look a little weird, for error handling but it saves a nontrivial amount of storage, and simplifies - // control flow to hard-abort here. - sendstall: - // if one request not support, return stall. Stall means permanent error. - USBHSD->UEP0_TX_CTRL = USBHS_UEP_T_TOG_DATA1 | USBHS_UEP_T_RES_STALL; - USBHSD->UEP0_RX_CTRL = USBHS_UEP_R_TOG_DATA1 | USBHS_UEP_R_RES_STALL; - replycomplete:; - } - if (intfgst & (CRB_UIF_TRANSFER)) - { - int token = (intfgst & CMASK_UIS_TOKEN) >> 12; - int ep = (intfgst & CMASK_UIS_ENDP) >> 8; - switch (token) - { - case CUIS_TOKEN_IN: - if (ep) - { - if (ep < HUSB_CONFIG_EPS) - { - UEP_CTRL_H(ep) = (UEP_CTRL_H(ep) & ~USBHS_UEP_T_RES_MASK) | USBHS_UEP_T_RES_NAK; - UEP_CTRL_H(ep) ^= USBHS_UEP_T_TOG_DATA1; - ctx->USBHS_Endp_Busy[ep] = 0; - // Don't set EP in here. Wait for out. - // Optimization: Could we set EP here? - } - } - else - { - /* end-point 0 data in interrupt */ - if (ctx->USBHS_SetupReqLen == 0) - { - USBHSD->UEP0_RX_CTRL = USBHS_UEP_R_TOG_DATA1 | USBHS_UEP_R_RES_ACK; - } + goto replycomplete; - if (ctx->pCtrlPayloadPtr) - { - // Shortcut mechanism, for descriptors or if the user wants it. - len = ctx->USBHS_SetupReqLen >= DEF_USBD_UEP0_SIZE ? DEF_USBD_UEP0_SIZE : ctx->USBHS_SetupReqLen; - // DMA7FastCopy( ctrl0buff, ctx->pCtrlPayloadPtr, len ); // FYI -> Would need to do this if using DMA - memcpy(ctrl0buff, ctx->pCtrlPayloadPtr, len); - ctx->USBHS_SetupReqLen -= len; - if (ctx->USBHS_SetupReqLen > 0) - ctx->pCtrlPayloadPtr += len; - else - ctx->pCtrlPayloadPtr = 0; + // This might look a little weird, for error handling but it saves a nontrivial amount of storage, and simplifies + // control flow to hard-abort here. + sendstall: + // if one request not support, return stall. Stall means permanent error. + USBHSD->UEP0_TX_CTRL = USBHS_UEP_T_TOG_DATA1 | USBHS_UEP_T_RES_STALL; + USBHSD->UEP0_RX_CTRL = USBHS_UEP_R_TOG_DATA1 | USBHS_UEP_R_RES_STALL; + replycomplete: + ; + } + if( intfgst & ( CRB_UIF_TRANSFER ) ) + { + int token = ( intfgst & CMASK_UIS_TOKEN) >> 12; + int ep = ( intfgst & CMASK_UIS_ENDP ) >> 8; + switch ( token ) + { + case CUIS_TOKEN_IN: + if( ep ) + { + if( ep < HUSB_CONFIG_EPS ) + { + UEP_CTRL_H(ep) = ( UEP_CTRL_H(ep) & ~USBHS_UEP_T_RES_MASK ) | USBHS_UEP_T_RES_NAK; + UEP_CTRL_H(ep) ^= USBHS_UEP_T_TOG_DATA1; + ctx->USBHS_Endp_Busy[ ep ] = 0; + // Don't set EP in here. Wait for out. + // Optimization: Could we set EP here? + } + } + else + { + /* end-point 0 data in interrupt */ + if( ctx->USBHS_SetupReqLen == 0 ) + { + USBHSD->UEP0_RX_CTRL = USBHS_UEP_R_TOG_DATA1 | USBHS_UEP_R_RES_ACK; + } - USBHSD->UEP0_TX_LEN = len; - USBHSD->UEP0_TX_CTRL ^= USBHS_UEP_T_TOG_DATA1; - } - else if ((ctx->USBHS_SetupReqType & USB_REQ_TYP_MASK) != USB_REQ_TYP_STANDARD) - { -#if HUSB_HID_USER_REPORTS - len = ctx->USBHS_SetupReqLen >= DEF_USBD_UEP0_SIZE ? DEF_USBD_UEP0_SIZE : ctx->USBHS_SetupReqLen; - if (len && HSUSBCTX.USBHS_SetupReqCode == HID_GET_REPORT) - { - len = HandleHidUserReportDataIn(ctx, ctrl0buff, len); - USBHSD->UEP0_TX_LEN = len; - USBHSD->UEP0_TX_CTRL ^= USBHS_UEP_T_TOG_DATA1; - ctx->USBHS_SetupReqLen -= len; - ctx->pCtrlPayloadPtr += len; - } -#endif - } - else - { - switch (HSUSBCTX.USBHS_SetupReqCode) - { - case USB_GET_DESCRIPTOR: - break; + if( ctx->pCtrlPayloadPtr ) + { + // Shortcut mechanism, for descriptors or if the user wants it. + len = ctx->USBHS_SetupReqLen >= DEF_USBD_UEP0_SIZE ? DEF_USBD_UEP0_SIZE : ctx->USBHS_SetupReqLen; + //DMA7FastCopy( ctrl0buff, ctx->pCtrlPayloadPtr, len ); // FYI -> Would need to do this if using DMA + memcpy( ctrl0buff, ctx->pCtrlPayloadPtr, len ); + ctx->USBHS_SetupReqLen -= len; + if( ctx->USBHS_SetupReqLen > 0 ) + ctx->pCtrlPayloadPtr += len; + else + ctx->pCtrlPayloadPtr = 0; - case USB_SET_ADDRESS: - USBHSD->DEV_AD = ctx->USBHS_DevAddr; - break; - - default: - break; - } - } - } - - /* data-out stage processing */ - case CUIS_TOKEN_OUT: - switch (ep) - { - /* end-point 0 data out interrupt */ - case DEF_UEP0: - { - // XXX WARNINGS: - // 1. intfgst & CRB_UIS_TOG_OK is not set for non-odd transactions, i.e. first, third, etc, are all fine. - // 2. HandleHidUserReportOutComplete doesn't seem to work. - // if( intfgst & CRB_UIS_TOG_OK ) + USBHSD->UEP0_TX_LEN = len; + USBHSD->UEP0_TX_CTRL ^= USBHS_UEP_T_TOG_DATA1; + } + else if ( ( ctx->USBHS_SetupReqType & USB_REQ_TYP_MASK ) != USB_REQ_TYP_STANDARD ) + { #if HUSB_HID_USER_REPORTS - int len = USBHSD->RX_LEN; - uint8_t *cptr = ctx->pCtrlPayloadPtr; - if (!cptr) - { - HandleHidUserReportDataOut(ctx, ctrl0buff, len); - } - else - { - int remain = ctx->USBHS_SetupReqLen - len; - if (remain < 0) - { - len += remain; - remain = 0; - } - // DMA7FastCopy( cptr, ctrl0buff, len ); - memcpy(cptr, ctrl0buff, len); - ctx->USBHS_SetupReqLen = remain; - if (remain > 0) - ctx->pCtrlPayloadPtr = cptr + len; - else - ctx->pCtrlPayloadPtr = 0; - } + len = ctx->USBHS_SetupReqLen >= DEF_USBD_UEP0_SIZE ? DEF_USBD_UEP0_SIZE : ctx->USBHS_SetupReqLen; + if( len && HSUSBCTX.USBHS_SetupReqCode == HID_GET_REPORT ) + { + len = HandleHidUserReportDataIn( ctx, ctrl0buff, len ); + USBHSD->UEP0_TX_LEN = len; + USBHSD->UEP0_TX_CTRL ^= USBHS_UEP_T_TOG_DATA1; + ctx->USBHS_SetupReqLen -= len; + ctx->pCtrlPayloadPtr += len; + } #endif + } + else + { + switch( HSUSBCTX.USBHS_SetupReqCode ) + { + case USB_GET_DESCRIPTOR: + break; + + case USB_SET_ADDRESS: + USBHSD->DEV_AD = ctx->USBHS_DevAddr; + break; + + default: + break; + } + } + } + + /* data-out stage processing */ + case CUIS_TOKEN_OUT: + switch( ep ) + { + /* end-point 0 data out interrupt */ + case DEF_UEP0: + { + // XXX WARNINGS: + // 1. intfgst & CRB_UIS_TOG_OK is not set for non-odd transactions, i.e. first, third, etc, are all fine. + // 2. HandleHidUserReportOutComplete doesn't seem to work. + //if( intfgst & CRB_UIS_TOG_OK ) - if (ctx->USBHS_SetupReqLen == 0) - { #if HUSB_HID_USER_REPORTS - // DMA7FastCopyComplete(); - HandleHidUserReportOutComplete(ctx); + int len = USBHSD->RX_LEN; + uint8_t * cptr = ctx->pCtrlPayloadPtr; + if( !cptr ) + { + HandleHidUserReportDataOut( ctx, ctrl0buff, len ); + } + else + { + int remain = ctx->USBHS_SetupReqLen - len; + if( remain < 0 ) + { + len += remain; + remain = 0; + } + //DMA7FastCopy( cptr, ctrl0buff, len ); + memcpy( cptr, ctrl0buff, len ); + ctx->USBHS_SetupReqLen = remain; + if( remain > 0 ) + ctx->pCtrlPayloadPtr = cptr + len; + else + ctx->pCtrlPayloadPtr = 0; + } #endif - } - // See above comment - // //USBHSD->UEP0_RX_CTRL ^= USBFS_UEP_R_TOG; + if( ctx->USBHS_SetupReqLen == 0 ) + { +#if HUSB_HID_USER_REPORTS + //DMA7FastCopyComplete(); + HandleHidUserReportOutComplete( ctx ); +#endif + } - break; - } - default: - // Any other out. (also happens with In) - HSUSBCTX.USBHS_Endp_Busy[ep] = 0x02; - USBHSD_UEP_RXCTRL(ep) = ((USBHSD_UEP_RXCTRL(ep)) & ~USBHS_UEP_R_RES_MASK) | USBHS_UEP_R_RES_NAK; + // See above comment + // //USBHSD->UEP0_RX_CTRL ^= USBFS_UEP_R_TOG; + + break; + } + default: + // Any other out. (also happens with In) + HSUSBCTX.USBHS_Endp_Busy[ ep ] = 0x02; + USBHSD_UEP_RXCTRL( ep ) = ((USBHSD_UEP_RXCTRL( ep )) & ~USBHS_UEP_R_RES_MASK) | USBHS_UEP_R_RES_NAK; #if HUSB_BULK_USER_REPORTS - HandleGotEPComplete(ctx, ep); + HandleGotEPComplete( ctx, ep ); #endif - break; - } - break; - case CUIS_TOKEN_SETUP: // Not actually used on this chip (It's done as a separate flag) - case CUIS_TOKEN_SOF: // Sof pack processing - break; + break; + } + break; + case CUIS_TOKEN_SETUP: // Not actually used on this chip (It's done as a separate flag) + case CUIS_TOKEN_SOF: // Sof pack processing + break; - default: - break; - } - } - if (intfgst & USBHS_UIF_BUS_RST) - { - /* usb reset interrupt processing */ - ctx->USBHS_DevConfig = 0; - ctx->USBHS_DevAddr = 0; - ctx->USBHS_DevSleepStatus = 0; - ctx->USBHS_DevEnumStatus = 0; + default : + break; + } + } + if(intfgst & USBHS_UIF_BUS_RST) + { + /* usb reset interrupt processing */ + ctx->USBHS_DevConfig = 0; + ctx->USBHS_DevAddr = 0; + ctx->USBHS_DevSleepStatus = 0; + ctx->USBHS_DevEnumStatus = 0; - USBHSD->DEV_AD = 0; - USBHS_InternalFinishSetup(); - } - if (intfgst & USBHS_UIF_SUSPEND) - { - USBHSD->INT_FG = USBHS_UIF_SUSPEND; - Delay_Us(10); + USBHSD->DEV_AD = 0; + USBHS_InternalFinishSetup( ); + } + if(intfgst & USBHS_UIF_SUSPEND) + { + USBHSD->INT_FG = USBHS_UIF_SUSPEND; + Delay_Us(10); - // USB suspend interrupt processing - if (USBHSD->MIS_ST & USBHS_UMS_SUSPEND) - { - HSUSBCTX.USBHS_DevSleepStatus |= 0x02; - if (HSUSBCTX.USBHS_DevSleepStatus == 0x03) - { - // TODO: Handle usb sleep here - } - } - else - { - HSUSBCTX.USBHS_DevSleepStatus &= ~0x02; - } - } + // USB suspend interrupt processing + if(USBHSD->MIS_ST & USBHS_UMS_SUSPEND) + { + HSUSBCTX.USBHS_DevSleepStatus |= 0x02; + if(HSUSBCTX.USBHS_DevSleepStatus == 0x03) + { + // TODO: Handle usb sleep here + } + } + else + { + HSUSBCTX.USBHS_DevSleepStatus &= ~0x02; + } + } - USBHSD->INT_FG = intfgst; + USBHSD->INT_FG = intfgst; } void USBHS_InternalFinishSetup() { - // To reconfigure your endpoints for TX/RX do it here. + + // To reconfigure your endpoints for TX/RX do it here. #if HUSB_CONFIG_EPS > 5 - USBHSD->ENDP_CONFIG = USBHS_UEP0_T_EN | USBHS_UEP0_R_EN | USBHS_UEP1_T_EN | USBHS_UEP2_T_EN | USBHS_UEP3_T_EN | USBHS_UEP4_T_EN | USBHS_UEP5_R_EN; + USBHSD->ENDP_CONFIG = USBHS_UEP0_T_EN | USBHS_UEP0_R_EN | USBHS_UEP1_T_EN + | USBHS_UEP2_T_EN | USBHS_UEP3_T_EN | USBHS_UEP4_T_EN | USBHS_UEP5_R_EN; #elif HUSB_CONFIG_EPS > 4 - USBHSD->ENDP_CONFIG = USBHS_UEP0_T_EN | USBHS_UEP0_R_EN | USBHS_UEP1_T_EN | USBHS_UEP2_T_EN | USBHS_UEP3_T_EN | USBHS_UEP4_T_EN; + USBHSD->ENDP_CONFIG = USBHS_UEP0_T_EN | USBHS_UEP0_R_EN | USBHS_UEP1_T_EN + | USBHS_UEP2_T_EN | USBHS_UEP3_T_EN | USBHS_UEP4_T_EN; #elif HUSB_CONFIG_EPS > 3 - USBHSD->ENDP_CONFIG = USBHS_UEP0_T_EN | USBHS_UEP0_R_EN | USBHS_UEP1_T_EN | USBHS_UEP2_T_EN | USBHS_UEP3_T_EN; + USBHSD->ENDP_CONFIG = USBHS_UEP0_T_EN | USBHS_UEP0_R_EN | USBHS_UEP1_T_EN + | USBHS_UEP2_T_EN | USBHS_UEP3_T_EN; #elif HUSB_CONFIG_EPS > 2 - USBHSD->ENDP_CONFIG = USBHS_UEP0_T_EN | USBHS_UEP0_R_EN | USBHS_UEP1_T_EN | USBHS_UEP2_T_EN; + USBHSD->ENDP_CONFIG = USBHS_UEP0_T_EN | USBHS_UEP0_R_EN | USBHS_UEP1_T_EN + | USBHS_UEP2_T_EN; #elif HUSB_CONFIG_EPS > 1 - USBHSD->ENDP_CONFIG = USBHS_UEP0_T_EN | USBHS_UEP0_R_EN | USBHS_UEP1_T_EN; + USBHSD->ENDP_CONFIG = USBHS_UEP0_T_EN | USBHS_UEP0_R_EN | USBHS_UEP1_T_EN; #else - USBHSD->ENDP_CONFIG = USBHS_UEP0_T_EN | USBHS_UEP0_R_EN; + USBHSD->ENDP_CONFIG = USBHS_UEP0_T_EN | USBHS_UEP0_R_EN; #endif - // This is really cursed. Somehow it doesn't explode. - // But, normally the USB wants a separate buffer here. + // This is really cursed. Somehow it doesn't explode. + // But, normally the USB wants a separate buffer here. #if HUSB_CONFIG_EPS > 5 - // Feel free to override any of these. - USBHSD->UEP5_MAX_LEN = 64; - USBHSD->UEP5_RX_DMA = (uintptr_t)HSUSBCTX.ENDPOINTS[5]; - USBHSD->UEP5_RX_CTRL = USBHS_UEP_R_RES_ACK | USBHS_UEP_R_TOG_AUTO; // For bulk-out, I think you need to do this. + // Feel free to override any of these. + USBHSD->UEP5_MAX_LEN = 64; + USBHSD->UEP5_RX_DMA = (uintptr_t)HSUSBCTX.ENDPOINTS[5]; + USBHSD->UEP5_RX_CTRL = USBHS_UEP_R_RES_ACK | USBHS_UEP_R_TOG_AUTO; // For bulk-out, I think you need to do this. #endif #if HUSB_CONFIG_EPS > 4 - USBHSD->UEP4_MAX_LEN = 64; // TODO: change to dynamic size, as USB HS supports more than 64? - USBHSD->UEP4_TX_DMA = (uintptr_t)HSUSBCTX.ENDPOINTS[4]; + USBHSD->UEP4_MAX_LEN = 64; // TODO: change to dynamic size, as USB HS supports more than 64? + USBHSD->UEP4_TX_DMA = (uintptr_t)HSUSBCTX.ENDPOINTS[4]; #endif #if HUSB_CONFIG_EPS > 3 - USBHSD->UEP3_MAX_LEN = 64; // TODO: change to dynamic size, as USB HS supports more than 64? - USBHSD->UEP3_TX_DMA = (uintptr_t)HSUSBCTX.ENDPOINTS[3]; + USBHSD->UEP3_MAX_LEN = 64; // TODO: change to dynamic size, as USB HS supports more than 64? + USBHSD->UEP3_TX_DMA = (uintptr_t)HSUSBCTX.ENDPOINTS[3]; #endif #if HUSB_CONFIG_EPS > 2 - USBHSD->UEP2_MAX_LEN = 64; // TODO: change to dynamic size, as USB HS supports more than 64? - USBHSD->UEP2_TX_DMA = (uintptr_t)HSUSBCTX.ENDPOINTS[2]; + USBHSD->UEP2_MAX_LEN = 64; // TODO: change to dynamic size, as USB HS supports more than 64? + USBHSD->UEP2_TX_DMA = (uintptr_t)HSUSBCTX.ENDPOINTS[2]; #endif #if HUSB_CONFIG_EPS > 1 - USBHSD->UEP1_MAX_LEN = 64; // TODO: change to dynamic size, as USB HS supports more than 64? - USBHSD->UEP1_TX_DMA = (uintptr_t)HSUSBCTX.ENDPOINTS[1]; + USBHSD->UEP1_MAX_LEN = 64; // TODO: change to dynamic size, as USB HS supports more than 64? + USBHSD->UEP1_TX_DMA = (uintptr_t)HSUSBCTX.ENDPOINTS[1]; #endif #if HUSB_CONFIG_EPS > 0 - USBHSD->UEP0_MAX_LEN = 64; - USBHSD->UEP0_DMA = (uintptr_t)HSUSBCTX.ENDPOINTS[0]; + USBHSD->UEP0_MAX_LEN = 64; + USBHSD->UEP0_DMA = (uintptr_t)HSUSBCTX.ENDPOINTS[0]; #else #error You must have at least EP0! #endif - UEP_CTRL_H(0) = USBHS_UEP_R_RES_ACK | USBHS_UEP_T_RES_NAK; - int i; - for (i = 1; i < HUSB_CONFIG_EPS; i++) - UEP_CTRL_H(i) = USBFS_UEP_T_RES_NAK; + UEP_CTRL_H(0) = USBHS_UEP_R_RES_ACK | USBHS_UEP_T_RES_NAK; + int i; + for( i = 1; i < HUSB_CONFIG_EPS; i++ ) + UEP_CTRL_H(i) = USBFS_UEP_T_RES_NAK; - for (uint8_t i = 0; i < sizeof(HSUSBCTX.USBHS_Endp_Busy) / sizeof(HSUSBCTX.USBHS_Endp_Busy[0]); i++) - { - HSUSBCTX.USBHS_Endp_Busy[i] = 0; - } + for(uint8_t i=0; i< sizeof(HSUSBCTX.USBHS_Endp_Busy)/sizeof(HSUSBCTX.USBHS_Endp_Busy[0]); i++ ) + { + HSUSBCTX.USBHS_Endp_Busy[ i ] = 0; + } } int HSUSBSetup() { - // Set USB clock source to USBPHY - RCC->CFGR2 &= ~(1 << 31); - RCC->CFGR2 |= RCC_USBCLK48MCLKSource_USBPHY << 31; + // Set USB clock source to USBPHY + RCC->CFGR2 &= ~(1 << 31); + RCC->CFGR2 |= RCC_USBCLK48MCLKSource_USBPHY << 31; - // Set PLL clock source to HSE - RCC->CFGR2 &= ~(1 << 27); - RCC->CFGR2 |= RCC_HSBHSPLLCLKSource_HSE << 27; + // Set PLL clock source to HSE + RCC->CFGR2 &= ~(1 << 27); + RCC->CFGR2 |= RCC_HSBHSPLLCLKSource_HSE << 27; - // Configure PLL for USB - RCC->CFGR2 &= ~(7 << 24); - RCC->CFGR2 |= RCC_USBPLL_Div2 << 24; + // Configure PLL for USB + RCC->CFGR2 &= ~(7 << 24); + RCC->CFGR2 |= RCC_USBPLL_Div2 << 24; - // Configure reference clock - RCC->CFGR2 &= ~(3 << 28); - RCC->CFGR2 |= RCC_USBHSPLLCKREFCLK_4M << 28; + // Configure reference clock + RCC->CFGR2 &= ~(3 << 28); + RCC->CFGR2 |= RCC_USBHSPLLCKREFCLK_4M << 28; - // Enable USB high-speed peripheral - RCC->CFGR2 |= (1 << 30); - RCC->AHBPCENR |= RCC_AHBPeriph_USBHS | RCC_AHBPeriph_DMA1; + // Enable USB high-speed peripheral + RCC->CFGR2 |= (1 << 30); + RCC->AHBPCENR |= RCC_AHBPeriph_USBHS | RCC_AHBPeriph_DMA1; - // Initialize USB module - USBHSD->CONTROL = USBHS_UC_CLR_ALL | USBHS_UC_RESET_SIE; - Delay_Us(10); - USBHSD->CONTROL = 0; + // Initialize USB module + USBHSD->CONTROL = USBHS_UC_CLR_ALL | USBHS_UC_RESET_SIE; + Delay_Us(10); + USBHSD->CONTROL = 0; - // Initialize USB device config - USBHSD->HOST_CTRL = USBHS_UH_PHY_SUSPENDM; - USBHSD->CONTROL = USBHS_UC_DMA_EN | USBHS_UC_INT_BUSY | USBHS_UC_SPEED_HIGH; - USBHSD->INT_EN = USBHS_UIE_SETUP_ACT | USBHS_UIE_TRANSFER | USBHS_UIE_DETECT | USBHS_UIE_SUSPEND; + // Initialize USB device config + USBHSD->HOST_CTRL = USBHS_UH_PHY_SUSPENDM; + USBHSD->CONTROL = USBHS_UC_DMA_EN | USBHS_UC_INT_BUSY | USBHS_UC_SPEED_HIGH; + USBHSD->INT_EN = USBHS_UIE_SETUP_ACT | USBHS_UIE_TRANSFER | USBHS_UIE_DETECT | USBHS_UIE_SUSPEND; + + USBHS_InternalFinishSetup(); - USBHS_InternalFinishSetup(); + USBHSD->CONTROL |= USBHS_UC_DEV_PU_EN; + NVIC_EnableIRQ(USBHS_IRQn); - USBHSD->CONTROL |= USBHS_UC_DEV_PU_EN; - NVIC_EnableIRQ(USBHS_IRQn); - - // Go on-bus. - return 0; + // Go on-bus. + return 0; } + + diff --git a/src/extralibs/hsusb_v30x.h b/src/extralibs/hsusb_v30x.h index 49584be..013eb7d 100644 --- a/src/extralibs/hsusb_v30x.h +++ b/src/extralibs/hsusb_v30x.h @@ -7,74 +7,75 @@ This is referenced in Chapter 22 USB Host/Device Controller (USBHD) of CH32FV2x_V3xRM.pdf */ -#include "ch32fun.h" -#include "usb_config.h" -#include "usb_defines.h" #include +#include "ch32fun.h" +#include "usb_defines.h" +#include "usb_config.h" struct _USBState { - // Setup Request - uint8_t USBHS_SetupReqCode; - uint8_t USBHS_SetupReqType; - uint16_t USBHS_SetupReqLen; // Used for tracking place along send. - uint32_t USBHS_IndexValue; + // Setup Request + uint8_t USBHS_SetupReqCode; + uint8_t USBHS_SetupReqType; + uint16_t USBHS_SetupReqLen; // Used for tracking place along send. + uint32_t USBHS_IndexValue; - // USB Device Status - uint16_t USBHS_DevConfig; - uint16_t USBHS_DevAddr; - uint8_t USBHS_DevSleepStatus; - uint8_t USBHS_DevEnumStatus; + // USB Device Status + uint16_t USBHS_DevConfig; + uint16_t USBHS_DevAddr; + uint8_t USBHS_DevSleepStatus; + uint8_t USBHS_DevEnumStatus; - uint8_t *pCtrlPayloadPtr; + uint8_t * pCtrlPayloadPtr; - uint8_t ENDPOINTS[HUSB_CONFIG_EPS][64]; + uint8_t ENDPOINTS[HUSB_CONFIG_EPS][64]; -#define CTRL0BUFF (HSUSBCTX.ENDPOINTS[0]) -#define pUSBHS_SetupReqPak ((tusb_control_request_t *)CTRL0BUFF) + #define CTRL0BUFF (HSUSBCTX.ENDPOINTS[0]) + #define pUSBHS_SetupReqPak ((tusb_control_request_t*)CTRL0BUFF) #if HUSB_HID_INTERFACES > 0 - uint8_t USBHS_HidIdle[HUSB_HID_INTERFACES]; - uint8_t USBHS_HidProtocol[HUSB_HID_INTERFACES]; + uint8_t USBHS_HidIdle[HUSB_HID_INTERFACES]; + uint8_t USBHS_HidProtocol[HUSB_HID_INTERFACES]; #endif - volatile uint8_t USBHS_Endp_Busy[HUSB_CONFIG_EPS]; + volatile uint8_t USBHS_Endp_Busy[HUSB_CONFIG_EPS]; }; // Provided functions: -int HSUSBSetup(); +int HSUSBSetup(); uint8_t USBHS_Endp_DataUp(uint8_t endp, const uint8_t *pbuf, uint16_t len, uint8_t mod); // Implement the following: #if HUSB_HID_USER_REPORTS -int HandleHidUserGetReportSetup(struct _USBState *ctx, tusb_control_request_t *req); -int HandleHidUserSetReportSetup(struct _USBState *ctx, tusb_control_request_t *req); -void HandleHidUserReportDataOut(struct _USBState *ctx, uint8_t *data, int len); -int HandleHidUserReportDataIn(struct _USBState *ctx, uint8_t *data, int len); -void HandleHidUserReportOutComplete(struct _USBState *ctx); +int HandleHidUserGetReportSetup( struct _USBState * ctx, tusb_control_request_t * req ); +int HandleHidUserSetReportSetup( struct _USBState * ctx, tusb_control_request_t * req ); +void HandleHidUserReportDataOut( struct _USBState * ctx, uint8_t * data, int len ); +int HandleHidUserReportDataIn( struct _USBState * ctx, uint8_t * data, int len ); +void HandleHidUserReportOutComplete( struct _USBState * ctx ); #endif #if HUSB_BULK_USER_REPORTS -void HandleGotEPComplete(struct _USBState *ctx, int ep); +void HandleGotEPComplete( struct _USBState * ctx, int ep ); #endif extern struct _USBState HSUSBCTX; + // To TX, you can use USBFS_GetEPBufferIfAvailable or USBHSD_UEP_TXBUF( endp ) -static inline uint8_t *USBHS_GetEPBufferIfAvailable(int endp) +static inline uint8_t * USBHS_GetEPBufferIfAvailable( int endp ) { - if (HSUSBCTX.USBHS_Endp_Busy[endp]) return 0; - return USBHSD_UEP_TXBUF(endp); + if( HSUSBCTX.USBHS_Endp_Busy[ endp ] ) return 0; + return USBHSD_UEP_TXBUF( endp ); } -static inline void USBHS_SendEndpoint(int endp, int len, const uint8_t *data) +static inline void USBHS_SendEndpoint( int endp, int len, const uint8_t * data ) { - if (endp) - { - (((uint32_t *)(&USBHSD->UEP1_TX_DMA))[2 - 1]) = (uintptr_t)data; - } - USBHSD_UEP_TLEN(endp) = len; - USBHSD_UEP_TXCTRL(endp) = (USBHSD_UEP_TXCTRL(endp) & ~USBHS_UEP_T_RES_MASK) | USBHS_UEP_T_RES_ACK; - HSUSBCTX.USBHS_Endp_Busy[endp] = 0x01; + if( endp ) + { + (((uint32_t*)(&USBHSD->UEP1_TX_DMA))[2-1]) = (uintptr_t)data; + } + USBHSD_UEP_TLEN( endp ) = len; + USBHSD_UEP_TXCTRL( endp ) = ( USBHSD_UEP_TXCTRL( endp ) & ~USBHS_UEP_T_RES_MASK ) | USBHS_UEP_T_RES_ACK; + HSUSBCTX.USBHS_Endp_Busy[ endp ] = 0x01; } #endif diff --git a/src/extralibs/lib_rand.h b/src/extralibs/lib_rand.h index 98889b4..a6bcf74 100644 --- a/src/extralibs/lib_rand.h +++ b/src/extralibs/lib_rand.h @@ -1,30 +1,30 @@ /****************************************************************************** - * Psuedo Random Number Generator using a Linear Feedback Shift Register - * See the GitHub for more information: - * https://github.com/ADBeta/CH32V003_lib_rand - * - * Ver 1.1 09 Sep 2024 - * - * Released under the MIT Licence - * Copyright ADBeta (c) 2024 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. - ******************************************************************************/ +* Psuedo Random Number Generator using a Linear Feedback Shift Register +* See the GitHub for more information: +* https://github.com/ADBeta/CH32V003_lib_rand +* +* Ver 1.1 09 Sep 2024 +* +* Released under the MIT Licence +* Copyright ADBeta (c) 2024 +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to +* deal in the Software without restriction, including without limitation the +* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +* sell copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +* USE OR OTHER DEALINGS IN THE SOFTWARE. +******************************************************************************/ #ifndef CH32V003_LIB_RAND #define CH32V003_LIB_RAND @@ -34,13 +34,14 @@ // Strength 3: Genetate two 32bit values using the LFSR, then XOR them together // Example: #define RANDOM_STRENGTH 2 -#ifndef RANDOM_STRENGTH -#error "Error in lib_rand. Must define RANDOM_STRENGTH" +#ifndef RANDOM_STRENGTH + #error "Error in lib_rand. Must define RANDOM_STRENGTH" #endif // @brief set the random LFSR values seed by default to a known-good value static uint32_t _rand_lfsr = 0x747AA32F; + /*** Library specific Functions - Do Not Use *********************************/ /****************************************************************************/ /// @brief Updates the LFSR by getting a new tap bit, for MSB, then shifting @@ -50,59 +51,63 @@ static uint32_t _rand_lfsr = 0x747AA32F; /// @return 0x01 or 0x00, as a LSB translation of the tapped MSB for the LFSR uint8_t _rand_lfsr_update(void) { - // Shifting to MSB to make calculations more efficient later - uint32_t bit_31 = _rand_lfsr & 0x80000000; - uint32_t bit_21 = (_rand_lfsr << 10) & 0x80000000; - uint32_t bit_01 = (_rand_lfsr << 30) & 0x80000000; - uint32_t bit_00 = (_rand_lfsr << 31) & 0x80000000; + // Shifting to MSB to make calculations more efficient later + uint32_t bit_31 = _rand_lfsr & 0x80000000; + uint32_t bit_21 = (_rand_lfsr << 10) & 0x80000000; + uint32_t bit_01 = (_rand_lfsr << 30) & 0x80000000; + uint32_t bit_00 = (_rand_lfsr << 31) & 0x80000000; - // Calculate the MSB to be put into the LFSR - uint32_t msb = bit_31 ^ bit_21 ^ bit_01 ^ bit_00; - // Shift the lfsr and append the MSB to it - _rand_lfsr = (_rand_lfsr >> 1) | msb; - // Return the LSB instead of MSB - return msb >> 31; + // Calculate the MSB to be put into the LFSR + uint32_t msb = bit_31 ^ bit_21 ^ bit_01 ^ bit_00; + // Shift the lfsr and append the MSB to it + _rand_lfsr = (_rand_lfsr >> 1) | msb; + // Return the LSB instead of MSB + return msb >> 31; } + /// @brief Generates a Random 32-bit number, using the LFSR - by generating /// a random bit from LFSR taps, 32 times. /// @param None /// @return a (psuedo)random 32-bit value uint32_t _rand_gen_32b(void) { - uint32_t rand_out = 0; - - uint8_t bits = 32; - while (bits--) - { - // Shift the current rand value for the new LSB - rand_out = rand_out << 1; - // Append the LSB - rand_out |= _rand_lfsr_update(); - } - - return rand_out; + uint32_t rand_out = 0; + + uint8_t bits = 32; + while(bits--) + { + // Shift the current rand value for the new LSB + rand_out = rand_out << 1; + // Append the LSB + rand_out |= _rand_lfsr_update(); + } + + return rand_out; } + + /// @brief Generates a Random n-bit number, using the LFSR - by generating /// a random bit from LFSR taps, n times. /// @param None /// @return a (psuedo)random n-bit value -uint32_t _rand_gen_nb(int bits) +uint32_t _rand_gen_nb( int bits) { - uint32_t rand_out = 0; + uint32_t rand_out = 0; - while (bits--) - { - // Shift the current rand value for the new LSB - rand_out = rand_out << 1; - // Append the LSB - rand_out |= _rand_lfsr_update(); - } + while(bits--) + { + // Shift the current rand value for the new LSB + rand_out = rand_out << 1; + // Append the LSB + rand_out |= _rand_lfsr_update(); + } - return rand_out; + return rand_out; } + /*** API Functions ***********************************************************/ /*****************************************************************************/ /// @brief seeds the Random LFSR to the value passed @@ -110,39 +115,40 @@ uint32_t _rand_gen_nb(int bits) /// @return None void seed(const uint32_t seed_val) { - _rand_lfsr = seed_val; + _rand_lfsr = seed_val; } + /// @brief Generates a Random (32-bit) Number, based on the RANDOM_STRENGTH -/// you have selected +/// you have selected /// @param None /// @return 32bit Random value uint32_t rand(void) { - uint32_t rand_out = 0; + uint32_t rand_out = 0; -// If RANDOM_STRENGTH is level 1, Update LFSR Once, then return it -#if RANDOM_STRENGTH == 1 - // Update the LFSR, discard result, and return _lsfr raw - (void)_rand_lfsr_update(); - rand_out = _rand_lfsr; -#endif + // If RANDOM_STRENGTH is level 1, Update LFSR Once, then return it + #if RANDOM_STRENGTH == 1 + // Update the LFSR, discard result, and return _lsfr raw + (void)_rand_lfsr_update(); + rand_out = _rand_lfsr; + #endif -// If RANDOM_STRENGTH is level 2, generate a 32-bit output, using 32 random -// bits from the LFSR -#if RANDOM_STRENGTH == 2 - rand_out = _rand_gen_32b(); -#endif + // If RANDOM_STRENGTH is level 2, generate a 32-bit output, using 32 random + // bits from the LFSR + #if RANDOM_STRENGTH == 2 + rand_out = _rand_gen_32b(); + #endif -// If RANDOM_STRENGTH is level 3, generate 2 32-bit outputs, then XOR them -// together -#if RANDOM_STRENGTH == 3 - uint32_t rand_a = _rand_gen_32b(); - uint32_t rand_b = _rand_gen_32b(); - rand_out = rand_a ^ rand_b; -#endif + // If RANDOM_STRENGTH is level 3, generate 2 32-bit outputs, then XOR them + // together + #if RANDOM_STRENGTH == 3 + uint32_t rand_a = _rand_gen_32b(); + uint32_t rand_b = _rand_gen_32b(); + rand_out = rand_a ^ rand_b; + #endif - return rand_out; + return rand_out; } #endif diff --git a/src/extralibs/ssd1306.h b/src/extralibs/ssd1306.h index d51811f..3edfbc6 100644 --- a/src/extralibs/ssd1306.h +++ b/src/extralibs/ssd1306.h @@ -6,19 +6,19 @@ #ifndef _SSD1306_H #define _SSD1306_H -#include "font_8x8.h" #include #include +#include "font_8x8.h" // comfortable packet size for this OLED #define SSD1306_PSZ 32 -#if defined(SSD1306_CUSTOM) +#if defined (SSD1306_CUSTOM) // Let the caller configure the OLED. #else // characteristics of each type -#if !defined(SSD1306_64X32) && !defined(SSD1306_128X32) && !defined(SSD1306_128X64) && !defined(SH1107_128x128) && !(defined(SSD1306_W) && defined(SSD1306_H) && defined(SSD1306_OFFSET)) -#error "Please define the SSD1306_WXH resolution used in your application" +#if !defined (SSD1306_64X32) && !defined (SSD1306_128X32) && !defined (SSD1306_128X64) && !defined (SH1107_128x128) && !(defined(SSD1306_W) && defined(SSD1306_H) && defined(SSD1306_OFFSET) ) + #error "Please define the SSD1306_WXH resolution used in your application" #endif #ifdef SSD1306_64X32 @@ -57,7 +57,7 @@ */ uint8_t ssd1306_cmd(uint8_t cmd) { - return ssd1306_pkt_send(&cmd, 1, 1); + return ssd1306_pkt_send(&cmd, 1, 1); } /* @@ -65,7 +65,7 @@ uint8_t ssd1306_cmd(uint8_t cmd) */ uint8_t ssd1306_data(uint8_t *data, int sz) { - return ssd1306_pkt_send(data, sz, 0); + return ssd1306_pkt_send(data, sz, 0); } #define SSD1306_SETCONTRAST 0x81 @@ -87,7 +87,7 @@ uint8_t ssd1306_data(uint8_t *data, int sz) #define SSD1306_SETSTARTLINE 0x40 #define SSD1306_MEMORYMODE 0x20 #define SSD1306_COLUMNADDR 0x21 -#define SSD1306_PAGEADDR 0x22 +#define SSD1306_PAGEADDR 0x22 #define SSD1306_COMSCANINC 0xC0 #define SSD1306_COMSCANDEC 0xC8 #define SSD1306_CHARGEPUMP 0x8D @@ -98,81 +98,81 @@ uint8_t ssd1306_data(uint8_t *data, int sz) /* choose VCC mode */ #define SSD1306_EXTERNALVCC 0x1 #define SSD1306_SWITCHCAPVCC 0x2 -// #define vccstate SSD1306_EXTERNALVCC +//#define vccstate SSD1306_EXTERNALVCC #define vccstate SSD1306_SWITCHCAPVCC #if !defined(SSD1306_CUSTOM_INIT_ARRAY) || !SSD1306_CUSTOM_INIT_ARRAY // OLED initialization commands for 128x32 const uint8_t ssd1306_init_array[] = - { +{ #ifdef SH1107 - SSD1306_DISPLAYOFF, // Turn OLED off - 0x00, // Low column - 0x10, // High column - 0xb0, // Page address - 0xdc, 0x00, // Set Display Start Line (Where in memory it reads from) - SSD1306_SETCONTRAST, 0x6f, // Set constrast - SSD1306_COLUMNADDR, // Set memory addressing mode - SSD1306_DISPLAYALLON_RESUME, // normal (as opposed to invert colors, always on or off.) - SSD1306_SETMULTIPLEX, (SSD1306_H - 1), // Iterate over all 128 rows (Multiplex Ratio) - SSD1306_SETDISPLAYOFFSET, 0x00, // Set display offset // Where this appears on-screen (Some displays will be different) - SSD1306_SETDISPLAYCLOCKDIV, 0xf0, // Set precharge properties. THIS IS A LIE This has todo with timing. <<< This makes it go brrrrrrrrr - SSD1306_SETPRECHARGE, 0x1d, // Set pre-charge period (This controls brightness) - SSD1306_SETVCOMDETECT, 0x35, // Set vcomh - SSD1306_SETSTARTLINE | 0x0, // 0x40 | line - 0xad, 0x80, // Set Charge pump - SSD1306_SEGREMAP, 0x01, // Default mapping - SSD1306_SETPRECHARGE, 0x06, // ???? No idea what this does, but this looks best. - SSD1306_SETCONTRAST, 0xfe, // Set constrast - SSD1306_SETVCOMDETECT, 0xfe, // Set vcomh - SSD1306_SETMULTIPLEX, (SSD1306_H - 1), // 128-wide. - SSD1306_DISPLAYON, // Display on. + SSD1306_DISPLAYOFF, // Turn OLED off + 0x00, // Low column + 0x10, // High column + 0xb0, // Page address + 0xdc, 0x00, // Set Display Start Line (Where in memory it reads from) + SSD1306_SETCONTRAST, 0x6f, // Set constrast + SSD1306_COLUMNADDR, // Set memory addressing mode + SSD1306_DISPLAYALLON_RESUME, // normal (as opposed to invert colors, always on or off.) + SSD1306_SETMULTIPLEX, (SSD1306_H-1), // Iterate over all 128 rows (Multiplex Ratio) + SSD1306_SETDISPLAYOFFSET, 0x00, // Set display offset // Where this appears on-screen (Some displays will be different) + SSD1306_SETDISPLAYCLOCKDIV, 0xf0, // Set precharge properties. THIS IS A LIE This has todo with timing. <<< This makes it go brrrrrrrrr + SSD1306_SETPRECHARGE, 0x1d, // Set pre-charge period (This controls brightness) + SSD1306_SETVCOMDETECT, 0x35, // Set vcomh + SSD1306_SETSTARTLINE | 0x0, // 0x40 | line + 0xad, 0x80, // Set Charge pump + SSD1306_SEGREMAP, 0x01, // Default mapping + SSD1306_SETPRECHARGE, 0x06, // ???? No idea what this does, but this looks best. + SSD1306_SETCONTRAST, 0xfe, // Set constrast + SSD1306_SETVCOMDETECT, 0xfe, // Set vcomh + SSD1306_SETMULTIPLEX, (SSD1306_H-1), // 128-wide. + SSD1306_DISPLAYON, // Display on. #else - SSD1306_DISPLAYOFF, // 0xAE - SSD1306_SETDISPLAYCLOCKDIV, // 0xD5 - 0x80, // the suggested ratio 0x80 - SSD1306_SETMULTIPLEX, // 0xA8 + SSD1306_DISPLAYOFF, // 0xAE + SSD1306_SETDISPLAYCLOCKDIV, // 0xD5 + 0x80, // the suggested ratio 0x80 + SSD1306_SETMULTIPLEX, // 0xA8 #ifdef SSD1306_64X32 - 0x1F, // for 64-wide displays + 0x1F, // for 64-wide displays #else - 0x3F, // for 128-wide displays + 0x3F, // for 128-wide displays #endif - SSD1306_SETDISPLAYOFFSET, // 0xD3 - 0x00, // no offset - SSD1306_SETSTARTLINE | 0x0, // 0x40 | line - SSD1306_CHARGEPUMP, // 0x8D - 0x14, // enable? - SSD1306_MEMORYMODE, // 0x20 - 0x00, // 0x0 act like ks0108 - SSD1306_SEGREMAP | 0x1, // 0xA0 | bit - SSD1306_COMSCANDEC, - SSD1306_SETCOMPINS, // 0xDA - 0x12, // - SSD1306_SETCONTRAST, // 0x81 - 0x8F, - SSD1306_SETPRECHARGE, // 0xd9 - 0xF1, - SSD1306_SETVCOMDETECT, // 0xDB - 0x40, - SSD1306_DISPLAYALLON_RESUME, // 0xA4 + SSD1306_SETDISPLAYOFFSET, // 0xD3 + 0x00, // no offset + SSD1306_SETSTARTLINE | 0x0, // 0x40 | line + SSD1306_CHARGEPUMP, // 0x8D + 0x14, // enable? + SSD1306_MEMORYMODE, // 0x20 + 0x00, // 0x0 act like ks0108 + SSD1306_SEGREMAP | 0x1, // 0xA0 | bit + SSD1306_COMSCANDEC, + SSD1306_SETCOMPINS, // 0xDA + 0x12, // + SSD1306_SETCONTRAST, // 0x81 + 0x8F, + SSD1306_SETPRECHARGE, // 0xd9 + 0xF1, + SSD1306_SETVCOMDETECT, // 0xDB + 0x40, + SSD1306_DISPLAYALLON_RESUME, // 0xA4 #ifndef SSD1327 - SSD1306_NORMALDISPLAY, // 0xA6 + SSD1306_NORMALDISPLAY, // 0xA6 #endif - SSD1306_DISPLAYON, // 0xAF --turn on oled panel + SSD1306_DISPLAYON, // 0xAF --turn on oled panel #endif - SSD1306_TERMINATE_CMDS // 0xFF --fake command to mark end + SSD1306_TERMINATE_CMDS // 0xFF --fake command to mark end }; #endif // the display buffer -uint8_t ssd1306_buffer[SSD1306_W * SSD1306_H / 8]; +uint8_t ssd1306_buffer[SSD1306_W*SSD1306_H/8]; /* * set the buffer to a color */ void ssd1306_setbuf(uint8_t color) { - memset(ssd1306_buffer, color ? 0xFF : 0x00, sizeof(ssd1306_buffer)); + memset(ssd1306_buffer, color ? 0xFF : 0x00, sizeof(ssd1306_buffer)); } #ifndef SSD1306_FULLUSE @@ -180,23 +180,11 @@ void ssd1306_setbuf(uint8_t color) * expansion array for OLED with every other row unused */ const uint8_t expand[16] = - { - 0x00, - 0x02, - 0x08, - 0x0a, - 0x20, - 0x22, - 0x28, - 0x2a, - 0x80, - 0x82, - 0x88, - 0x8a, - 0xa0, - 0xa2, - 0xa8, - 0xaa, +{ + 0x00,0x02,0x08,0x0a, + 0x20,0x22,0x28,0x2a, + 0x80,0x82,0x88,0x8a, + 0xa0,0xa2,0xa8,0xaa, }; #endif @@ -205,65 +193,66 @@ const uint8_t expand[16] = */ void ssd1306_refresh(void) { - uint16_t i; - + uint16_t i; + #ifdef SH1107 - ssd1306_cmd(SSD1306_MEMORYMODE); // vertical addressing mode. + ssd1306_cmd(SSD1306_MEMORYMODE); // vertical addressing mode. - for (i = 0; i < SSD1306_H / 8; i++) - { - ssd1306_cmd(0xb0 | i); - ssd1306_cmd(0x00 | (0 & 0xf)); - ssd1306_cmd(0x10 | (0 >> 4)); - ssd1306_data(&ssd1306_buffer[i * 4 * SSD1306_PSZ + 0 * SSD1306_PSZ], SSD1306_PSZ); - ssd1306_data(&ssd1306_buffer[i * 4 * SSD1306_PSZ + 1 * SSD1306_PSZ], SSD1306_PSZ); - ssd1306_data(&ssd1306_buffer[i * 4 * SSD1306_PSZ + 2 * SSD1306_PSZ], SSD1306_PSZ); - ssd1306_data(&ssd1306_buffer[i * 4 * SSD1306_PSZ + 3 * SSD1306_PSZ], SSD1306_PSZ); - } + for(i=0;i>4) ); + ssd1306_data(&ssd1306_buffer[i*4*SSD1306_PSZ+0*SSD1306_PSZ], SSD1306_PSZ); + ssd1306_data(&ssd1306_buffer[i*4*SSD1306_PSZ+1*SSD1306_PSZ], SSD1306_PSZ); + ssd1306_data(&ssd1306_buffer[i*4*SSD1306_PSZ+2*SSD1306_PSZ], SSD1306_PSZ); + ssd1306_data(&ssd1306_buffer[i*4*SSD1306_PSZ+3*SSD1306_PSZ], SSD1306_PSZ); + } #else - ssd1306_cmd(SSD1306_COLUMNADDR); - ssd1306_cmd(SSD1306_OFFSET); // Column start address (0 = reset) - ssd1306_cmd(SSD1306_OFFSET + SSD1306_W - 1); // Column end address (127 = reset) - - ssd1306_cmd(SSD1306_PAGEADDR); - ssd1306_cmd(0); // Page start address (0 = reset) - ssd1306_cmd(7); // Page end address + ssd1306_cmd(SSD1306_COLUMNADDR); + ssd1306_cmd(SSD1306_OFFSET); // Column start address (0 = reset) + ssd1306_cmd(SSD1306_OFFSET+SSD1306_W-1); // Column end address (127 = reset) + + ssd1306_cmd(SSD1306_PAGEADDR); + ssd1306_cmd(0); // Page start address (0 = reset) + ssd1306_cmd(7); // Page end address #ifdef SSD1306_FULLUSE - /* for fully used rows just plow thru everything */ - for (i = 0; i < sizeof(ssd1306_buffer); i += SSD1306_PSZ) - { - /* send PSZ block of data */ - ssd1306_data(&ssd1306_buffer[i], SSD1306_PSZ); - } + /* for fully used rows just plow thru everything */ + for(i=0;i> 4) & 0xf]; - - /* send PSZ block of data */ - ssd1306_data(tbuf, SSD1306_PSZ); - } - } + /* for displays with odd rows unused expand bytes */ + uint8_t tbuf[SSD1306_PSZ], j, k; + for(i=0;i>4)&0xf]; + + /* send PSZ block of data */ + ssd1306_data(tbuf, SSD1306_PSZ); + } + } #endif #endif + } /* @@ -271,22 +260,22 @@ void ssd1306_refresh(void) */ void ssd1306_drawPixel(uint32_t x, uint32_t y, int color) { - uint32_t addr; - - /* clip */ - if (x >= SSD1306_W) - return; - if (y >= SSD1306_H) - return; - - /* compute buffer address */ - addr = x + SSD1306_W * (y / 8); - - /* set/clear bit in buffer */ - if (color) - ssd1306_buffer[addr] |= (1 << (y & 7)); - else - ssd1306_buffer[addr] &= ~(1 << (y & 7)); + uint32_t addr; + + /* clip */ + if(x >= SSD1306_W) + return; + if(y >= SSD1306_H) + return; + + /* compute buffer address */ + addr = x + SSD1306_W*(y/8); + + /* set/clear bit in buffer */ + if(color) + ssd1306_buffer[addr] |= (1<<(y&7)); + else + ssd1306_buffer[addr] &= ~(1<<(y&7)); } /* @@ -294,96 +283,89 @@ void ssd1306_drawPixel(uint32_t x, uint32_t y, int color) */ void ssd1306_xorPixel(uint32_t x, uint32_t y) { - uint32_t addr; - - /* clip */ - if (x >= SSD1306_W) - return; - if (y >= SSD1306_H) - return; - - /* compute buffer address */ - addr = x + SSD1306_W * (y / 8); - - ssd1306_buffer[addr] ^= (1 << (y & 7)); + uint32_t addr; + + /* clip */ + if(x >= SSD1306_W) + return; + if(y >= SSD1306_H) + return; + + /* compute buffer address */ + addr = x + SSD1306_W*(y/8); + + ssd1306_buffer[addr] ^= (1<<(y&7)); } /* * draw a an image from an array, directly into to the display buffer * the color modes allow for overwriting and even layering (sprites!) */ -void ssd1306_drawImage(uint32_t x, uint32_t y, const unsigned char *input, uint32_t width, uint32_t height, uint32_t color_mode) -{ - uint32_t x_absolute; - uint32_t y_absolute; - uint32_t pixel; - uint32_t bytes_to_draw = width / 8; - uint32_t buffer_addr; +void ssd1306_drawImage(uint32_t x, uint32_t y, const unsigned char* input, uint32_t width, uint32_t height, uint32_t color_mode) { + uint32_t x_absolute; + uint32_t y_absolute; + uint32_t pixel; + uint32_t bytes_to_draw = width / 8; + uint32_t buffer_addr; - for (uint32_t line = 0; line < height; line++) - { - y_absolute = y + line; - if (y_absolute >= SSD1306_H) - { - break; - } + for (uint32_t line = 0; line < height; line++) { + y_absolute = y + line; + if (y_absolute >= SSD1306_H) { + break; + } - // SSD1306 is in vertical mode, yet we want to draw horizontally, which necessitates assembling the output bytes from the input data - // bitmask for current pixel in vertical (output) byte - uint32_t v_mask = 1 << (y_absolute & 7); + // SSD1306 is in vertical mode, yet we want to draw horizontally, which necessitates assembling the output bytes from the input data + // bitmask for current pixel in vertical (output) byte + uint32_t v_mask = 1 << (y_absolute & 7); - for (uint32_t byte = 0; byte < bytes_to_draw; byte++) - { - uint32_t input_byte = input[byte + line * bytes_to_draw]; + for (uint32_t byte = 0; byte < bytes_to_draw; byte++) { + uint32_t input_byte = input[byte + line * bytes_to_draw]; - for (pixel = 0; pixel < 8; pixel++) - { - x_absolute = x + 8 * (bytes_to_draw - byte) + pixel; - if (x_absolute >= SSD1306_W) - { - break; - } - // looking at the horizontal display, we're drawing bytes bottom to top, not left to right, hence y / 8 - buffer_addr = x_absolute + SSD1306_W * (y_absolute / 8); - // state of current pixel - uint8_t input_pixel = input_byte & (1 << pixel); + for (pixel = 0; pixel < 8; pixel++) { + x_absolute = x + 8 * (bytes_to_draw - byte) + pixel; + if (x_absolute >= SSD1306_W) { + break; + } + // looking at the horizontal display, we're drawing bytes bottom to top, not left to right, hence y / 8 + buffer_addr = x_absolute + SSD1306_W * (y_absolute / 8); + // state of current pixel + uint8_t input_pixel = input_byte & (1 << pixel); - switch (color_mode) - { - case 0: - // write pixels as they are - ssd1306_buffer[buffer_addr] = (ssd1306_buffer[buffer_addr] & ~v_mask) | (input_pixel ? v_mask : 0); - break; - case 1: - // write pixels after inversion - ssd1306_buffer[buffer_addr] = (ssd1306_buffer[buffer_addr] & ~v_mask) | (!input_pixel ? v_mask : 0); - break; - case 2: - // 0 clears pixel - ssd1306_buffer[buffer_addr] &= input_pixel ? 0xFF : ~v_mask; - break; - case 3: - // 1 sets pixel - ssd1306_buffer[buffer_addr] |= input_pixel ? v_mask : 0; - break; - case 4: - // 0 sets pixel - ssd1306_buffer[buffer_addr] |= !input_pixel ? v_mask : 0; - break; - case 5: - // 1 clears pixel - ssd1306_buffer[buffer_addr] &= input_pixel ? ~v_mask : 0xFF; - break; - } - } -#if SSD1306_LOG_IMAGE == 1 - printf("%02x ", input_byte); -#endif - } -#if SSD1306_LOG_IMAGE == 1 - printf("\n\r"); -#endif - } + switch (color_mode) { + case 0: + // write pixels as they are + ssd1306_buffer[buffer_addr] = (ssd1306_buffer[buffer_addr] & ~v_mask) | (input_pixel ? v_mask : 0); + break; + case 1: + // write pixels after inversion + ssd1306_buffer[buffer_addr] = (ssd1306_buffer[buffer_addr] & ~v_mask) | (!input_pixel ? v_mask : 0); + break; + case 2: + // 0 clears pixel + ssd1306_buffer[buffer_addr] &= input_pixel ? 0xFF : ~v_mask; + break; + case 3: + // 1 sets pixel + ssd1306_buffer[buffer_addr] |= input_pixel ? v_mask : 0; + break; + case 4: + // 0 sets pixel + ssd1306_buffer[buffer_addr] |= !input_pixel ? v_mask : 0; + break; + case 5: + // 1 clears pixel + ssd1306_buffer[buffer_addr] &= input_pixel ? ~v_mask : 0xFF; + break; + } + } + #if SSD1306_LOG_IMAGE == 1 + printf("%02x ", input_byte); + #endif + } + #if SSD1306_LOG_IMAGE == 1 + printf("\n\r"); + #endif + } } /* @@ -391,13 +373,13 @@ void ssd1306_drawImage(uint32_t x, uint32_t y, const unsigned char *input, uint3 */ void ssd1306_drawFastVLine(int32_t x, int32_t y, int32_t h, uint32_t color) { - // clipping - if ((x >= SSD1306_W) || (y >= SSD1306_H)) return; - if ((y + h - 1) >= SSD1306_H) h = SSD1306_H - y; - while (h--) - { + // clipping + if((x >= SSD1306_W) || (y >= SSD1306_H)) return; + if((y+h-1) >= SSD1306_H) h = SSD1306_H-y; + while(h--) + { ssd1306_drawPixel(x, y++, color); - } + } } /* @@ -405,14 +387,14 @@ void ssd1306_drawFastVLine(int32_t x, int32_t y, int32_t h, uint32_t color) */ void ssd1306_drawFastHLine(uint32_t x, uint32_t y, uint32_t w, uint32_t color) { - // clipping - if ((x >= SSD1306_W) || (y >= SSD1306_H)) return; - if ((x + w - 1) >= SSD1306_W) w = SSD1306_W - x; + // clipping + if((x >= SSD1306_W) || (y >= SSD1306_H)) return; + if((x+w-1) >= SSD1306_W) w = SSD1306_W-x; - while (w--) - { + while (w--) + { ssd1306_drawPixel(x++, y, color); - } + } } /* @@ -420,7 +402,7 @@ void ssd1306_drawFastHLine(uint32_t x, uint32_t y, uint32_t w, uint32_t color) */ int gfx_abs(int x) { - return (x < 0) ? -x : x; + return (x<0) ? -x : x; } /* @@ -428,9 +410,9 @@ int gfx_abs(int x) */ void gfx_swap(int *z0, int *z1) { - uint16_t temp = *z0; - *z0 = *z1; - *z1 = temp; + uint16_t temp = *z0; + *z0 = *z1; + *z1 = temp; } /* @@ -438,56 +420,56 @@ void gfx_swap(int *z0, int *z1) */ void ssd1306_drawLine(int x0, int y0, int x1, int y1, uint32_t color) { - int32_t steep; - int32_t deltax, deltay, error, ystep, x, y; + int32_t steep; + int32_t deltax, deltay, error, ystep, x, y; - /* flip sense 45deg to keep error calc in range */ - steep = (gfx_abs(y1 - y0) > gfx_abs(x1 - x0)); + /* flip sense 45deg to keep error calc in range */ + steep = (gfx_abs(y1 - y0) > gfx_abs(x1 - x0)); - if (steep) - { - gfx_swap(&x0, &y0); - gfx_swap(&x1, &y1); - } + if(steep) + { + gfx_swap(&x0, &y0); + gfx_swap(&x1, &y1); + } - /* run low->high */ - if (x0 > x1) - { - gfx_swap(&x0, &x1); - gfx_swap(&y0, &y1); - } + /* run low->high */ + if(x0 > x1) + { + gfx_swap(&x0, &x1); + gfx_swap(&y0, &y1); + } - /* set up loop initial conditions */ - deltax = x1 - x0; - deltay = gfx_abs(y1 - y0); - error = deltax / 2; - y = y0; - if (y0 < y1) - ystep = 1; - else - ystep = -1; + /* set up loop initial conditions */ + deltax = x1 - x0; + deltay = gfx_abs(y1 - y0); + error = deltax/2; + y = y0; + if(y0 < y1) + ystep = 1; + else + ystep = -1; - /* loop x */ - for (x = x0; x <= x1; x++) - { - /* plot point */ - if (steep) - /* flip point & plot */ - ssd1306_drawPixel(y, x, color); - else - /* just plot */ - ssd1306_drawPixel(x, y, color); + /* loop x */ + for(x=x0;x<=x1;x++) + { + /* plot point */ + if(steep) + /* flip point & plot */ + ssd1306_drawPixel(y, x, color); + else + /* just plot */ + ssd1306_drawPixel(x, y, color); - /* update error */ - error = error - deltay; + /* update error */ + error = error - deltay; - /* update y */ - if (error < 0) - { - y = y + ystep; - error = error + deltax; - } - } + /* update y */ + if(error < 0) + { + y = y + ystep; + error = error + deltax; + } + } } /* @@ -498,26 +480,22 @@ void ssd1306_drawCircle(int x, int y, int radius, int color) /* Bresenham algorithm */ int x_pos = -radius; int y_pos = 0; - int err = 2 - 2 * radius; + int err = 2 - 2 * radius; int e2; - do - { + do { ssd1306_drawPixel(x - x_pos, y + y_pos, color); ssd1306_drawPixel(x + x_pos, y + y_pos, color); ssd1306_drawPixel(x + x_pos, y - y_pos, color); ssd1306_drawPixel(x - x_pos, y - y_pos, color); e2 = err; - if (e2 <= y_pos) - { + if (e2 <= y_pos) { err += ++y_pos * 2 + 1; - if (-x_pos == y_pos && e2 <= x_pos) - { - e2 = 0; + if(-x_pos == y_pos && e2 <= x_pos) { + e2 = 0; } } - if (e2 > x_pos) - { + if (e2 > x_pos) { err += ++x_pos * 2 + 1; } } while (x_pos <= 0); @@ -531,11 +509,10 @@ void ssd1306_fillCircle(int x, int y, int radius, int color) /* Bresenham algorithm */ int x_pos = -radius; int y_pos = 0; - int err = 2 - 2 * radius; + int err = 2 - 2 * radius; int e2; - do - { + do { ssd1306_drawPixel(x - x_pos, y + y_pos, color); ssd1306_drawPixel(x + x_pos, y + y_pos, color); ssd1306_drawPixel(x + x_pos, y - y_pos, color); @@ -543,19 +520,16 @@ void ssd1306_fillCircle(int x, int y, int radius, int color) ssd1306_drawFastHLine(x + x_pos, y + y_pos, 2 * (-x_pos) + 1, color); ssd1306_drawFastHLine(x + x_pos, y - y_pos, 2 * (-x_pos) + 1, color); e2 = err; - if (e2 <= y_pos) - { + if (e2 <= y_pos) { err += ++y_pos * 2 + 1; - if (-x_pos == y_pos && e2 <= x_pos) - { + if(-x_pos == y_pos && e2 <= x_pos) { e2 = 0; } } - if (e2 > x_pos) - { + if(e2 > x_pos) { err += ++x_pos * 2 + 1; } - } while (x_pos <= 0); + } while(x_pos <= 0); } /* @@ -563,10 +537,10 @@ void ssd1306_fillCircle(int x, int y, int radius, int color) */ void ssd1306_drawRect(int32_t x, int32_t y, uint32_t w, uint32_t h, uint32_t color) { - ssd1306_drawFastVLine(x, y, h, color); - ssd1306_drawFastVLine(x + w - 1, y, h, color); - ssd1306_drawFastHLine(x, y, w, color); - ssd1306_drawFastHLine(x, y + h - 1, w, color); + ssd1306_drawFastVLine(x, y, h, color); + ssd1306_drawFastVLine(x+w-1, y, h, color); + ssd1306_drawFastHLine(x, y, w, color); + ssd1306_drawFastHLine(x, y+h-1, w, color); } /* @@ -574,21 +548,21 @@ void ssd1306_drawRect(int32_t x, int32_t y, uint32_t w, uint32_t h, uint32_t col */ void ssd1306_fillRect(uint32_t x, uint32_t y, uint8_t w, uint32_t h, uint32_t color) { - uint32_t m, n = y, iw = w; - - /* scan vertical */ - while (h--) - { - m = x; - w = iw; - /* scan horizontal */ - while (w--) - { - /* invert pixels */ - ssd1306_drawPixel(m++, n, color); - } - n++; - } + uint32_t m, n=y, iw = w; + + /* scan vertical */ + while(h--) + { + m=x; + w=iw; + /* scan horizontal */ + while(w--) + { + /* invert pixels */ + ssd1306_drawPixel(m++, n, color); + } + n++; + } } /* @@ -596,21 +570,21 @@ void ssd1306_fillRect(uint32_t x, uint32_t y, uint8_t w, uint32_t h, uint32_t co */ void ssd1306_xorrect(uint8_t x, uint8_t y, uint8_t w, uint8_t h) { - uint8_t m, n = y, iw = w; - - /* scan vertical */ - while (h--) - { - m = x; - w = iw; - /* scan horizontal */ - while (w--) - { - /* invert pixels */ - ssd1306_xorPixel(m++, n); - } - n++; - } + uint8_t m, n=y, iw = w; + + /* scan vertical */ + while(h--) + { + m=x; + w=iw; + /* scan horizontal */ + while(w--) + { + /* invert pixels */ + ssd1306_xorPixel(m++, n); + } + n++; + } } /* @@ -618,25 +592,25 @@ void ssd1306_xorrect(uint8_t x, uint8_t y, uint8_t w, uint8_t h) */ void ssd1306_drawchar(uint8_t x, uint8_t y, uint8_t chr, uint8_t color) { - uint16_t i, j, col; - uint8_t d; - - for (i = 0; i < 8; i++) - { - d = fontdata[(chr << 3) + i]; - for (j = 0; j < 8; j++) - { - if (d & 0x80) - col = color; - else - col = (~color) & 1; - - ssd1306_drawPixel(x + j, y + i, col); - - // next bit - d <<= 1; - } - } + uint16_t i, j, col; + uint8_t d; + + for(i=0;i<8;i++) + { + d = fontdata[(chr<<3)+i]; + for(j=0;j<8;j++) + { + if(d&0x80) + col = color; + else + col = (~color)&1; + + ssd1306_drawPixel(x+j, y+i, col); + + // next bit + d <<= 1; + } + } } /* @@ -644,26 +618,25 @@ void ssd1306_drawchar(uint8_t x, uint8_t y, uint8_t chr, uint8_t color) */ void ssd1306_drawstr(uint8_t x, uint8_t y, char *str, uint8_t color) { - uint8_t c; - - while ((c = *str++)) - { - ssd1306_drawchar(x, y, c, color); - x += 8; - if (x > 120) - break; - } + uint8_t c; + + while((c=*str++)) + { + ssd1306_drawchar(x, y, c, color); + x += 8; + if(x>120) + break; + } } /* * enum for font size */ -typedef enum -{ - fontsize_8x8 = 1, +typedef enum { + fontsize_8x8 = 1, fontsize_16x16 = 2, fontsize_32x32 = 4, - fontsize_64x64 = 8, + fontsize_64x64 = 8, } font_size_t; /* @@ -672,7 +645,7 @@ typedef enum void ssd1306_drawchar_sz(uint8_t x, uint8_t y, uint8_t chr, uint8_t color, font_size_t font_size) { uint16_t i, j, col; - uint8_t d; + uint8_t d; // Determine the font scale factor based on the font_size parameter uint8_t font_scale = (uint8_t)font_size; @@ -693,10 +666,8 @@ void ssd1306_drawchar_sz(uint8_t x, uint8_t y, uint8_t chr, uint8_t color, font_ col = (~color) & 1; // Draw the pixel at the original size and scaled size using nested for-loops - for (uint8_t k = 0; k < font_scale; k++) - { - for (uint8_t l = 0; l < font_scale; l++) - { + for (uint8_t k = 0; k < font_scale; k++) { + for (uint8_t l = 0; l < font_scale; l++) { ssd1306_drawPixel(x + (j * font_scale) + k, y + (i * font_scale) + l, col); } } @@ -712,15 +683,15 @@ void ssd1306_drawchar_sz(uint8_t x, uint8_t y, uint8_t chr, uint8_t color, font_ */ void ssd1306_drawstr_sz(uint8_t x, uint8_t y, char *str, uint8_t color, font_size_t font_size) { - uint8_t c; - - while ((c = *str++)) - { - ssd1306_drawchar_sz(x, y, c, color, font_size); - x += 8 * font_size; - if (x > 128 - 8 * font_size) - break; - } + uint8_t c; + + while((c=*str++)) + { + ssd1306_drawchar_sz(x, y, c, color, font_size); + x += 8 * font_size; + if(x>128 - 8 * font_size) + break; + } } /* @@ -728,25 +699,25 @@ void ssd1306_drawstr_sz(uint8_t x, uint8_t y, char *str, uint8_t color, font_siz */ uint8_t ssd1306_init(void) { - // pulse reset - ssd1306_rst(); + // pulse reset + ssd1306_rst(); - ssd1306_setbuf(0); - - // initialize OLED + ssd1306_setbuf(0); + + // initialize OLED #if !defined(SSD1306_CUSTOM_INIT_ARRAY) || !SSD1306_CUSTOM_INIT_ARRAY - uint8_t *cmd_list = (uint8_t *)ssd1306_init_array; - while (*cmd_list != SSD1306_TERMINATE_CMDS) - { - if (ssd1306_cmd(*cmd_list++)) - return 1; - } - - // clear display - ssd1306_refresh(); + uint8_t *cmd_list = (uint8_t *)ssd1306_init_array; + while(*cmd_list != SSD1306_TERMINATE_CMDS) + { + if(ssd1306_cmd(*cmd_list++)) + return 1; + } + + // clear display + ssd1306_refresh(); #endif - return 0; + return 0; } #endif diff --git a/src/extralibs/ssd1306_i2c.h b/src/extralibs/ssd1306_i2c.h index 465985e..41b265d 100644 --- a/src/extralibs/ssd1306_i2c.h +++ b/src/extralibs/ssd1306_i2c.h @@ -27,14 +27,14 @@ #define TIMEOUT_MAX 100000 // uncomment this to enable IRQ-driven operation -// #define SSD1306_I2C_IRQ +//#define SSD1306_I2C_IRQ #ifdef SSD1306_I2C_IRQ // some stuff that IRQ mode needs volatile uint8_t ssd1306_i2c_send_buffer[64], *ssd1306_i2c_send_ptr, ssd1306_i2c_send_sz, ssd1306_i2c_irq_state; // uncomment this to enable time diags in IRQ -// #define IRQ_DIAG +//#define IRQ_DIAG #endif /* @@ -42,62 +42,62 @@ volatile uint8_t ssd1306_i2c_send_buffer[64], *ssd1306_i2c_send_ptr, ssd1306_i2c */ void ssd1306_i2c_setup(void) { - uint16_t tempreg; - - // Reset I2C1 to init all regs - RCC->APB1PRSTR |= RCC_APB1Periph_I2C1; - RCC->APB1PRSTR &= ~RCC_APB1Periph_I2C1; - - // set freq - tempreg = I2C1->CTLR2; - tempreg &= ~I2C_CTLR2_FREQ; - tempreg |= (FUNCONF_SYSTEM_CORE_CLOCK / SSD1306_I2C_PRERATE) & I2C_CTLR2_FREQ; - I2C1->CTLR2 = tempreg; - - // Set clock config - tempreg = 0; + uint16_t tempreg; + + // Reset I2C1 to init all regs + RCC->APB1PRSTR |= RCC_APB1Periph_I2C1; + RCC->APB1PRSTR &= ~RCC_APB1Periph_I2C1; + + // set freq + tempreg = I2C1->CTLR2; + tempreg &= ~I2C_CTLR2_FREQ; + tempreg |= (FUNCONF_SYSTEM_CORE_CLOCK/SSD1306_I2C_PRERATE)&I2C_CTLR2_FREQ; + I2C1->CTLR2 = tempreg; + + // Set clock config + tempreg = 0; #if (SSD1306_I2C_CLKRATE <= 100000) - // standard mode good to 100kHz - tempreg = (FUNCONF_SYSTEM_CORE_CLOCK / (2 * SSD1306_I2C_CLKRATE)) & I2C_CKCFGR_CCR; + // standard mode good to 100kHz + tempreg = (FUNCONF_SYSTEM_CORE_CLOCK/(2*SSD1306_I2C_CLKRATE))&I2C_CKCFGR_CCR; #else - // fast mode over 100kHz + // fast mode over 100kHz #ifndef SSD1306_I2C_DUTY - // 33% duty cycle - tempreg = (FUNCONF_SYSTEM_CORE_CLOCK / (3 * SSD1306_I2C_CLKRATE)) & I2C_CKCFGR_CCR; + // 33% duty cycle + tempreg = (FUNCONF_SYSTEM_CORE_CLOCK/(3*SSD1306_I2C_CLKRATE))&I2C_CKCFGR_CCR; #else - // 36% duty cycle - tempreg = (FUNCONF_SYSTEM_CORE_CLOCK / (25 * SSD1306_I2C_CLKRATE)) & I2C_CKCFGR_CCR; - tempreg |= I2C_CKCFGR_DUTY; + // 36% duty cycle + tempreg = (FUNCONF_SYSTEM_CORE_CLOCK/(25*SSD1306_I2C_CLKRATE))&I2C_CKCFGR_CCR; + tempreg |= I2C_CKCFGR_DUTY; #endif - tempreg |= I2C_CKCFGR_FS; + tempreg |= I2C_CKCFGR_FS; #endif - I2C1->CKCFGR = tempreg; + I2C1->CKCFGR = tempreg; #ifdef SSD1306_I2C_IRQ - // enable IRQ driven operation - NVIC_EnableIRQ(I2C1_EV_IRQn); - - // initialize the state - ssd1306_i2c_irq_state = 0; + // enable IRQ driven operation + NVIC_EnableIRQ(I2C1_EV_IRQn); + + // initialize the state + ssd1306_i2c_irq_state = 0; #endif + + // Enable I2C + I2C1->CTLR1 |= I2C_CTLR1_PE; - // Enable I2C - I2C1->CTLR1 |= I2C_CTLR1_PE; - - // set ACK mode - I2C1->CTLR1 |= I2C_CTLR1_ACK; + // set ACK mode + I2C1->CTLR1 |= I2C_CTLR1_ACK; } /* * error descriptions */ char *errstr[] = - { - "not busy", - "master mode", - "transmit mode", - "tx empty", - "transmit complete", +{ + "not busy", + "master mode", + "transmit mode", + "tx empty", + "transmit complete", }; /* @@ -105,28 +105,28 @@ char *errstr[] = */ uint8_t ssd1306_i2c_error(uint8_t err) { - // report error - printf("ssd1306_i2c_error - timeout waiting for %s\n\r", errstr[err]); + // report error + printf("ssd1306_i2c_error - timeout waiting for %s\n\r", errstr[err]); + + // reset & initialize I2C + ssd1306_i2c_setup(); - // reset & initialize I2C - ssd1306_i2c_setup(); - - return 1; + return 1; } // event codes we use -#define SSD1306_I2C_EVENT_MASTER_MODE_SELECT ((uint32_t)0x00030001) /* BUSY, MSL and SB flag */ -#define SSD1306_I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED ((uint32_t)0x00070082) /* BUSY, MSL, ADDR, TXE and TRA flags */ -#define SSD1306_I2C_EVENT_MASTER_BYTE_TRANSMITTED ((uint32_t)0x00070084) /* TRA, BUSY, MSL, TXE and BTF flags */ +#define SSD1306_I2C_EVENT_MASTER_MODE_SELECT ((uint32_t)0x00030001) /* BUSY, MSL and SB flag */ +#define SSD1306_I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED ((uint32_t)0x00070082) /* BUSY, MSL, ADDR, TXE and TRA flags */ +#define SSD1306_I2C_EVENT_MASTER_BYTE_TRANSMITTED ((uint32_t)0x00070084) /* TRA, BUSY, MSL, TXE and BTF flags */ /* * check for 32-bit event codes */ uint8_t ssd1306_i2c_chk_evt(uint32_t event_mask) { - /* read order matters here! STAR1 before STAR2!! */ - uint32_t status = I2C1->STAR1 | (I2C1->STAR2 << 16); - return (status & event_mask) == event_mask; + /* read order matters here! STAR1 before STAR2!! */ + uint32_t status = I2C1->STAR1 | (I2C1->STAR2<<16); + return (status & event_mask) == event_mask; } #ifdef SSD1306_I2C_IRQ @@ -135,67 +135,63 @@ uint8_t ssd1306_i2c_chk_evt(uint32_t event_mask) */ uint8_t ssd1306_i2c_send(uint8_t addr, uint8_t *data, uint8_t sz) { - int32_t timeout; + int32_t timeout; + +#ifdef IRQ_DIAG + GPIOC->BSHR = (1<<(3)); +#endif + + // error out if buffer under/overflow + if((sz > sizeof(ssd1306_i2c_send_buffer)) || !sz) + return 2; + + // wait for previous packet to finish + while(ssd1306_i2c_irq_state); + +#ifdef IRQ_DIAG + GPIOC->BSHR = (1<<(16+3)); + GPIOC->BSHR = (1<<(4)); +#endif + + // init buffer for sending + ssd1306_i2c_send_sz = sz; + ssd1306_i2c_send_ptr = ssd1306_i2c_send_buffer; + memcpy((uint8_t *)ssd1306_i2c_send_buffer, data, sz); + + // wait for not busy + timeout = TIMEOUT_MAX; + while((I2C1->STAR2 & I2C_STAR2_BUSY) && (timeout--)); + if(timeout==-1) + return ssd1306_i2c_error(0); + + // Set START condition + I2C1->CTLR1 |= I2C_CTLR1_START; + + // wait for master mode select + timeout = TIMEOUT_MAX; + while((!ssd1306_i2c_chk_evt(SSD1306_I2C_EVENT_MASTER_MODE_SELECT)) && (timeout--)); + if(timeout==-1) + return ssd1306_i2c_error(1); + + // send 7-bit address + write flag + I2C1->DATAR = addr<<1; + + // wait for transmit condition + timeout = TIMEOUT_MAX; + while((!ssd1306_i2c_chk_evt(SSD1306_I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED)) && (timeout--)); + if(timeout==-1) + return ssd1306_i2c_error(2); + + // Enable TXE interrupt + I2C1->CTLR2 |= I2C_CTLR2_ITBUFEN | I2C_CTLR2_ITEVTEN; + ssd1306_i2c_irq_state = 1; #ifdef IRQ_DIAG - GPIOC->BSHR = (1 << (3)); + GPIOC->BSHR = (1<<(16+4)); #endif - - // error out if buffer under/overflow - if ((sz > sizeof(ssd1306_i2c_send_buffer)) || !sz) - return 2; - - // wait for previous packet to finish - while (ssd1306_i2c_irq_state) - ; - -#ifdef IRQ_DIAG - GPIOC->BSHR = (1 << (16 + 3)); - GPIOC->BSHR = (1 << (4)); -#endif - - // init buffer for sending - ssd1306_i2c_send_sz = sz; - ssd1306_i2c_send_ptr = ssd1306_i2c_send_buffer; - memcpy((uint8_t *)ssd1306_i2c_send_buffer, data, sz); - - // wait for not busy - timeout = TIMEOUT_MAX; - while ((I2C1->STAR2 & I2C_STAR2_BUSY) && (timeout--)) - ; - if (timeout == -1) - return ssd1306_i2c_error(0); - - // Set START condition - I2C1->CTLR1 |= I2C_CTLR1_START; - - // wait for master mode select - timeout = TIMEOUT_MAX; - while ((!ssd1306_i2c_chk_evt(SSD1306_I2C_EVENT_MASTER_MODE_SELECT)) && (timeout--)) - ; - if (timeout == -1) - return ssd1306_i2c_error(1); - - // send 7-bit address + write flag - I2C1->DATAR = addr << 1; - - // wait for transmit condition - timeout = TIMEOUT_MAX; - while ((!ssd1306_i2c_chk_evt(SSD1306_I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED)) && (timeout--)) - ; - if (timeout == -1) - return ssd1306_i2c_error(2); - - // Enable TXE interrupt - I2C1->CTLR2 |= I2C_CTLR2_ITBUFEN | I2C_CTLR2_ITEVTEN; - ssd1306_i2c_irq_state = 1; - -#ifdef IRQ_DIAG - GPIOC->BSHR = (1 << (16 + 4)); -#endif - - // exit - return 0; + + // exit + return 0; } /* @@ -204,43 +200,42 @@ uint8_t ssd1306_i2c_send(uint8_t addr, uint8_t *data, uint8_t sz) void I2C1_EV_IRQHandler(void) __attribute__((interrupt)); void I2C1_EV_IRQHandler(void) { - uint16_t STAR1, STAR2 __attribute__((unused)); - + uint16_t STAR1, STAR2 __attribute__((unused)); + #ifdef IRQ_DIAG - GPIOC->BSHR = (1 << (4)); + GPIOC->BSHR = (1<<(4)); #endif - // read status, clear any events - STAR1 = I2C1->STAR1; - STAR2 = I2C1->STAR2; + // read status, clear any events + STAR1 = I2C1->STAR1; + STAR2 = I2C1->STAR2; + + /* check for TXE */ + if(STAR1 & I2C_STAR1_TXE) + { + /* check for remaining data */ + if(ssd1306_i2c_send_sz--) + I2C1->DATAR = *ssd1306_i2c_send_ptr++; - /* check for TXE */ - if (STAR1 & I2C_STAR1_TXE) - { - /* check for remaining data */ - if (ssd1306_i2c_send_sz--) - I2C1->DATAR = *ssd1306_i2c_send_ptr++; + /* was that the last byte? */ + if(!ssd1306_i2c_send_sz) + { + // disable TXE interrupt + I2C1->CTLR2 &= ~(I2C_CTLR2_ITBUFEN | I2C_CTLR2_ITEVTEN); + + // reset IRQ state + ssd1306_i2c_irq_state = 0; + + // wait for tx complete + while(!ssd1306_i2c_chk_evt(SSD1306_I2C_EVENT_MASTER_BYTE_TRANSMITTED)); - /* was that the last byte? */ - if (!ssd1306_i2c_send_sz) - { - // disable TXE interrupt - I2C1->CTLR2 &= ~(I2C_CTLR2_ITBUFEN | I2C_CTLR2_ITEVTEN); - - // reset IRQ state - ssd1306_i2c_irq_state = 0; - - // wait for tx complete - while (!ssd1306_i2c_chk_evt(SSD1306_I2C_EVENT_MASTER_BYTE_TRANSMITTED)) - ; - - // set STOP condition - I2C1->CTLR1 |= I2C_CTLR1_STOP; - } - } + // set STOP condition + I2C1->CTLR1 |= I2C_CTLR1_STOP; + } + } #ifdef IRQ_DIAG - GPIOC->BSHR = (1 << (16 + 4)); + GPIOC->BSHR = (1<<(16+4)); #endif } #else @@ -249,61 +244,56 @@ void I2C1_EV_IRQHandler(void) */ uint8_t ssd1306_i2c_send(uint8_t addr, const uint8_t *data, int sz) { - int32_t timeout; + int32_t timeout; + + // wait for not busy + timeout = TIMEOUT_MAX; + while((I2C1->STAR2 & I2C_STAR2_BUSY) && (timeout--)); + if(timeout==-1) + return ssd1306_i2c_error(0); - // wait for not busy - timeout = TIMEOUT_MAX; - while ((I2C1->STAR2 & I2C_STAR2_BUSY) && (timeout--)) - ; - if (timeout == -1) - return ssd1306_i2c_error(0); + // Set START condition + I2C1->CTLR1 |= I2C_CTLR1_START; + + // wait for master mode select + timeout = TIMEOUT_MAX; + while((!ssd1306_i2c_chk_evt(SSD1306_I2C_EVENT_MASTER_MODE_SELECT)) && (timeout--)); + if(timeout==-1) + return ssd1306_i2c_error(1); + + // send 7-bit address + write flag + I2C1->DATAR = addr<<1; - // Set START condition - I2C1->CTLR1 |= I2C_CTLR1_START; + // wait for transmit condition + timeout = TIMEOUT_MAX; + while((!ssd1306_i2c_chk_evt(SSD1306_I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED)) && (timeout--)); + if(timeout==-1) + return ssd1306_i2c_error(2); - // wait for master mode select - timeout = TIMEOUT_MAX; - while ((!ssd1306_i2c_chk_evt(SSD1306_I2C_EVENT_MASTER_MODE_SELECT)) && (timeout--)) - ; - if (timeout == -1) - return ssd1306_i2c_error(1); + // send data one byte at a time + while(sz--) + { + // wait for TX Empty + timeout = TIMEOUT_MAX; + while(!(I2C1->STAR1 & I2C_STAR1_TXE) && (timeout--)); + if(timeout==-1) + return ssd1306_i2c_error(3); + + // send command + I2C1->DATAR = *data++; + } - // send 7-bit address + write flag - I2C1->DATAR = addr << 1; + // wait for tx complete + timeout = TIMEOUT_MAX; + while((!ssd1306_i2c_chk_evt(SSD1306_I2C_EVENT_MASTER_BYTE_TRANSMITTED)) && (timeout--)); + if(timeout==-1) + return ssd1306_i2c_error(4); - // wait for transmit condition - timeout = TIMEOUT_MAX; - while ((!ssd1306_i2c_chk_evt(SSD1306_I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED)) && (timeout--)) - ; - if (timeout == -1) - return ssd1306_i2c_error(2); - - // send data one byte at a time - while (sz--) - { - // wait for TX Empty - timeout = TIMEOUT_MAX; - while (!(I2C1->STAR1 & I2C_STAR1_TXE) && (timeout--)) - ; - if (timeout == -1) - return ssd1306_i2c_error(3); - - // send command - I2C1->DATAR = *data++; - } - - // wait for tx complete - timeout = TIMEOUT_MAX; - while ((!ssd1306_i2c_chk_evt(SSD1306_I2C_EVENT_MASTER_BYTE_TRANSMITTED)) && (timeout--)) - ; - if (timeout == -1) - return ssd1306_i2c_error(4); - - // set STOP condition - I2C1->CTLR1 |= I2C_CTLR1_STOP; - - // we're happy - return 0; + // set STOP condition + I2C1->CTLR1 |= I2C_CTLR1_STOP; + + // we're happy + return 0; } #endif @@ -312,20 +302,20 @@ uint8_t ssd1306_i2c_send(uint8_t addr, const uint8_t *data, int sz) */ uint8_t ssd1306_pkt_send(const uint8_t *data, int sz, uint8_t cmd) { - uint8_t pkt[33]; - - /* build command or data packets */ - if (cmd) - { - pkt[0] = 0; - pkt[1] = *data; - } - else - { - pkt[0] = 0x40; - memcpy(&pkt[1], data, sz); - } - return ssd1306_i2c_send(SSD1306_I2C_ADDR, pkt, sz + 1); + uint8_t pkt[33]; + + /* build command or data packets */ + if(cmd) + { + pkt[0] = 0; + pkt[1] = *data; + } + else + { + pkt[0] = 0x40; + memcpy(&pkt[1], data, sz); + } + return ssd1306_i2c_send(SSD1306_I2C_ADDR, pkt, sz+1); } /* @@ -333,51 +323,51 @@ uint8_t ssd1306_pkt_send(const uint8_t *data, int sz, uint8_t cmd) */ uint8_t ssd1306_i2c_init(void) { - // Enable GPIOC and I2C - RCC->APB1PCENR |= RCC_APB1Periph_I2C1; + // Enable GPIOC and I2C + RCC->APB1PCENR |= RCC_APB1Periph_I2C1; #ifdef CH32V20x - RCC->APB2PCENR |= RCC_APB2Periph_GPIOB | RCC_APB2Periph_AFIO; + RCC->APB2PCENR |= RCC_APB2Periph_GPIOB | RCC_APB2Periph_AFIO; #ifdef SSD1306_REMAP_I2C - AFIO->PCFR1 |= AFIO_PCFR1_I2C1_REMAP; - funPinMode(PB8, GPIO_CFGLR_OUT_10Mhz_AF_OD); - funPinMode(PB9, GPIO_CFGLR_OUT_10Mhz_AF_OD); + AFIO->PCFR1 |= AFIO_PCFR1_I2C1_REMAP; + funPinMode( PB8, GPIO_CFGLR_OUT_10Mhz_AF_OD ); + funPinMode( PB9, GPIO_CFGLR_OUT_10Mhz_AF_OD ); #else - funPinMode(PB6, GPIO_CFGLR_OUT_10Mhz_AF_OD); - funPinMode(PB7, GPIO_CFGLR_OUT_10Mhz_AF_OD); + funPinMode( PB6, GPIO_CFGLR_OUT_10Mhz_AF_OD ); + funPinMode( PB7, GPIO_CFGLR_OUT_10Mhz_AF_OD ); #endif #else - RCC->APB2PCENR |= RCC_APB2Periph_GPIOC | RCC_APB2Periph_AFIO; - // PC1 is SDA, 10MHz Output, alt func, open-drain - GPIOC->CFGLR &= ~(0xf << (4 * 1)); - GPIOC->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_OD_AF) << (4 * 1); - - // PC2 is SCL, 10MHz Output, alt func, open-drain - GPIOC->CFGLR &= ~(0xf << (4 * 2)); - GPIOC->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_OD_AF) << (4 * 2); + RCC->APB2PCENR |= RCC_APB2Periph_GPIOC | RCC_APB2Periph_AFIO; + // PC1 is SDA, 10MHz Output, alt func, open-drain + GPIOC->CFGLR &= ~(0xf<<(4*1)); + GPIOC->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_OD_AF)<<(4*1); + + // PC2 is SCL, 10MHz Output, alt func, open-drain + GPIOC->CFGLR &= ~(0xf<<(4*2)); + GPIOC->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_OD_AF)<<(4*2); #endif #ifdef IRQ_DIAG - // GPIO diags on PC3/PC4 - GPIOC->CFGLR &= ~(0xf << (4 * 3)); - GPIOC->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP) << (4 * 3); - GPIOC->BSHR = (1 << (16 + 3)); - GPIOC->CFGLR &= ~(0xf << (4 * 4)); - GPIOC->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP) << (4 * 4); - GPIOC->BSHR = (1 << (16 + 4)); + // GPIO diags on PC3/PC4 + GPIOC->CFGLR &= ~(0xf<<(4*3)); + GPIOC->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP)<<(4*3); + GPIOC->BSHR = (1<<(16+3)); + GPIOC->CFGLR &= ~(0xf<<(4*4)); + GPIOC->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP)<<(4*4); + GPIOC->BSHR = (1<<(16+4)); #endif - // load I2C regs - ssd1306_i2c_setup(); - + // load I2C regs + ssd1306_i2c_setup(); + #if 0 // test if SSD1306 is on the bus by sending display off command uint8_t command = 0xAF; return ssd1306_pkt_send(&command, 1, 1); #else - return 0; + return 0; #endif } diff --git a/src/extralibs/ssd1306_i2c_bitbang.h b/src/extralibs/ssd1306_i2c_bitbang.h index 92c3acf..7ab3334 100644 --- a/src/extralibs/ssd1306_i2c_bitbang.h +++ b/src/extralibs/ssd1306_i2c_bitbang.h @@ -26,115 +26,111 @@ */ void ssd1306_i2c_setup(void) { - funGpioInitAll(); - funPinMode(SSD1306_I2C_BITBANG_SDA, GPIO_CFGLR_OUT_10Mhz_PP); - funDigitalWrite(SSD1306_I2C_BITBANG_SDA, 1); - funPinMode(SSD1306_I2C_BITBANG_SCL, GPIO_CFGLR_OUT_10Mhz_PP); - funDigitalWrite(SSD1306_I2C_BITBANG_SCL, 1); + funGpioInitAll(); + funPinMode( SSD1306_I2C_BITBANG_SDA, GPIO_CFGLR_OUT_10Mhz_PP ); + funDigitalWrite( SSD1306_I2C_BITBANG_SDA, 1 ); + funPinMode( SSD1306_I2C_BITBANG_SCL, GPIO_CFGLR_OUT_10Mhz_PP ); + funDigitalWrite( SSD1306_I2C_BITBANG_SCL, 1 ); } -#define SDA_HIGH funDigitalWrite(SSD1306_I2C_BITBANG_SDA, 1); -#define SCL_HIGH funDigitalWrite(SSD1306_I2C_BITBANG_SCL, 1); -#define SDA_LOW funDigitalWrite(SSD1306_I2C_BITBANG_SDA, 0); -#define SCL_LOW funDigitalWrite(SSD1306_I2C_BITBANG_SCL, 0); -#define SDA_IN funDigitalRead(SSD1306_I2C_BITBANG_SDA); +#define SDA_HIGH funDigitalWrite( SSD1306_I2C_BITBANG_SDA, 1 ); +#define SCL_HIGH funDigitalWrite( SSD1306_I2C_BITBANG_SCL, 1 ); +#define SDA_LOW funDigitalWrite( SSD1306_I2C_BITBANG_SDA, 0 ); +#define SCL_LOW funDigitalWrite( SSD1306_I2C_BITBANG_SCL, 0 ); +#define SDA_IN funDigitalRead( SSD1306_I2C_BITBANG_SDA ); #define I2CSPEEDBASE 1 -#define I2CDELAY_FUNC(x) ADD_N_NOPS(x * 1) -// Delay_Us(x*1); +#define I2CDELAY_FUNC(x) ADD_N_NOPS(x*1) +//Delay_Us(x*1); static void ssd1306_i2c_sendstart() { - SCL_HIGH - I2CDELAY_FUNC(1 * I2CSPEEDBASE); - SDA_LOW - I2CDELAY_FUNC(1 * I2CSPEEDBASE); - SCL_LOW - I2CDELAY_FUNC(1 * I2CSPEEDBASE); + SCL_HIGH + I2CDELAY_FUNC( 1 * I2CSPEEDBASE ); + SDA_LOW + I2CDELAY_FUNC( 1 * I2CSPEEDBASE ); + SCL_LOW + I2CDELAY_FUNC( 1 * I2CSPEEDBASE ); } void ssd1306_i2c_sendstop() { - SDA_LOW - I2CDELAY_FUNC(1 * I2CSPEEDBASE); - SCL_LOW - I2CDELAY_FUNC(1 * I2CSPEEDBASE); - SCL_HIGH - I2CDELAY_FUNC(1 * I2CSPEEDBASE); - SDA_HIGH - I2CDELAY_FUNC(1 * I2CSPEEDBASE); + SDA_LOW + I2CDELAY_FUNC( 1 * I2CSPEEDBASE ); + SCL_LOW + I2CDELAY_FUNC( 1 * I2CSPEEDBASE ); + SCL_HIGH + I2CDELAY_FUNC( 1 * I2CSPEEDBASE ); + SDA_HIGH + I2CDELAY_FUNC( 1 * I2CSPEEDBASE ); } -// Return nonzero on failure. -unsigned char ssd1306_i2c_sendbyte(unsigned char data) +//Return nonzero on failure. +unsigned char ssd1306_i2c_sendbyte( unsigned char data ) { - unsigned int i; - for (i = 0; i < 8; i++) - { - I2CDELAY_FUNC(1 * I2CSPEEDBASE); - if (data & 0x80) - { - SDA_HIGH; - } - else - { - SDA_LOW; - } - data <<= 1; - I2CDELAY_FUNC(1 * I2CSPEEDBASE); - SCL_HIGH - I2CDELAY_FUNC(2 * I2CSPEEDBASE); - SCL_LOW - } + unsigned int i; + for( i = 0; i < 8; i++ ) + { + I2CDELAY_FUNC( 1 * I2CSPEEDBASE ); + if( data & 0x80 ) + { SDA_HIGH; } + else + { SDA_LOW; } + data<<=1; + I2CDELAY_FUNC( 1 * I2CSPEEDBASE ); + SCL_HIGH + I2CDELAY_FUNC( 2 * I2CSPEEDBASE ); + SCL_LOW + } - // Immediately after sending last bit, open up DDDR for control. - I2CDELAY_FUNC(1 * I2CSPEEDBASE); - funPinMode(SSD1306_I2C_BITBANG_SDA, GPIO_CFGLR_IN_PUPD); - SDA_HIGH - I2CDELAY_FUNC(1 * I2CSPEEDBASE); - SCL_HIGH - I2CDELAY_FUNC(1 * I2CSPEEDBASE); - i = SDA_IN; - I2CDELAY_FUNC(1 * I2CSPEEDBASE); - SCL_LOW - I2CDELAY_FUNC(1 * I2CSPEEDBASE); - SDA_HIGH // Maybe? - funPinMode(SSD1306_I2C_BITBANG_SDA, GPIO_CFGLR_OUT_10Mhz_PP); - I2CDELAY_FUNC(1 * I2CSPEEDBASE); - return !!i; + //Immediately after sending last bit, open up DDDR for control. + I2CDELAY_FUNC( 1 * I2CSPEEDBASE ); + funPinMode( SSD1306_I2C_BITBANG_SDA, GPIO_CFGLR_IN_PUPD ); + SDA_HIGH + I2CDELAY_FUNC( 1 * I2CSPEEDBASE ); + SCL_HIGH + I2CDELAY_FUNC( 1 * I2CSPEEDBASE ); + i = SDA_IN; + I2CDELAY_FUNC( 1 * I2CSPEEDBASE ); + SCL_LOW + I2CDELAY_FUNC( 1 * I2CSPEEDBASE ); + SDA_HIGH // Maybe? + funPinMode( SSD1306_I2C_BITBANG_SDA, GPIO_CFGLR_OUT_10Mhz_PP ); + I2CDELAY_FUNC( 1 * I2CSPEEDBASE ); + return !!i; } uint8_t ssd1306_pkt_send(const uint8_t *data, int sz, uint8_t cmd) { - ssd1306_i2c_sendstart(); - int r = ssd1306_i2c_sendbyte(SSD1306_I2C_ADDR << 1); - if (r) return r; - // ssd1306_i2c_sendstart(); For some reason displays don't want repeated start - if (cmd) - { - if (ssd1306_i2c_sendbyte(0x00)) - return 1; // Control - } - else - { - if (ssd1306_i2c_sendbyte(0x40)) - return 1; // Data - } - for (int i = 0; i < sz; i++) - { - if (ssd1306_i2c_sendbyte(data[i])) - return 1; - } - ssd1306_i2c_sendstop(); - return 0; + ssd1306_i2c_sendstart(); + int r = ssd1306_i2c_sendbyte( SSD1306_I2C_ADDR<<1 ); + if( r ) return r; + //ssd1306_i2c_sendstart(); For some reason displays don't want repeated start + if(cmd) + { + if( ssd1306_i2c_sendbyte( 0x00 ) ) + return 1; // Control + } + else + { + if( ssd1306_i2c_sendbyte( 0x40 ) ) + return 1; // Data + } + for( int i = 0; i < sz; i++ ) + { + if( ssd1306_i2c_sendbyte( data[i] ) ) + return 1; + } + ssd1306_i2c_sendstop(); + return 0; } void ssd1306_rst(void) { - funPinMode(SSD1306_RST_PIN, GPIO_CFGLR_OUT_10Mhz_PP); - funDigitalWrite(SSD1306_RST_PIN, 0); - Delay_Ms(10); - funDigitalWrite(SSD1306_RST_PIN, 1); - Delay_Us(10); + funPinMode( SSD1306_RST_PIN, GPIO_CFGLR_OUT_10Mhz_PP ); + funDigitalWrite( SSD1306_RST_PIN, 0 ); + Delay_Ms(10); + funDigitalWrite( SSD1306_RST_PIN, 1 ); + Delay_Us(10); } #endif diff --git a/src/extralibs/ssd1306_spi.h b/src/extralibs/ssd1306_spi.h index 7112fe8..bc7468c 100644 --- a/src/extralibs/ssd1306_spi.h +++ b/src/extralibs/ssd1306_spi.h @@ -24,7 +24,7 @@ #endif #ifndef SSD1306_SCK_PIN -#define SSD1306_SCK_PIN PC5 +#define SSD1306_SCK_PIN PC5 #endif #ifndef SSD1306_BAUD_RATE_PRESCALER @@ -36,31 +36,31 @@ */ uint8_t ssd1306_spi_init(void) { - // Enable GPIOC and SPI - RCC->APB2PCENR |= RCC_APB2Periph_SPI1; + // Enable GPIOC and SPI + RCC->APB2PCENR |= RCC_APB2Periph_SPI1; + + funGpioInitAll(); + funPinMode( SSD1306_RST_PIN, GPIO_CFGLR_OUT_50Mhz_PP ); + funPinMode( SSD1306_CS_PIN, GPIO_CFGLR_OUT_50Mhz_PP ); + funPinMode( SSD1306_DC_PIN, GPIO_CFGLR_OUT_50Mhz_PP ); + funPinMode( SSD1306_MOSI_PIN, GPIO_CFGLR_OUT_50Mhz_AF_PP ); + funPinMode( SSD1306_SCK_PIN, GPIO_CFGLR_OUT_50Mhz_AF_PP ); - funGpioInitAll(); - funPinMode(SSD1306_RST_PIN, GPIO_CFGLR_OUT_50Mhz_PP); - funPinMode(SSD1306_CS_PIN, GPIO_CFGLR_OUT_50Mhz_PP); - funPinMode(SSD1306_DC_PIN, GPIO_CFGLR_OUT_50Mhz_PP); - funPinMode(SSD1306_MOSI_PIN, GPIO_CFGLR_OUT_50Mhz_AF_PP); - funPinMode(SSD1306_SCK_PIN, GPIO_CFGLR_OUT_50Mhz_AF_PP); + funDigitalWrite( SSD1306_RST_PIN, FUN_HIGH ); + funDigitalWrite( SSD1306_CS_PIN, FUN_HIGH ); + funDigitalWrite( SSD1306_DC_PIN, FUN_LOW ); - funDigitalWrite(SSD1306_RST_PIN, FUN_HIGH); - funDigitalWrite(SSD1306_CS_PIN, FUN_HIGH); - funDigitalWrite(SSD1306_DC_PIN, FUN_LOW); + // Configure SPI + SPI1->CTLR1 = + SPI_NSS_Soft | SPI_CPHA_1Edge | SPI_CPOL_Low | SPI_DataSize_8b | + SPI_Mode_Master | SPI_Direction_1Line_Tx | + SSD1306_BAUD_RATE_PRESCALER; - // Configure SPI - SPI1->CTLR1 = - SPI_NSS_Soft | SPI_CPHA_1Edge | SPI_CPOL_Low | SPI_DataSize_8b | - SPI_Mode_Master | SPI_Direction_1Line_Tx | - SSD1306_BAUD_RATE_PRESCALER; - - // enable SPI port - SPI1->CTLR1 |= CTLR1_SPE_Set; - - // always succeed - return 0; + // enable SPI port + SPI1->CTLR1 |= CTLR1_SPE_Set; + + // always succeed + return 0; } /* @@ -68,9 +68,9 @@ uint8_t ssd1306_spi_init(void) */ void ssd1306_rst(void) { - funDigitalWrite(SSD1306_RST_PIN, FUN_LOW); - Delay_Ms(10); - funDigitalWrite(SSD1306_RST_PIN, FUN_HIGH); + funDigitalWrite( SSD1306_RST_PIN, FUN_LOW ); + Delay_Ms(10); + funDigitalWrite( SSD1306_RST_PIN, FUN_HIGH ); } /* @@ -78,35 +78,34 @@ void ssd1306_rst(void) */ uint8_t ssd1306_pkt_send(const uint8_t *data, int sz, uint8_t cmd) { - if (cmd) - { - funDigitalWrite(SSD1306_DC_PIN, FUN_LOW); - } - else - { - funDigitalWrite(SSD1306_DC_PIN, FUN_HIGH); - } + if(cmd) + { + funDigitalWrite( SSD1306_DC_PIN, FUN_LOW ); + } + else + { + funDigitalWrite( SSD1306_DC_PIN, FUN_HIGH ); + } - funDigitalWrite(SSD1306_CS_PIN, FUN_LOW); - - // send data - while (sz--) - { - // wait for TXE - while (!(SPI1->STATR & SPI_STATR_TXE)) - ; - - // Send byte - SPI1->DATAR = *data++; - } - - // wait for not busy before exiting - while (SPI1->STATR & SPI_STATR_BSY) {} - - funDigitalWrite(SSD1306_CS_PIN, FUN_HIGH); - - // we're happy - return 0; + funDigitalWrite( SSD1306_CS_PIN, FUN_LOW ); + + // send data + while(sz--) + { + // wait for TXE + while(!(SPI1->STATR & SPI_STATR_TXE)); + + // Send byte + SPI1->DATAR = *data++; + } + + // wait for not busy before exiting + while(SPI1->STATR & SPI_STATR_BSY) { } + + funDigitalWrite( SSD1306_CS_PIN, FUN_HIGH ); + + // we're happy + return 0; } #endif diff --git a/src/extralibs/usb_defines.h b/src/extralibs/usb_defines.h index e588982..1e4b9a2 100644 --- a/src/extralibs/usb_defines.h +++ b/src/extralibs/usb_defines.h @@ -37,721 +37,714 @@ #include #include + /*------------------------------------------------------------------*/ /* From Linux *------------------------------------------------------------------*/ -#define USB_DIR_OUT 0 /* to device */ -#define USB_DIR_IN 0x80 /* to host */ -#define USB_TYPE_MASK (0x03 << 5) -#define USB_TYPE_STANDARD (0x00 << 5) -#define USB_TYPE_CLASS (0x01 << 5) -#define USB_TYPE_VENDOR (0x02 << 5) -#define USB_TYPE_RESERVED (0x03 << 5) +#define USB_DIR_OUT 0 /* to device */ +#define USB_DIR_IN 0x80 /* to host */ + +#define USB_TYPE_MASK (0x03 << 5) +#define USB_TYPE_STANDARD (0x00 << 5) +#define USB_TYPE_CLASS (0x01 << 5) +#define USB_TYPE_VENDOR (0x02 << 5) +#define USB_TYPE_RESERVED (0x03 << 5) + /* * USB recipients, the third of three bRequestType fields */ -#define USB_RECIP_MASK 0x1f -#define USB_RECIP_DEVICE 0x00 -#define USB_RECIP_INTERFACE 0x01 -#define USB_RECIP_ENDPOINT 0x02 -#define USB_RECIP_OTHER 0x03 +#define USB_RECIP_MASK 0x1f +#define USB_RECIP_DEVICE 0x00 +#define USB_RECIP_INTERFACE 0x01 +#define USB_RECIP_ENDPOINT 0x02 +#define USB_RECIP_OTHER 0x03 /* From Wireless USB 1.0 */ -#define USB_RECIP_PORT 0x04 -#define USB_RECIP_RPIPE 0x05 +#define USB_RECIP_PORT 0x04 +#define USB_RECIP_RPIPE 0x05 #define TU_ATTR_PACKED __attribute__((packed)) #ifndef TU_BIT -#define TU_BIT(n) (1U << (n)) +#define TU_BIT(n) (1U << (n)) #endif #ifndef TU_STRCAT -#define TU_STRCAT(a, b) a##b ///< concat without expand -#define TU_XSTRCAT(a, b) TU_STRCAT(a, b) ///< expand then concat +#define TU_STRCAT(a, b) a##b ///< concat without expand +#define TU_XSTRCAT(a, b) TU_STRCAT(a, b) ///< expand then concat #endif #ifndef _TU_COUNTER_ #if defined __COUNTER__ && __COUNTER__ != __COUNTER__ -#define _TU_COUNTER_ __COUNTER__ + #define _TU_COUNTER_ __COUNTER__ #else -#define _TU_COUNTER_ __LINE__ + #define _TU_COUNTER_ __LINE__ #endif #endif // Compile-time Assert -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L -#define TU_VERIFY_STATIC _Static_assert -#elif defined(__cplusplus) && __cplusplus >= 201103L -#define TU_VERIFY_STATIC static_assert +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L + #define TU_VERIFY_STATIC _Static_assert +#elif defined (__cplusplus) && __cplusplus >= 201103L + #define TU_VERIFY_STATIC static_assert #else -#define TU_VERIFY_STATIC(const_expr, _mess) \ - enum \ - { \ - TU_XSTRCAT(_verify_static_, _TU_COUNTER_) = 1 / (!!(const_expr)) \ - } + #define TU_VERIFY_STATIC(const_expr, _mess) enum { TU_XSTRCAT(_verify_static_, _TU_COUNTER_) = 1/(!!(const_expr)) } #endif #ifdef __cplusplus -extern "C" + extern "C" { +#endif + +/*------------------------------------------------------------------*/ +/* CONSTANTS + *------------------------------------------------------------------*/ + +/// defined base on EHCI specs value for Endpoint Speed +typedef enum { -#endif - - /*------------------------------------------------------------------*/ - /* CONSTANTS - *------------------------------------------------------------------*/ - - /// defined base on EHCI specs value for Endpoint Speed - typedef enum - { - TUSB_SPEED_FULL = 0, - TUSB_SPEED_LOW, - TUSB_SPEED_HIGH, - TUSB_SPEED_INVALID = 0xff, - } tusb_speed_t; - - /// defined base on USB Specs Endpoint's bmAttributes - typedef enum - { - TUSB_XFER_CONTROL = 0, - TUSB_XFER_ISOCHRONOUS, - TUSB_XFER_BULK, - TUSB_XFER_INTERRUPT - } tusb_xfer_type_t; - - typedef enum - { - TUSB_DIR_OUT = 0, - TUSB_DIR_IN = 1, - - TUSB_DIR_IN_MASK = 0x80 - } tusb_dir_t; - - /// USB Descriptor Types - typedef enum - { - TUSB_DESC_DEVICE = 0x01, - TUSB_DESC_CONFIGURATION = 0x02, - TUSB_DESC_STRING = 0x03, - TUSB_DESC_INTERFACE = 0x04, - TUSB_DESC_ENDPOINT = 0x05, - TUSB_DESC_DEVICE_QUALIFIER = 0x06, - TUSB_DESC_OTHER_SPEED_CONFIG = 0x07, - TUSB_DESC_INTERFACE_POWER = 0x08, - TUSB_DESC_OTG = 0x09, - TUSB_DESC_DEBUG = 0x0A, - TUSB_DESC_INTERFACE_ASSOCIATION = 0x0B, - - TUSB_DESC_BOS = 0x0F, - TUSB_DESC_DEVICE_CAPABILITY = 0x10, - - TUSB_DESC_FUNCTIONAL = 0x21, - - // Class Specific Descriptor - TUSB_DESC_CS_DEVICE = 0x21, - TUSB_DESC_CS_CONFIGURATION = 0x22, - TUSB_DESC_CS_STRING = 0x23, - TUSB_DESC_CS_INTERFACE = 0x24, - TUSB_DESC_CS_ENDPOINT = 0x25, - - TUSB_DESC_SUPERSPEED_ENDPOINT_COMPANION = 0x30, - TUSB_DESC_SUPERSPEED_ISO_ENDPOINT_COMPANION = 0x31 - } tusb_desc_type_t; - - typedef enum - { - TUSB_REQ_GET_STATUS = 0, - TUSB_REQ_CLEAR_FEATURE = 1, - TUSB_REQ_RESERVED = 2, - TUSB_REQ_SET_FEATURE = 3, - TUSB_REQ_RESERVED2 = 4, - TUSB_REQ_SET_ADDRESS = 5, - TUSB_REQ_GET_DESCRIPTOR = 6, - TUSB_REQ_SET_DESCRIPTOR = 7, - TUSB_REQ_GET_CONFIGURATION = 8, - TUSB_REQ_SET_CONFIGURATION = 9, - TUSB_REQ_GET_INTERFACE = 10, - TUSB_REQ_SET_INTERFACE = 11, - TUSB_REQ_SYNCH_FRAME = 12 - } tusb_request_code_t; - - typedef enum - { - TUSB_REQ_FEATURE_EDPT_HALT = 0, - TUSB_REQ_FEATURE_REMOTE_WAKEUP = 1, - TUSB_REQ_FEATURE_TEST_MODE = 2 - } tusb_request_feature_selector_t; - - typedef enum - { - TUSB_REQ_TYPE_STANDARD = 0, - TUSB_REQ_TYPE_CLASS, - TUSB_REQ_TYPE_VENDOR, - TUSB_REQ_TYPE_INVALID - } tusb_request_type_t; - - typedef enum - { - TUSB_REQ_RCPT_DEVICE = 0, - TUSB_REQ_RCPT_INTERFACE, - TUSB_REQ_RCPT_ENDPOINT, - TUSB_REQ_RCPT_OTHER - } tusb_request_recipient_t; - - // https://www.usb.org/defined-class-codes - typedef enum - { - TUSB_CLASS_UNSPECIFIED = 0, - TUSB_CLASS_AUDIO = 1, - TUSB_CLASS_CDC = 2, - TUSB_CLASS_HID = 3, - TUSB_CLASS_RESERVED_4 = 4, - TUSB_CLASS_PHYSICAL = 5, - TUSB_CLASS_IMAGE = 6, - TUSB_CLASS_PRINTER = 7, - TUSB_CLASS_MSC = 8, - TUSB_CLASS_HUB = 9, - TUSB_CLASS_CDC_DATA = 10, - TUSB_CLASS_SMART_CARD = 11, - TUSB_CLASS_RESERVED_12 = 12, - TUSB_CLASS_CONTENT_SECURITY = 13, - TUSB_CLASS_VIDEO = 14, - TUSB_CLASS_PERSONAL_HEALTHCARE = 15, - TUSB_CLASS_AUDIO_VIDEO = 16, - - TUSB_CLASS_DIAGNOSTIC = 0xDC, - TUSB_CLASS_WIRELESS_CONTROLLER = 0xE0, - TUSB_CLASS_MISC = 0xEF, - TUSB_CLASS_APPLICATION_SPECIFIC = 0xFE, - TUSB_CLASS_VENDOR_SPECIFIC = 0xFF - } tusb_class_code_t; - - typedef enum - { - MISC_SUBCLASS_COMMON = 2 - } misc_subclass_type_t; - - typedef enum - { - MISC_PROTOCOL_IAD = 1 - } misc_protocol_type_t; - - typedef enum - { - APP_SUBCLASS_USBTMC = 0x03, - APP_SUBCLASS_DFU_RUNTIME = 0x01 - } app_subclass_type_t; - - typedef enum - { - DEVICE_CAPABILITY_WIRELESS_USB = 0x01, - DEVICE_CAPABILITY_USB20_EXTENSION = 0x02, - DEVICE_CAPABILITY_SUPERSPEED_USB = 0x03, - DEVICE_CAPABILITY_CONTAINER_id = 0x04, - DEVICE_CAPABILITY_PLATFORM = 0x05, - DEVICE_CAPABILITY_POWER_DELIVERY = 0x06, - DEVICE_CAPABILITY_BATTERY_INFO = 0x07, - DEVICE_CAPABILITY_PD_CONSUMER_PORT = 0x08, - DEVICE_CAPABILITY_PD_PROVIDER_PORT = 0x09, - DEVICE_CAPABILITY_SUPERSPEED_PLUS = 0x0A, - DEVICE_CAPABILITY_PRECESION_TIME_MEASUREMENT = 0x0B, - DEVICE_CAPABILITY_WIRELESS_USB_EXT = 0x0C, - DEVICE_CAPABILITY_BILLBOARD = 0x0D, - DEVICE_CAPABILITY_AUTHENTICATION = 0x0E, - DEVICE_CAPABILITY_BILLBOARD_EX = 0x0F, - DEVICE_CAPABILITY_CONFIGURATION_SUMMARY = 0x10 - } device_capability_type_t; - - enum - { - TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP = TU_BIT(5), - TUSB_DESC_CONFIG_ATT_SELF_POWERED = TU_BIT(6), - }; - -#define TUSB_DESC_CONFIG_POWER_MA(x) ((x) / 2) - - /// Device State TODO remove - typedef enum - { - TUSB_DEVICE_STATE_UNPLUG = 0, - TUSB_DEVICE_STATE_CONFIGURED, - TUSB_DEVICE_STATE_SUSPENDED, - } tusb_device_state_t; - - typedef enum - { - XFER_RESULT_SUCCESS, - XFER_RESULT_FAILED, - XFER_RESULT_STALLED, - } xfer_result_t; - - enum // TODO remove - { - DESC_OFFSET_LEN = 0, - DESC_OFFSET_TYPE = 1 - }; - - enum - { - INTERFACE_INVALID_NUMBER = 0xff - }; - - typedef enum - { - MS_OS_20_SET_HEADER_DESCRIPTOR = 0x00, - MS_OS_20_SUBSET_HEADER_CONFIGURATION = 0x01, - MS_OS_20_SUBSET_HEADER_FUNCTION = 0x02, - MS_OS_20_FEATURE_COMPATBLE_ID = 0x03, - MS_OS_20_FEATURE_REG_PROPERTY = 0x04, - MS_OS_20_FEATURE_MIN_RESUME_TIME = 0x05, - MS_OS_20_FEATURE_MODEL_ID = 0x06, - MS_OS_20_FEATURE_CCGP_DEVICE = 0x07, - MS_OS_20_FEATURE_VENDOR_REVISION = 0x08 - } microsoft_os_20_type_t; - - enum - { - CONTROL_STAGE_SETUP, - CONTROL_STAGE_DATA, - CONTROL_STAGE_ACK - }; - - //--------------------------------------------------------------------+ - // USB Descriptors - //--------------------------------------------------------------------+ - - /// USB Device Descriptor - typedef struct TU_ATTR_PACKED - { - uint8_t bLength; ///< Size of this descriptor in bytes. - uint8_t bDescriptorType; ///< DEVICE Descriptor Type. - uint16_t bcdUSB; ///< BUSB Specification Release Number in Binary-Coded Decimal (i.e., 2.10 is 210H). This field identifies the release of the USB Specification with which the device and its descriptors are compliant. - - uint8_t bDeviceClass; ///< Class code (assigned by the USB-IF). \li If this field is reset to zero, each interface within a configuration specifies its own class information and the various interfaces operate independently. \li If this field is set to a value between 1 and FEH, the device supports different class specifications on different interfaces and the interfaces may not operate independently. This value identifies the class definition used for the aggregate interfaces. \li If this field is set to FFH, the device class is vendor-specific. - uint8_t bDeviceSubClass; ///< Subclass code (assigned by the USB-IF). These codes are qualified by the value of the bDeviceClass field. \li If the bDeviceClass field is reset to zero, this field must also be reset to zero. \li If the bDeviceClass field is not set to FFH, all values are reserved for assignment by the USB-IF. - uint8_t bDeviceProtocol; ///< Protocol code (assigned by the USB-IF). These codes are qualified by the value of the bDeviceClass and the bDeviceSubClass fields. If a device supports class-specific protocols on a device basis as opposed to an interface basis, this code identifies the protocols that the device uses as defined by the specification of the device class. \li If this field is reset to zero, the device does not use class-specific protocols on a device basis. However, it may use classspecific protocols on an interface basis. \li If this field is set to FFH, the device uses a vendor-specific protocol on a device basis. - uint8_t bMaxPacketSize0; ///< Maximum packet size for endpoint zero (only 8, 16, 32, or 64 are valid). For HS devices is fixed to 64. - - uint16_t idVendor; ///< Vendor ID (assigned by the USB-IF). - uint16_t idProduct; ///< Product ID (assigned by the manufacturer). - uint16_t bcdDevice; ///< Device release number in binary-coded decimal. - uint8_t iManufacturer; ///< Index of string descriptor describing manufacturer. - uint8_t iProduct; ///< Index of string descriptor describing product. - uint8_t iSerialNumber; ///< Index of string descriptor describing the device's serial number. - - uint8_t bNumConfigurations; ///< Number of possible configurations. - } tusb_desc_device_t; - - TU_VERIFY_STATIC(sizeof(tusb_desc_device_t) == 18, "size is not correct"); - - // USB Binary Device Object Store (BOS) Descriptor - typedef struct TU_ATTR_PACKED - { - uint8_t bLength; ///< Size of this descriptor in bytes - uint8_t bDescriptorType; ///< CONFIGURATION Descriptor Type - uint16_t wTotalLength; ///< Total length of data returned for this descriptor - uint8_t bNumDeviceCaps; ///< Number of device capability descriptors in the BOS - } tusb_desc_bos_t; - - /// USB Configuration Descriptor - typedef struct TU_ATTR_PACKED - { - uint8_t bLength; ///< Size of this descriptor in bytes - uint8_t bDescriptorType; ///< CONFIGURATION Descriptor Type - uint16_t wTotalLength; ///< Total length of data returned for this configuration. Includes the combined length of all descriptors (configuration, interface, endpoint, and class- or vendor-specific) returned for this configuration. - - uint8_t bNumInterfaces; ///< Number of interfaces supported by this configuration - uint8_t bConfigurationValue; ///< Value to use as an argument to the SetConfiguration() request to select this configuration. - uint8_t iConfiguration; ///< Index of string descriptor describing this configuration - uint8_t bmAttributes; ///< Configuration characteristics \n D7: Reserved (set to one)\n D6: Self-powered \n D5: Remote Wakeup \n D4...0: Reserved (reset to zero) \n D7 is reserved and must be set to one for historical reasons. \n A device configuration that uses power from the bus and a local source reports a non-zero value in bMaxPower to indicate the amount of bus power required and sets D6. The actual power source at runtime may be determined using the GetStatus(DEVICE) request (see USB 2.0 spec Section 9.4.5). \n If a device configuration supports remote wakeup, D5 is set to one. - uint8_t bMaxPower; ///< Maximum power consumption of the USB device from the bus in this specific configuration when the device is fully operational. Expressed in 2 mA units (i.e., 50 = 100 mA). - } tusb_desc_configuration_t; - - /// USB Interface Descriptor - typedef struct TU_ATTR_PACKED - { - uint8_t bLength; ///< Size of this descriptor in bytes - uint8_t bDescriptorType; ///< INTERFACE Descriptor Type - - uint8_t bInterfaceNumber; ///< Number of this interface. Zero-based value identifying the index in the array of concurrent interfaces supported by this configuration. - uint8_t bAlternateSetting; ///< Value used to select this alternate setting for the interface identified in the prior field - uint8_t bNumEndpoints; ///< Number of endpoints used by this interface (excluding endpoint zero). If this value is zero, this interface only uses the Default Control Pipe. - uint8_t bInterfaceClass; ///< Class code (assigned by the USB-IF). \li A value of zero is reserved for future standardization. \li If this field is set to FFH, the interface class is vendor-specific. \li All other values are reserved for assignment by the USB-IF. - uint8_t bInterfaceSubClass; ///< Subclass code (assigned by the USB-IF). \n These codes are qualified by the value of the bInterfaceClass field. \li If the bInterfaceClass field is reset to zero, this field must also be reset to zero. \li If the bInterfaceClass field is not set to FFH, all values are reserved for assignment by the USB-IF. - uint8_t bInterfaceProtocol; ///< Protocol code (assigned by the USB). \n These codes are qualified by the value of the bInterfaceClass and the bInterfaceSubClass fields. If an interface supports class-specific requests, this code identifies the protocols that the device uses as defined by the specification of the device class. \li If this field is reset to zero, the device does not use a class-specific protocol on this interface. \li If this field is set to FFH, the device uses a vendor-specific protocol for this interface. - uint8_t iInterface; ///< Index of string descriptor describing this interface - } tusb_desc_interface_t; - - /// USB Endpoint Descriptor - typedef struct TU_ATTR_PACKED - { - uint8_t bLength; ///< Size of this descriptor in bytes - uint8_t bDescriptorType; ///< ENDPOINT Descriptor Type - - uint8_t bEndpointAddress; ///< The address of the endpoint on the USB device described by this descriptor. The address is encoded as follows: \n Bit 3...0: The endpoint number \n Bit 6...4: Reserved, reset to zero \n Bit 7: Direction, ignored for control endpoints 0 = OUT endpoint 1 = IN endpoint. - - struct TU_ATTR_PACKED - { - uint8_t xfer : 2; - uint8_t sync : 2; - uint8_t usage : 2; - uint8_t : 2; - } bmAttributes; ///< This field describes the endpoint's attributes when it is configured using the bConfigurationValue. \n Bits 1..0: Transfer Type \n- 00 = Control \n- 01 = Isochronous \n- 10 = Bulk \n- 11 = Interrupt \n If not an isochronous endpoint, bits 5..2 are reserved and must be set to zero. If isochronous, they are defined as follows: \n Bits 3..2: Synchronization Type \n- 00 = No Synchronization \n- 01 = Asynchronous \n- 10 = Adaptive \n- 11 = Synchronous \n Bits 5..4: Usage Type \n- 00 = Data endpoint \n- 01 = Feedback endpoint \n- 10 = Implicit feedback Data endpoint \n- 11 = Reserved \n Refer to Chapter 5 of USB 2.0 specification for more information. \n All other bits are reserved and must be reset to zero. Reserved bits must be ignored by the host. - - struct TU_ATTR_PACKED - { - uint16_t size : 11; ///< Maximum packet size this endpoint is capable of sending or receiving when this configuration is selected. \n For isochronous endpoints, this value is used to reserve the bus time in the schedule, required for the per-(micro)frame data payloads. The pipe may, on an ongoing basis, actually use less bandwidth than that reserved. The device reports, if necessary, the actual bandwidth used via its normal, non-USB defined mechanisms. \n For all endpoints, bits 10..0 specify the maximum packet size (in bytes). \n For high-speed isochronous and interrupt endpoints: \n Bits 12..11 specify the number of additional transaction opportunities per microframe: \n- 00 = None (1 transaction per microframe) \n- 01 = 1 additional (2 per microframe) \n- 10 = 2 additional (3 per microframe) \n- 11 = Reserved \n Bits 15..13 are reserved and must be set to zero. - uint16_t hs_period_mult : 2; - uint16_t TU_RESERVED : 3; - } wMaxPacketSize; - - uint8_t bInterval; ///< Interval for polling endpoint for data transfers. Expressed in frames or microframes depending on the device operating speed (i.e., either 1 millisecond or 125 us units). \n- For full-/high-speed isochronous endpoints, this value must be in the range from 1 to 16. The bInterval value is used as the exponent for a \f$ 2^(bInterval-1) \f$ value; e.g., a bInterval of 4 means a period of 8 (\f$ 2^(4-1) \f$). \n- For full-/low-speed interrupt endpoints, the value of this field may be from 1 to 255. \n- For high-speed interrupt endpoints, the bInterval value is used as the exponent for a \f$ 2^(bInterval-1) \f$ value; e.g., a bInterval of 4 means a period of 8 (\f$ 2^(4-1) \f$) . This value must be from 1 to 16. \n- For high-speed bulk/control OUT endpoints, the bInterval must specify the maximum NAK rate of the endpoint. A value of 0 indicates the endpoint never NAKs. Other values indicate at most 1 NAK each bInterval number of microframes. This value must be in the range from 0 to 255. \n Refer to Chapter 5 of USB 2.0 specification for more information. - } tusb_desc_endpoint_t; - - /// USB Other Speed Configuration Descriptor - typedef struct TU_ATTR_PACKED - { - uint8_t bLength; ///< Size of descriptor - uint8_t bDescriptorType; ///< Other_speed_Configuration Type - uint16_t wTotalLength; ///< Total length of data returned - - uint8_t bNumInterfaces; ///< Number of interfaces supported by this speed configuration - uint8_t bConfigurationValue; ///< Value to use to select configuration - uint8_t IConfiguration; ///< Index of string descriptor - uint8_t bmAttributes; ///< Same as Configuration descriptor - uint8_t bMaxPower; ///< Same as Configuration descriptor - } tusb_desc_other_speed_t; - - /// USB Device Qualifier Descriptor - typedef struct TU_ATTR_PACKED - { - uint8_t bLength; ///< Size of descriptor - uint8_t bDescriptorType; ///< Device Qualifier Type - uint16_t bcdUSB; ///< USB specification version number (e.g., 0200H for V2.00) - - uint8_t bDeviceClass; ///< Class Code - uint8_t bDeviceSubClass; ///< SubClass Code - uint8_t bDeviceProtocol; ///< Protocol Code - uint8_t bMaxPacketSize0; ///< Maximum packet size for other speed - uint8_t bNumConfigurations; ///< Number of Other-speed Configurations - uint8_t bReserved; ///< Reserved for future use, must be zero - } tusb_desc_device_qualifier_t; - - /// USB Interface Association Descriptor (IAD ECN) - typedef struct TU_ATTR_PACKED - { - uint8_t bLength; ///< Size of descriptor - uint8_t bDescriptorType; ///< Other_speed_Configuration Type - - uint8_t bFirstInterface; ///< Index of the first associated interface. - uint8_t bInterfaceCount; ///< Total number of associated interfaces. - - uint8_t bFunctionClass; ///< Interface class ID. - uint8_t bFunctionSubClass; ///< Interface subclass ID. - uint8_t bFunctionProtocol; ///< Interface protocol ID. - - uint8_t iFunction; ///< Index of the string descriptor describing the interface association. - } tusb_desc_interface_assoc_t; - - // USB String Descriptor - typedef struct TU_ATTR_PACKED - { - uint8_t bLength; ///< Size of this descriptor in bytes - uint8_t bDescriptorType; ///< Descriptor Type - uint16_t unicode_string[]; - } tusb_desc_string_t; - - // USB Binary Device Object Store (BOS) - typedef struct TU_ATTR_PACKED - { - uint8_t bLength; - uint8_t bDescriptorType; - uint8_t bDevCapabilityType; - uint8_t bReserved; - uint8_t PlatformCapabilityUUID[16]; - uint8_t CapabilityData[]; - } tusb_desc_bos_platform_t; - - // USB WebuSB URL Descriptor - typedef struct TU_ATTR_PACKED - { - uint8_t bLength; - uint8_t bDescriptorType; - uint8_t bScheme; - char url[]; - } tusb_desc_webusb_url_t; - - /*------------------------------------------------------------------*/ - /* Types - *------------------------------------------------------------------*/ - typedef struct TU_ATTR_PACKED - { - union - { - struct TU_ATTR_PACKED - { - uint8_t recipient : 5; ///< Recipient type tusb_request_recipient_t. - uint8_t type : 2; ///< Request type tusb_request_type_t. - uint8_t direction : 1; ///< Direction type. tusb_dir_t - } bmRequestType_bit; - - uint8_t bmRequestType; - }; - - uint8_t bRequest; - uint16_t wValue; - uint16_t wIndex; - uint16_t wLength; - } tusb_control_request_t; - - TU_VERIFY_STATIC(sizeof(tusb_control_request_t) == 8, "size is not correct"); - - // TODO move to somewhere suitable - static inline uint8_t bm_request_type(uint8_t direction, uint8_t type, uint8_t recipient) - { - return ((uint8_t)(direction << 7)) | ((uint8_t)(type << 5)) | (recipient); - } - - //--------------------------------------------------------------------+ - // Endpoint helper - //--------------------------------------------------------------------+ - - // Get direction from Endpoint address - static inline tusb_dir_t tu_edpt_dir(uint8_t addr) - { - return (addr & TUSB_DIR_IN_MASK) ? TUSB_DIR_IN : TUSB_DIR_OUT; - } - - // Get Endpoint number from address - static inline uint8_t tu_edpt_number(uint8_t addr) - { - return (uint8_t)(addr & (~TUSB_DIR_IN_MASK)); - } - - static inline uint8_t tu_edpt_addr(uint8_t num, uint8_t dir) - { - return (uint8_t)(num | (dir ? TUSB_DIR_IN_MASK : 0)); - } - - //--------------------------------------------------------------------+ - // Descriptor helper - //--------------------------------------------------------------------+ - static inline uint8_t const *tu_desc_next(void const *desc) - { - uint8_t const *desc8 = (uint8_t const *)desc; - return desc8 + desc8[DESC_OFFSET_LEN]; - } - - static inline uint8_t tu_desc_type(void const *desc) - { - return ((uint8_t const *)desc)[DESC_OFFSET_TYPE]; - } - - static inline uint8_t tu_desc_len(void const *desc) - { - return ((uint8_t const *)desc)[DESC_OFFSET_LEN]; - } + TUSB_SPEED_FULL = 0, + TUSB_SPEED_LOW , + TUSB_SPEED_HIGH, + TUSB_SPEED_INVALID = 0xff, +}tusb_speed_t; + +/// defined base on USB Specs Endpoint's bmAttributes +typedef enum +{ + TUSB_XFER_CONTROL = 0 , + TUSB_XFER_ISOCHRONOUS , + TUSB_XFER_BULK , + TUSB_XFER_INTERRUPT +}tusb_xfer_type_t; + +typedef enum +{ + TUSB_DIR_OUT = 0, + TUSB_DIR_IN = 1, + + TUSB_DIR_IN_MASK = 0x80 +}tusb_dir_t; + +/// USB Descriptor Types +typedef enum +{ + TUSB_DESC_DEVICE = 0x01, + TUSB_DESC_CONFIGURATION = 0x02, + TUSB_DESC_STRING = 0x03, + TUSB_DESC_INTERFACE = 0x04, + TUSB_DESC_ENDPOINT = 0x05, + TUSB_DESC_DEVICE_QUALIFIER = 0x06, + TUSB_DESC_OTHER_SPEED_CONFIG = 0x07, + TUSB_DESC_INTERFACE_POWER = 0x08, + TUSB_DESC_OTG = 0x09, + TUSB_DESC_DEBUG = 0x0A, + TUSB_DESC_INTERFACE_ASSOCIATION = 0x0B, + + TUSB_DESC_BOS = 0x0F, + TUSB_DESC_DEVICE_CAPABILITY = 0x10, + + TUSB_DESC_FUNCTIONAL = 0x21, + + // Class Specific Descriptor + TUSB_DESC_CS_DEVICE = 0x21, + TUSB_DESC_CS_CONFIGURATION = 0x22, + TUSB_DESC_CS_STRING = 0x23, + TUSB_DESC_CS_INTERFACE = 0x24, + TUSB_DESC_CS_ENDPOINT = 0x25, + + TUSB_DESC_SUPERSPEED_ENDPOINT_COMPANION = 0x30, + TUSB_DESC_SUPERSPEED_ISO_ENDPOINT_COMPANION = 0x31 +}tusb_desc_type_t; + +typedef enum +{ + TUSB_REQ_GET_STATUS = 0 , + TUSB_REQ_CLEAR_FEATURE = 1 , + TUSB_REQ_RESERVED = 2 , + TUSB_REQ_SET_FEATURE = 3 , + TUSB_REQ_RESERVED2 = 4 , + TUSB_REQ_SET_ADDRESS = 5 , + TUSB_REQ_GET_DESCRIPTOR = 6 , + TUSB_REQ_SET_DESCRIPTOR = 7 , + TUSB_REQ_GET_CONFIGURATION = 8 , + TUSB_REQ_SET_CONFIGURATION = 9 , + TUSB_REQ_GET_INTERFACE = 10 , + TUSB_REQ_SET_INTERFACE = 11 , + TUSB_REQ_SYNCH_FRAME = 12 +}tusb_request_code_t; + +typedef enum +{ + TUSB_REQ_FEATURE_EDPT_HALT = 0, + TUSB_REQ_FEATURE_REMOTE_WAKEUP = 1, + TUSB_REQ_FEATURE_TEST_MODE = 2 +}tusb_request_feature_selector_t; + +typedef enum +{ + TUSB_REQ_TYPE_STANDARD = 0, + TUSB_REQ_TYPE_CLASS, + TUSB_REQ_TYPE_VENDOR, + TUSB_REQ_TYPE_INVALID +} tusb_request_type_t; + +typedef enum +{ + TUSB_REQ_RCPT_DEVICE =0, + TUSB_REQ_RCPT_INTERFACE, + TUSB_REQ_RCPT_ENDPOINT, + TUSB_REQ_RCPT_OTHER +} tusb_request_recipient_t; + +// https://www.usb.org/defined-class-codes +typedef enum +{ + TUSB_CLASS_UNSPECIFIED = 0 , + TUSB_CLASS_AUDIO = 1 , + TUSB_CLASS_CDC = 2 , + TUSB_CLASS_HID = 3 , + TUSB_CLASS_RESERVED_4 = 4 , + TUSB_CLASS_PHYSICAL = 5 , + TUSB_CLASS_IMAGE = 6 , + TUSB_CLASS_PRINTER = 7 , + TUSB_CLASS_MSC = 8 , + TUSB_CLASS_HUB = 9 , + TUSB_CLASS_CDC_DATA = 10 , + TUSB_CLASS_SMART_CARD = 11 , + TUSB_CLASS_RESERVED_12 = 12 , + TUSB_CLASS_CONTENT_SECURITY = 13 , + TUSB_CLASS_VIDEO = 14 , + TUSB_CLASS_PERSONAL_HEALTHCARE = 15 , + TUSB_CLASS_AUDIO_VIDEO = 16 , + + TUSB_CLASS_DIAGNOSTIC = 0xDC , + TUSB_CLASS_WIRELESS_CONTROLLER = 0xE0 , + TUSB_CLASS_MISC = 0xEF , + TUSB_CLASS_APPLICATION_SPECIFIC = 0xFE , + TUSB_CLASS_VENDOR_SPECIFIC = 0xFF +}tusb_class_code_t; + +typedef enum +{ + MISC_SUBCLASS_COMMON = 2 +}misc_subclass_type_t; + +typedef enum +{ + MISC_PROTOCOL_IAD = 1 +}misc_protocol_type_t; + +typedef enum +{ + APP_SUBCLASS_USBTMC = 0x03, + APP_SUBCLASS_DFU_RUNTIME = 0x01 +} app_subclass_type_t; + +typedef enum +{ + DEVICE_CAPABILITY_WIRELESS_USB = 0x01, + DEVICE_CAPABILITY_USB20_EXTENSION = 0x02, + DEVICE_CAPABILITY_SUPERSPEED_USB = 0x03, + DEVICE_CAPABILITY_CONTAINER_id = 0x04, + DEVICE_CAPABILITY_PLATFORM = 0x05, + DEVICE_CAPABILITY_POWER_DELIVERY = 0x06, + DEVICE_CAPABILITY_BATTERY_INFO = 0x07, + DEVICE_CAPABILITY_PD_CONSUMER_PORT = 0x08, + DEVICE_CAPABILITY_PD_PROVIDER_PORT = 0x09, + DEVICE_CAPABILITY_SUPERSPEED_PLUS = 0x0A, + DEVICE_CAPABILITY_PRECESION_TIME_MEASUREMENT = 0x0B, + DEVICE_CAPABILITY_WIRELESS_USB_EXT = 0x0C, + DEVICE_CAPABILITY_BILLBOARD = 0x0D, + DEVICE_CAPABILITY_AUTHENTICATION = 0x0E, + DEVICE_CAPABILITY_BILLBOARD_EX = 0x0F, + DEVICE_CAPABILITY_CONFIGURATION_SUMMARY = 0x10 +}device_capability_type_t; + +enum { + TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP = TU_BIT(5), + TUSB_DESC_CONFIG_ATT_SELF_POWERED = TU_BIT(6), +}; + +#define TUSB_DESC_CONFIG_POWER_MA(x) ((x)/2) + +/// Device State TODO remove +typedef enum +{ + TUSB_DEVICE_STATE_UNPLUG = 0 , + TUSB_DEVICE_STATE_CONFIGURED , + TUSB_DEVICE_STATE_SUSPENDED , +}tusb_device_state_t; + +typedef enum +{ + XFER_RESULT_SUCCESS, + XFER_RESULT_FAILED, + XFER_RESULT_STALLED, +}xfer_result_t; + +enum // TODO remove +{ + DESC_OFFSET_LEN = 0, + DESC_OFFSET_TYPE = 1 +}; + +enum +{ + INTERFACE_INVALID_NUMBER = 0xff +}; + + +typedef enum +{ + MS_OS_20_SET_HEADER_DESCRIPTOR = 0x00, + MS_OS_20_SUBSET_HEADER_CONFIGURATION = 0x01, + MS_OS_20_SUBSET_HEADER_FUNCTION = 0x02, + MS_OS_20_FEATURE_COMPATBLE_ID = 0x03, + MS_OS_20_FEATURE_REG_PROPERTY = 0x04, + MS_OS_20_FEATURE_MIN_RESUME_TIME = 0x05, + MS_OS_20_FEATURE_MODEL_ID = 0x06, + MS_OS_20_FEATURE_CCGP_DEVICE = 0x07, + MS_OS_20_FEATURE_VENDOR_REVISION = 0x08 +} microsoft_os_20_type_t; + +enum +{ + CONTROL_STAGE_SETUP, + CONTROL_STAGE_DATA, + CONTROL_STAGE_ACK +}; + +//--------------------------------------------------------------------+ +// USB Descriptors +//--------------------------------------------------------------------+ + +/// USB Device Descriptor +typedef struct TU_ATTR_PACKED +{ + uint8_t bLength ; ///< Size of this descriptor in bytes. + uint8_t bDescriptorType ; ///< DEVICE Descriptor Type. + uint16_t bcdUSB ; ///< BUSB Specification Release Number in Binary-Coded Decimal (i.e., 2.10 is 210H). This field identifies the release of the USB Specification with which the device and its descriptors are compliant. + + uint8_t bDeviceClass ; ///< Class code (assigned by the USB-IF). \li If this field is reset to zero, each interface within a configuration specifies its own class information and the various interfaces operate independently. \li If this field is set to a value between 1 and FEH, the device supports different class specifications on different interfaces and the interfaces may not operate independently. This value identifies the class definition used for the aggregate interfaces. \li If this field is set to FFH, the device class is vendor-specific. + uint8_t bDeviceSubClass ; ///< Subclass code (assigned by the USB-IF). These codes are qualified by the value of the bDeviceClass field. \li If the bDeviceClass field is reset to zero, this field must also be reset to zero. \li If the bDeviceClass field is not set to FFH, all values are reserved for assignment by the USB-IF. + uint8_t bDeviceProtocol ; ///< Protocol code (assigned by the USB-IF). These codes are qualified by the value of the bDeviceClass and the bDeviceSubClass fields. If a device supports class-specific protocols on a device basis as opposed to an interface basis, this code identifies the protocols that the device uses as defined by the specification of the device class. \li If this field is reset to zero, the device does not use class-specific protocols on a device basis. However, it may use classspecific protocols on an interface basis. \li If this field is set to FFH, the device uses a vendor-specific protocol on a device basis. + uint8_t bMaxPacketSize0 ; ///< Maximum packet size for endpoint zero (only 8, 16, 32, or 64 are valid). For HS devices is fixed to 64. + + uint16_t idVendor ; ///< Vendor ID (assigned by the USB-IF). + uint16_t idProduct ; ///< Product ID (assigned by the manufacturer). + uint16_t bcdDevice ; ///< Device release number in binary-coded decimal. + uint8_t iManufacturer ; ///< Index of string descriptor describing manufacturer. + uint8_t iProduct ; ///< Index of string descriptor describing product. + uint8_t iSerialNumber ; ///< Index of string descriptor describing the device's serial number. + + uint8_t bNumConfigurations ; ///< Number of possible configurations. +} tusb_desc_device_t; + +TU_VERIFY_STATIC( sizeof(tusb_desc_device_t) == 18, "size is not correct"); + +// USB Binary Device Object Store (BOS) Descriptor +typedef struct TU_ATTR_PACKED +{ + uint8_t bLength ; ///< Size of this descriptor in bytes + uint8_t bDescriptorType ; ///< CONFIGURATION Descriptor Type + uint16_t wTotalLength ; ///< Total length of data returned for this descriptor + uint8_t bNumDeviceCaps ; ///< Number of device capability descriptors in the BOS +} tusb_desc_bos_t; + +/// USB Configuration Descriptor +typedef struct TU_ATTR_PACKED +{ + uint8_t bLength ; ///< Size of this descriptor in bytes + uint8_t bDescriptorType ; ///< CONFIGURATION Descriptor Type + uint16_t wTotalLength ; ///< Total length of data returned for this configuration. Includes the combined length of all descriptors (configuration, interface, endpoint, and class- or vendor-specific) returned for this configuration. + + uint8_t bNumInterfaces ; ///< Number of interfaces supported by this configuration + uint8_t bConfigurationValue ; ///< Value to use as an argument to the SetConfiguration() request to select this configuration. + uint8_t iConfiguration ; ///< Index of string descriptor describing this configuration + uint8_t bmAttributes ; ///< Configuration characteristics \n D7: Reserved (set to one)\n D6: Self-powered \n D5: Remote Wakeup \n D4...0: Reserved (reset to zero) \n D7 is reserved and must be set to one for historical reasons. \n A device configuration that uses power from the bus and a local source reports a non-zero value in bMaxPower to indicate the amount of bus power required and sets D6. The actual power source at runtime may be determined using the GetStatus(DEVICE) request (see USB 2.0 spec Section 9.4.5). \n If a device configuration supports remote wakeup, D5 is set to one. + uint8_t bMaxPower ; ///< Maximum power consumption of the USB device from the bus in this specific configuration when the device is fully operational. Expressed in 2 mA units (i.e., 50 = 100 mA). +} tusb_desc_configuration_t; + +/// USB Interface Descriptor +typedef struct TU_ATTR_PACKED +{ + uint8_t bLength ; ///< Size of this descriptor in bytes + uint8_t bDescriptorType ; ///< INTERFACE Descriptor Type + + uint8_t bInterfaceNumber ; ///< Number of this interface. Zero-based value identifying the index in the array of concurrent interfaces supported by this configuration. + uint8_t bAlternateSetting ; ///< Value used to select this alternate setting for the interface identified in the prior field + uint8_t bNumEndpoints ; ///< Number of endpoints used by this interface (excluding endpoint zero). If this value is zero, this interface only uses the Default Control Pipe. + uint8_t bInterfaceClass ; ///< Class code (assigned by the USB-IF). \li A value of zero is reserved for future standardization. \li If this field is set to FFH, the interface class is vendor-specific. \li All other values are reserved for assignment by the USB-IF. + uint8_t bInterfaceSubClass ; ///< Subclass code (assigned by the USB-IF). \n These codes are qualified by the value of the bInterfaceClass field. \li If the bInterfaceClass field is reset to zero, this field must also be reset to zero. \li If the bInterfaceClass field is not set to FFH, all values are reserved for assignment by the USB-IF. + uint8_t bInterfaceProtocol ; ///< Protocol code (assigned by the USB). \n These codes are qualified by the value of the bInterfaceClass and the bInterfaceSubClass fields. If an interface supports class-specific requests, this code identifies the protocols that the device uses as defined by the specification of the device class. \li If this field is reset to zero, the device does not use a class-specific protocol on this interface. \li If this field is set to FFH, the device uses a vendor-specific protocol for this interface. + uint8_t iInterface ; ///< Index of string descriptor describing this interface +} tusb_desc_interface_t; + +/// USB Endpoint Descriptor +typedef struct TU_ATTR_PACKED +{ + uint8_t bLength ; ///< Size of this descriptor in bytes + uint8_t bDescriptorType ; ///< ENDPOINT Descriptor Type + + uint8_t bEndpointAddress ; ///< The address of the endpoint on the USB device described by this descriptor. The address is encoded as follows: \n Bit 3...0: The endpoint number \n Bit 6...4: Reserved, reset to zero \n Bit 7: Direction, ignored for control endpoints 0 = OUT endpoint 1 = IN endpoint. + + struct TU_ATTR_PACKED { + uint8_t xfer : 2; + uint8_t sync : 2; + uint8_t usage : 2; + uint8_t : 2; + } bmAttributes ; ///< This field describes the endpoint's attributes when it is configured using the bConfigurationValue. \n Bits 1..0: Transfer Type \n- 00 = Control \n- 01 = Isochronous \n- 10 = Bulk \n- 11 = Interrupt \n If not an isochronous endpoint, bits 5..2 are reserved and must be set to zero. If isochronous, they are defined as follows: \n Bits 3..2: Synchronization Type \n- 00 = No Synchronization \n- 01 = Asynchronous \n- 10 = Adaptive \n- 11 = Synchronous \n Bits 5..4: Usage Type \n- 00 = Data endpoint \n- 01 = Feedback endpoint \n- 10 = Implicit feedback Data endpoint \n- 11 = Reserved \n Refer to Chapter 5 of USB 2.0 specification for more information. \n All other bits are reserved and must be reset to zero. Reserved bits must be ignored by the host. + + struct TU_ATTR_PACKED { + uint16_t size : 11; ///< Maximum packet size this endpoint is capable of sending or receiving when this configuration is selected. \n For isochronous endpoints, this value is used to reserve the bus time in the schedule, required for the per-(micro)frame data payloads. The pipe may, on an ongoing basis, actually use less bandwidth than that reserved. The device reports, if necessary, the actual bandwidth used via its normal, non-USB defined mechanisms. \n For all endpoints, bits 10..0 specify the maximum packet size (in bytes). \n For high-speed isochronous and interrupt endpoints: \n Bits 12..11 specify the number of additional transaction opportunities per microframe: \n- 00 = None (1 transaction per microframe) \n- 01 = 1 additional (2 per microframe) \n- 10 = 2 additional (3 per microframe) \n- 11 = Reserved \n Bits 15..13 are reserved and must be set to zero. + uint16_t hs_period_mult : 2; + uint16_t TU_RESERVED : 3; + }wMaxPacketSize; + + uint8_t bInterval ; ///< Interval for polling endpoint for data transfers. Expressed in frames or microframes depending on the device operating speed (i.e., either 1 millisecond or 125 us units). \n- For full-/high-speed isochronous endpoints, this value must be in the range from 1 to 16. The bInterval value is used as the exponent for a \f$ 2^(bInterval-1) \f$ value; e.g., a bInterval of 4 means a period of 8 (\f$ 2^(4-1) \f$). \n- For full-/low-speed interrupt endpoints, the value of this field may be from 1 to 255. \n- For high-speed interrupt endpoints, the bInterval value is used as the exponent for a \f$ 2^(bInterval-1) \f$ value; e.g., a bInterval of 4 means a period of 8 (\f$ 2^(4-1) \f$) . This value must be from 1 to 16. \n- For high-speed bulk/control OUT endpoints, the bInterval must specify the maximum NAK rate of the endpoint. A value of 0 indicates the endpoint never NAKs. Other values indicate at most 1 NAK each bInterval number of microframes. This value must be in the range from 0 to 255. \n Refer to Chapter 5 of USB 2.0 specification for more information. +} tusb_desc_endpoint_t; + +/// USB Other Speed Configuration Descriptor +typedef struct TU_ATTR_PACKED +{ + uint8_t bLength ; ///< Size of descriptor + uint8_t bDescriptorType ; ///< Other_speed_Configuration Type + uint16_t wTotalLength ; ///< Total length of data returned + + uint8_t bNumInterfaces ; ///< Number of interfaces supported by this speed configuration + uint8_t bConfigurationValue ; ///< Value to use to select configuration + uint8_t IConfiguration ; ///< Index of string descriptor + uint8_t bmAttributes ; ///< Same as Configuration descriptor + uint8_t bMaxPower ; ///< Same as Configuration descriptor +} tusb_desc_other_speed_t; + +/// USB Device Qualifier Descriptor +typedef struct TU_ATTR_PACKED +{ + uint8_t bLength ; ///< Size of descriptor + uint8_t bDescriptorType ; ///< Device Qualifier Type + uint16_t bcdUSB ; ///< USB specification version number (e.g., 0200H for V2.00) + + uint8_t bDeviceClass ; ///< Class Code + uint8_t bDeviceSubClass ; ///< SubClass Code + uint8_t bDeviceProtocol ; ///< Protocol Code + uint8_t bMaxPacketSize0 ; ///< Maximum packet size for other speed + uint8_t bNumConfigurations ; ///< Number of Other-speed Configurations + uint8_t bReserved ; ///< Reserved for future use, must be zero +} tusb_desc_device_qualifier_t; + +/// USB Interface Association Descriptor (IAD ECN) +typedef struct TU_ATTR_PACKED +{ + uint8_t bLength ; ///< Size of descriptor + uint8_t bDescriptorType ; ///< Other_speed_Configuration Type + + uint8_t bFirstInterface ; ///< Index of the first associated interface. + uint8_t bInterfaceCount ; ///< Total number of associated interfaces. + + uint8_t bFunctionClass ; ///< Interface class ID. + uint8_t bFunctionSubClass ; ///< Interface subclass ID. + uint8_t bFunctionProtocol ; ///< Interface protocol ID. + + uint8_t iFunction ; ///< Index of the string descriptor describing the interface association. +} tusb_desc_interface_assoc_t; + +// USB String Descriptor +typedef struct TU_ATTR_PACKED +{ + uint8_t bLength ; ///< Size of this descriptor in bytes + uint8_t bDescriptorType ; ///< Descriptor Type + uint16_t unicode_string[]; +} tusb_desc_string_t; + +// USB Binary Device Object Store (BOS) +typedef struct TU_ATTR_PACKED +{ + uint8_t bLength; + uint8_t bDescriptorType ; + uint8_t bDevCapabilityType; + uint8_t bReserved; + uint8_t PlatformCapabilityUUID[16]; + uint8_t CapabilityData[]; +} tusb_desc_bos_platform_t; + +// USB WebuSB URL Descriptor +typedef struct TU_ATTR_PACKED +{ + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bScheme; + char url[]; +} tusb_desc_webusb_url_t; + +/*------------------------------------------------------------------*/ +/* Types + *------------------------------------------------------------------*/ +typedef struct TU_ATTR_PACKED{ + union { + struct TU_ATTR_PACKED { + uint8_t recipient : 5; ///< Recipient type tusb_request_recipient_t. + uint8_t type : 2; ///< Request type tusb_request_type_t. + uint8_t direction : 1; ///< Direction type. tusb_dir_t + } bmRequestType_bit; + + uint8_t bmRequestType; + }; + + uint8_t bRequest; + uint16_t wValue; + uint16_t wIndex; + uint16_t wLength; +} tusb_control_request_t; + +TU_VERIFY_STATIC( sizeof(tusb_control_request_t) == 8, "size is not correct"); + +// TODO move to somewhere suitable +static inline uint8_t bm_request_type(uint8_t direction, uint8_t type, uint8_t recipient) +{ + return ((uint8_t) (direction << 7)) | ((uint8_t) (type << 5)) | (recipient); +} + +//--------------------------------------------------------------------+ +// Endpoint helper +//--------------------------------------------------------------------+ + +// Get direction from Endpoint address +static inline tusb_dir_t tu_edpt_dir(uint8_t addr) +{ + return (addr & TUSB_DIR_IN_MASK) ? TUSB_DIR_IN : TUSB_DIR_OUT; +} + +// Get Endpoint number from address +static inline uint8_t tu_edpt_number(uint8_t addr) +{ + return (uint8_t)(addr & (~TUSB_DIR_IN_MASK)); +} + +static inline uint8_t tu_edpt_addr(uint8_t num, uint8_t dir) +{ + return (uint8_t)(num | (dir ? TUSB_DIR_IN_MASK : 0)); +} + +//--------------------------------------------------------------------+ +// Descriptor helper +//--------------------------------------------------------------------+ +static inline uint8_t const * tu_desc_next(void const* desc) +{ + uint8_t const* desc8 = (uint8_t const*) desc; + return desc8 + desc8[DESC_OFFSET_LEN]; +} + +static inline uint8_t tu_desc_type(void const* desc) +{ + return ((uint8_t const*) desc)[DESC_OFFSET_TYPE]; +} + +static inline uint8_t tu_desc_len(void const* desc) +{ + return ((uint8_t const*) desc)[DESC_OFFSET_LEN]; +} #ifdef __cplusplus -} + } #endif + // from tinyusb_hid.h #ifdef __cplusplus -extern "C" -{ + extern "C" { #endif -#define TU_U16_HIGH(u16) ((uint8_t)(((u16) >> 8) & 0x00ff)) -#define TU_U16_LOW(u16) ((uint8_t)((u16) & 0x00ff)) -#define U16_TO_U8S_BE(u16) TU_U16_HIGH(u16), TU_U16_LOW(u16) -#define U16_TO_U8S_LE(u16) TU_U16_LOW(u16), TU_U16_HIGH(u16) +#define TU_U16_HIGH(u16) ((uint8_t) (((u16) >> 8) & 0x00ff)) +#define TU_U16_LOW(u16) ((uint8_t) ((u16) & 0x00ff)) +#define U16_TO_U8S_BE(u16) TU_U16_HIGH(u16), TU_U16_LOW(u16) +#define U16_TO_U8S_LE(u16) TU_U16_LOW(u16), TU_U16_HIGH(u16) #ifndef TU_ATTR_PACKED #define TU_ATTR_PACKED __attribute__((packed)) #endif #ifndef TU_BIT -#define TU_BIT(x) (1 << (x)) +#define TU_BIT( x ) (1<<(x)) #endif /* USB constant and structure define */ /* USB PID */ #ifndef USB_PID_SETUP -#define USB_PID_NULL 0x00 /* reserved PID */ -#define USB_PID_SOF 0x05 -#define USB_PID_SETUP 0x0D -#define USB_PID_IN 0x09 -#define USB_PID_OUT 0x01 -#define USB_PID_ACK 0x02 -#define USB_PID_NAK 0x0A -#define USB_PID_STALL 0x0E -#define USB_PID_DATA0 0x03 -#define USB_PID_DATA1 0x0B -#define USB_PID_PRE 0x0C + #define USB_PID_NULL 0x00 /* reserved PID */ + #define USB_PID_SOF 0x05 + #define USB_PID_SETUP 0x0D + #define USB_PID_IN 0x09 + #define USB_PID_OUT 0x01 + #define USB_PID_ACK 0x02 + #define USB_PID_NAK 0x0A + #define USB_PID_STALL 0x0E + #define USB_PID_DATA0 0x03 + #define USB_PID_DATA1 0x0B + #define USB_PID_PRE 0x0C #endif /* USB standard device request code */ #ifndef USB_GET_DESCRIPTOR -#define USB_GET_STATUS 0x00 -#define USB_CLEAR_FEATURE 0x01 -#define USB_SET_FEATURE 0x03 -#define USB_SET_ADDRESS 0x05 -#define USB_GET_DESCRIPTOR 0x06 -#define USB_SET_DESCRIPTOR 0x07 -#define USB_GET_CONFIGURATION 0x08 -#define USB_SET_CONFIGURATION 0x09 -#define USB_GET_INTERFACE 0x0A -#define USB_SET_INTERFACE 0x0B -#define USB_SYNCH_FRAME 0x0C + #define USB_GET_STATUS 0x00 + #define USB_CLEAR_FEATURE 0x01 + #define USB_SET_FEATURE 0x03 + #define USB_SET_ADDRESS 0x05 + #define USB_GET_DESCRIPTOR 0x06 + #define USB_SET_DESCRIPTOR 0x07 + #define USB_GET_CONFIGURATION 0x08 + #define USB_SET_CONFIGURATION 0x09 + #define USB_GET_INTERFACE 0x0A + #define USB_SET_INTERFACE 0x0B + #define USB_SYNCH_FRAME 0x0C #endif /* USB hub class request code */ #ifndef HUB_GET_DESCRIPTOR -#define HUB_GET_STATUS 0x00 -#define HUB_CLEAR_FEATURE 0x01 -#define HUB_GET_STATE 0x02 -#define HUB_SET_FEATURE 0x03 -#define HUB_GET_DESCRIPTOR 0x06 -#define HUB_SET_DESCRIPTOR 0x07 + #define HUB_GET_STATUS 0x00 + #define HUB_CLEAR_FEATURE 0x01 + #define HUB_GET_STATE 0x02 + #define HUB_SET_FEATURE 0x03 + #define HUB_GET_DESCRIPTOR 0x06 + #define HUB_SET_DESCRIPTOR 0x07 #endif /* USB HID class request code */ #ifndef HID_GET_REPORT -#define HID_GET_REPORT 0x01 -#define HID_GET_IDLE 0x02 -#define HID_GET_PROTOCOL 0x03 -#define HID_SET_REPORT 0x09 -#define HID_SET_IDLE 0x0A -#define HID_SET_PROTOCOL 0x0B + #define HID_GET_REPORT 0x01 + #define HID_GET_IDLE 0x02 + #define HID_GET_PROTOCOL 0x03 + #define HID_SET_REPORT 0x09 + #define HID_SET_IDLE 0x0A + #define HID_SET_PROTOCOL 0x0B #endif /* USB CDC Class request code */ #ifndef CDC_GET_LINE_CODING -#define CDC_GET_LINE_CODING 0X21 /* This request allows the host to find out the currently configured line coding */ -#define CDC_SET_LINE_CODING 0x20 /* Configures DTE rate, stop-bits, parity, and number-of-character */ -#define CDC_SET_LINE_CTLSTE 0X22 /* This request generates RS-232/V.24 style control signals */ -#define CDC_SEND_BREAK 0X23 /* Sends special carrier modulation used to specify RS-232 style break */ +#define CDC_GET_LINE_CODING 0X21 /* This request allows the host to find out the currently configured line coding */ +#define CDC_SET_LINE_CODING 0x20 /* Configures DTE rate, stop-bits, parity, and number-of-character */ +#define CDC_SET_LINE_CTLSTE 0X22 /* This request generates RS-232/V.24 style control signals */ +#define CDC_SEND_BREAK 0X23 /* Sends special carrier modulation used to specify RS-232 style break */ #endif /* Bit define for USB request type */ #ifndef USB_REQ_TYP_MASK -#define USB_REQ_TYP_IN 0x80 /* control IN, device to host */ -#define USB_REQ_TYP_OUT 0x00 /* control OUT, host to device */ -#define USB_REQ_TYP_READ 0x80 /* control read, device to host */ -#define USB_REQ_TYP_WRITE 0x00 /* control write, host to device */ -#define USB_REQ_TYP_MASK 0x60 /* bit mask of request type */ -#define USB_REQ_TYP_STANDARD 0x00 -#define USB_REQ_TYP_CLASS 0x20 -#define USB_REQ_TYP_VENDOR 0x40 -#define USB_REQ_TYP_RESERVED 0x60 -#define USB_REQ_RECIP_MASK 0x1F /* bit mask of request recipient */ -#define USB_REQ_RECIP_DEVICE 0x00 -#define USB_REQ_RECIP_INTERF 0x01 -#define USB_REQ_RECIP_ENDP 0x02 -#define USB_REQ_RECIP_OTHER 0x03 -#define USB_REQ_FEAT_REMOTE_WAKEUP 0x01 -#define USB_REQ_FEAT_ENDP_HALT 0x00 + #define USB_REQ_TYP_IN 0x80 /* control IN, device to host */ + #define USB_REQ_TYP_OUT 0x00 /* control OUT, host to device */ + #define USB_REQ_TYP_READ 0x80 /* control read, device to host */ + #define USB_REQ_TYP_WRITE 0x00 /* control write, host to device */ + #define USB_REQ_TYP_MASK 0x60 /* bit mask of request type */ + #define USB_REQ_TYP_STANDARD 0x00 + #define USB_REQ_TYP_CLASS 0x20 + #define USB_REQ_TYP_VENDOR 0x40 + #define USB_REQ_TYP_RESERVED 0x60 + #define USB_REQ_RECIP_MASK 0x1F /* bit mask of request recipient */ + #define USB_REQ_RECIP_DEVICE 0x00 + #define USB_REQ_RECIP_INTERF 0x01 + #define USB_REQ_RECIP_ENDP 0x02 + #define USB_REQ_RECIP_OTHER 0x03 + #define USB_REQ_FEAT_REMOTE_WAKEUP 0x01 + #define USB_REQ_FEAT_ENDP_HALT 0x00 #endif /* USB request type for hub class request */ #ifndef HUB_GET_HUB_DESCRIPTOR -#define HUB_CLEAR_HUB_FEATURE 0x20 -#define HUB_CLEAR_PORT_FEATURE 0x23 -#define HUB_GET_BUS_STATE 0xA3 -#define HUB_GET_HUB_DESCRIPTOR 0xA0 -#define HUB_GET_HUB_STATUS 0xA0 -#define HUB_GET_PORT_STATUS 0xA3 -#define HUB_SET_HUB_DESCRIPTOR 0x20 -#define HUB_SET_HUB_FEATURE 0x20 -#define HUB_SET_PORT_FEATURE 0x23 + #define HUB_CLEAR_HUB_FEATURE 0x20 + #define HUB_CLEAR_PORT_FEATURE 0x23 + #define HUB_GET_BUS_STATE 0xA3 + #define HUB_GET_HUB_DESCRIPTOR 0xA0 + #define HUB_GET_HUB_STATUS 0xA0 + #define HUB_GET_PORT_STATUS 0xA3 + #define HUB_SET_HUB_DESCRIPTOR 0x20 + #define HUB_SET_HUB_FEATURE 0x20 + #define HUB_SET_PORT_FEATURE 0x23 #endif /* Hub class feature selectors */ #ifndef HUB_PORT_RESET -#define HUB_C_HUB_LOCAL_POWER 0 -#define HUB_C_HUB_OVER_CURRENT 1 -#define HUB_PORT_CONNECTION 0 -#define HUB_PORT_ENABLE 1 -#define HUB_PORT_SUSPEND 2 -#define HUB_PORT_OVER_CURRENT 3 -#define HUB_PORT_RESET 4 -#define HUB_PORT_POWER 8 -#define HUB_PORT_LOW_SPEED 9 -#define HUB_C_PORT_CONNECTION 16 -#define HUB_C_PORT_ENABLE 17 -#define HUB_C_PORT_SUSPEND 18 -#define HUB_C_PORT_OVER_CURRENT 19 -#define HUB_C_PORT_RESET 20 + #define HUB_C_HUB_LOCAL_POWER 0 + #define HUB_C_HUB_OVER_CURRENT 1 + #define HUB_PORT_CONNECTION 0 + #define HUB_PORT_ENABLE 1 + #define HUB_PORT_SUSPEND 2 + #define HUB_PORT_OVER_CURRENT 3 + #define HUB_PORT_RESET 4 + #define HUB_PORT_POWER 8 + #define HUB_PORT_LOW_SPEED 9 + #define HUB_C_PORT_CONNECTION 16 + #define HUB_C_PORT_ENABLE 17 + #define HUB_C_PORT_SUSPEND 18 + #define HUB_C_PORT_OVER_CURRENT 19 + #define HUB_C_PORT_RESET 20 #endif /* USB descriptor type */ #ifndef USB_DESCR_TYP_DEVICE -#define USB_DESCR_TYP_DEVICE 0x01 -#define USB_DESCR_TYP_CONFIG 0x02 -#define USB_DESCR_TYP_STRING 0x03 -#define USB_DESCR_TYP_INTERF 0x04 -#define USB_DESCR_TYP_ENDP 0x05 -#define USB_DESCR_TYP_QUALIF 0x06 -#define USB_DESCR_TYP_SPEED 0x07 -#define USB_DESCR_TYP_OTG 0x09 -#define USB_DESCR_TYP_HID 0x21 -#define USB_DESCR_TYP_REPORT 0x22 -#define USB_DESCR_TYP_PHYSIC 0x23 -#define USB_DESCR_TYP_CS_INTF 0x24 -#define USB_DESCR_TYP_CS_ENDP 0x25 -#define USB_DESCR_TYP_HUB 0x29 + #define USB_DESCR_TYP_DEVICE 0x01 + #define USB_DESCR_TYP_CONFIG 0x02 + #define USB_DESCR_TYP_STRING 0x03 + #define USB_DESCR_TYP_INTERF 0x04 + #define USB_DESCR_TYP_ENDP 0x05 + #define USB_DESCR_TYP_QUALIF 0x06 + #define USB_DESCR_TYP_SPEED 0x07 + #define USB_DESCR_TYP_OTG 0x09 + #define USB_DESCR_TYP_HID 0x21 + #define USB_DESCR_TYP_REPORT 0x22 + #define USB_DESCR_TYP_PHYSIC 0x23 + #define USB_DESCR_TYP_CS_INTF 0x24 + #define USB_DESCR_TYP_CS_ENDP 0x25 + #define USB_DESCR_TYP_HUB 0x29 #endif /* USB device class */ #ifndef USB_DEV_CLASS_HUB -#define USB_DEV_CLASS_RESERVED 0x00 -#define USB_DEV_CLASS_AUDIO 0x01 -#define USB_DEV_CLASS_COMMUNIC 0x02 -#define USB_DEV_CLASS_HID 0x03 -#define USB_DEV_CLASS_MONITOR 0x04 -#define USB_DEV_CLASS_PHYSIC_IF 0x05 -#define USB_DEV_CLASS_IMAGE 0x06 -#define USB_DEV_CLASS_PRINTER 0x07 -#define USB_DEV_CLASS_STORAGE 0x08 -#define USB_DEV_CLASS_HUB 0x09 -#define USB_DEV_CLASS_VEN_SPEC 0xFF + #define USB_DEV_CLASS_RESERVED 0x00 + #define USB_DEV_CLASS_AUDIO 0x01 + #define USB_DEV_CLASS_COMMUNIC 0x02 + #define USB_DEV_CLASS_HID 0x03 + #define USB_DEV_CLASS_MONITOR 0x04 + #define USB_DEV_CLASS_PHYSIC_IF 0x05 + #define USB_DEV_CLASS_IMAGE 0x06 + #define USB_DEV_CLASS_PRINTER 0x07 + #define USB_DEV_CLASS_STORAGE 0x08 + #define USB_DEV_CLASS_HUB 0x09 + #define USB_DEV_CLASS_VEN_SPEC 0xFF #endif /* USB endpoint type and attributes */ #ifndef USB_ENDP_TYPE_MASK -#define USB_ENDP_DIR_MASK 0x80 -#define USB_ENDP_ADDR_MASK 0x0F -#define USB_ENDP_TYPE_MASK 0x03 -#define USB_ENDP_TYPE_CTRL 0x00 -#define USB_ENDP_TYPE_ISOCH 0x01 -#define USB_ENDP_TYPE_BULK 0x02 -#define USB_ENDP_TYPE_INTER 0x03 + #define USB_ENDP_DIR_MASK 0x80 + #define USB_ENDP_ADDR_MASK 0x0F + #define USB_ENDP_TYPE_MASK 0x03 + #define USB_ENDP_TYPE_CTRL 0x00 + #define USB_ENDP_TYPE_ISOCH 0x01 + #define USB_ENDP_TYPE_BULK 0x02 + #define USB_ENDP_TYPE_INTER 0x03 #endif #ifndef USB_DEVICE_ADDR -#define USB_DEVICE_ADDR 0x02 + #define USB_DEVICE_ADDR 0x02 #endif #ifndef DEFAULT_ENDP0_SIZE -#define DEFAULT_ENDP0_SIZE 8 /* default maximum packet size for endpoint 0 */ + #define DEFAULT_ENDP0_SIZE 8 /* default maximum packet size for endpoint 0 */ #endif #ifndef MAX_PACKET_SIZE -#define MAX_PACKET_SIZE 64 /* maximum packet size */ + #define MAX_PACKET_SIZE 64 /* maximum packet size */ #endif #ifndef USB_BO_CBW_SIZE -#define USB_BO_CBW_SIZE 0x1F -#define USB_BO_CSW_SIZE 0x0D + #define USB_BO_CBW_SIZE 0x1F + #define USB_BO_CSW_SIZE 0x0D #endif #ifndef USB_BO_CBW_SIG0 -#define USB_BO_CBW_SIG0 0x55 -#define USB_BO_CBW_SIG1 0x53 -#define USB_BO_CBW_SIG2 0x42 -#define USB_BO_CBW_SIG3 0x43 -#define USB_BO_CSW_SIG0 0x55 -#define USB_BO_CSW_SIG1 0x53 -#define USB_BO_CSW_SIG2 0x42 -#define USB_BO_CSW_SIG3 0x53 + #define USB_BO_CBW_SIG0 0x55 + #define USB_BO_CBW_SIG1 0x53 + #define USB_BO_CBW_SIG2 0x42 + #define USB_BO_CBW_SIG3 0x43 + #define USB_BO_CSW_SIG0 0x55 + #define USB_BO_CSW_SIG1 0x53 + #define USB_BO_CSW_SIG2 0x42 + #define USB_BO_CSW_SIG3 0x53 #endif #define DEF_STRING_DESC_LANG 0x00 @@ -759,490 +752,492 @@ extern "C" #define DEF_STRING_DESC_PROD 0x02 #define DEF_STRING_DESC_SERN 0x03 - //--------------------------------------------------------------------+ - // Common Definitions - //--------------------------------------------------------------------+ - /** \defgroup ClassDriver_HID_Common Common Definitions - * @{ */ - /// USB HID Descriptor - typedef struct TU_ATTR_PACKED - { - uint8_t bLength; /**< Numeric expression that is the total size of the HID descriptor */ - uint8_t bDescriptorType; /**< Constant name specifying type of HID descriptor. */ +//--------------------------------------------------------------------+ +// Common Definitions +//--------------------------------------------------------------------+ +/** \defgroup ClassDriver_HID_Common Common Definitions + * @{ */ - uint16_t bcdHID; /**< Numeric expression identifying the HID Class Specification release */ - uint8_t bCountryCode; /**< Numeric expression identifying country code of the localized hardware. */ - uint8_t bNumDescriptors; /**< Numeric expression specifying the number of class descriptors */ + /// USB HID Descriptor +typedef struct TU_ATTR_PACKED +{ + uint8_t bLength; /**< Numeric expression that is the total size of the HID descriptor */ + uint8_t bDescriptorType; /**< Constant name specifying type of HID descriptor. */ - uint8_t bReportType; /**< Type of HID class report. */ - uint16_t wReportLength; /**< the total size of the Report descriptor. */ - } tusb_hid_descriptor_hid_t; + uint16_t bcdHID; /**< Numeric expression identifying the HID Class Specification release */ + uint8_t bCountryCode; /**< Numeric expression identifying country code of the localized hardware. */ + uint8_t bNumDescriptors; /**< Numeric expression specifying the number of class descriptors */ - /// HID Subclass - typedef enum - { - HID_SUBCLASS_NONE = 0, ///< No Subclass - HID_SUBCLASS_BOOT = 1 ///< Boot Interface Subclass - } hid_subclass_type_t; + uint8_t bReportType; /**< Type of HID class report. */ + uint16_t wReportLength; /**< the total size of the Report descriptor. */ +} tusb_hid_descriptor_hid_t; - /// HID Protocol - typedef enum - { - HID_PROTOCOL_NONE = 0, ///< None - HID_PROTOCOL_KEYBOARD = 1, ///< Keyboard - HID_PROTOCOL_MOUSE = 2 ///< Mouse - } hid_protocol_type_t; +/// HID Subclass +typedef enum +{ + HID_SUBCLASS_NONE = 0, ///< No Subclass + HID_SUBCLASS_BOOT = 1 ///< Boot Interface Subclass +}hid_subclass_type_t; - /// HID Descriptor Type - typedef enum - { - HID_DESC_TYPE_HID = 0x21, ///< HID Descriptor - HID_DESC_TYPE_REPORT = 0x22, ///< Report Descriptor - HID_DESC_TYPE_PHYSICAL = 0x23 ///< Physical Descriptor - } hid_descriptor_type_t; +/// HID Protocol +typedef enum +{ + HID_PROTOCOL_NONE = 0, ///< None + HID_PROTOCOL_KEYBOARD = 1, ///< Keyboard + HID_PROTOCOL_MOUSE = 2 ///< Mouse +}hid_protocol_type_t; - /// HID Request Report Type - typedef enum - { - HID_REPORT_TYPE_INVALID = 0, - HID_REPORT_TYPE_INPUT, ///< Input - HID_REPORT_TYPE_OUTPUT, ///< Output - HID_REPORT_TYPE_FEATURE ///< Feature - } hid_report_type_t; +/// HID Descriptor Type +typedef enum +{ + HID_DESC_TYPE_HID = 0x21, ///< HID Descriptor + HID_DESC_TYPE_REPORT = 0x22, ///< Report Descriptor + HID_DESC_TYPE_PHYSICAL = 0x23 ///< Physical Descriptor +}hid_descriptor_type_t; - /// HID Class Specific Control Request - typedef enum - { - HID_REQ_CONTROL_GET_REPORT = 0x01, ///< Get Report - HID_REQ_CONTROL_GET_IDLE = 0x02, ///< Get Idle - HID_REQ_CONTROL_GET_PROTOCOL = 0x03, ///< Get Protocol - HID_REQ_CONTROL_SET_REPORT = 0x09, ///< Set Report - HID_REQ_CONTROL_SET_IDLE = 0x0a, ///< Set Idle - HID_REQ_CONTROL_SET_PROTOCOL = 0x0b ///< Set Protocol - } hid_request_type_t; +/// HID Request Report Type +typedef enum +{ + HID_REPORT_TYPE_INVALID = 0, + HID_REPORT_TYPE_INPUT, ///< Input + HID_REPORT_TYPE_OUTPUT, ///< Output + HID_REPORT_TYPE_FEATURE ///< Feature +}hid_report_type_t; - /// HID Country Code - typedef enum - { - HID_LOCAL_NotSupported = 0, ///< NotSupported - HID_LOCAL_Arabic, ///< Arabic - HID_LOCAL_Belgian, ///< Belgian - HID_LOCAL_Canadian_Bilingual, ///< Canadian_Bilingual - HID_LOCAL_Canadian_French, ///< Canadian_French - HID_LOCAL_Czech_Republic, ///< Czech_Republic - HID_LOCAL_Danish, ///< Danish - HID_LOCAL_Finnish, ///< Finnish - HID_LOCAL_French, ///< French - HID_LOCAL_German, ///< German - HID_LOCAL_Greek, ///< Greek - HID_LOCAL_Hebrew, ///< Hebrew - HID_LOCAL_Hungary, ///< Hungary - HID_LOCAL_International, ///< International - HID_LOCAL_Italian, ///< Italian - HID_LOCAL_Japan_Katakana, ///< Japan_Katakana - HID_LOCAL_Korean, ///< Korean - HID_LOCAL_Latin_American, ///< Latin_American - HID_LOCAL_Netherlands_Dutch, ///< Netherlands/Dutch - HID_LOCAL_Norwegian, ///< Norwegian - HID_LOCAL_Persian_Farsi, ///< Persian (Farsi) - HID_LOCAL_Poland, ///< Poland - HID_LOCAL_Portuguese, ///< Portuguese - HID_LOCAL_Russia, ///< Russia - HID_LOCAL_Slovakia, ///< Slovakia - HID_LOCAL_Spanish, ///< Spanish - HID_LOCAL_Swedish, ///< Swedish - HID_LOCAL_Swiss_French, ///< Swiss/French - HID_LOCAL_Swiss_German, ///< Swiss/German - HID_LOCAL_Switzerland, ///< Switzerland - HID_LOCAL_Taiwan, ///< Taiwan - HID_LOCAL_Turkish_Q, ///< Turkish-Q - HID_LOCAL_UK, ///< UK - HID_LOCAL_US, ///< US - HID_LOCAL_Yugoslavia, ///< Yugoslavia - HID_LOCAL_Turkish_F ///< Turkish-F - } hid_country_code_t; +/// HID Class Specific Control Request +typedef enum +{ + HID_REQ_CONTROL_GET_REPORT = 0x01, ///< Get Report + HID_REQ_CONTROL_GET_IDLE = 0x02, ///< Get Idle + HID_REQ_CONTROL_GET_PROTOCOL = 0x03, ///< Get Protocol + HID_REQ_CONTROL_SET_REPORT = 0x09, ///< Set Report + HID_REQ_CONTROL_SET_IDLE = 0x0a, ///< Set Idle + HID_REQ_CONTROL_SET_PROTOCOL = 0x0b ///< Set Protocol +}hid_request_type_t; - /** @} */ +/// HID Country Code +typedef enum +{ + HID_LOCAL_NotSupported = 0 , ///< NotSupported + HID_LOCAL_Arabic , ///< Arabic + HID_LOCAL_Belgian , ///< Belgian + HID_LOCAL_Canadian_Bilingual , ///< Canadian_Bilingual + HID_LOCAL_Canadian_French , ///< Canadian_French + HID_LOCAL_Czech_Republic , ///< Czech_Republic + HID_LOCAL_Danish , ///< Danish + HID_LOCAL_Finnish , ///< Finnish + HID_LOCAL_French , ///< French + HID_LOCAL_German , ///< German + HID_LOCAL_Greek , ///< Greek + HID_LOCAL_Hebrew , ///< Hebrew + HID_LOCAL_Hungary , ///< Hungary + HID_LOCAL_International , ///< International + HID_LOCAL_Italian , ///< Italian + HID_LOCAL_Japan_Katakana , ///< Japan_Katakana + HID_LOCAL_Korean , ///< Korean + HID_LOCAL_Latin_American , ///< Latin_American + HID_LOCAL_Netherlands_Dutch , ///< Netherlands/Dutch + HID_LOCAL_Norwegian , ///< Norwegian + HID_LOCAL_Persian_Farsi , ///< Persian (Farsi) + HID_LOCAL_Poland , ///< Poland + HID_LOCAL_Portuguese , ///< Portuguese + HID_LOCAL_Russia , ///< Russia + HID_LOCAL_Slovakia , ///< Slovakia + HID_LOCAL_Spanish , ///< Spanish + HID_LOCAL_Swedish , ///< Swedish + HID_LOCAL_Swiss_French , ///< Swiss/French + HID_LOCAL_Swiss_German , ///< Swiss/German + HID_LOCAL_Switzerland , ///< Switzerland + HID_LOCAL_Taiwan , ///< Taiwan + HID_LOCAL_Turkish_Q , ///< Turkish-Q + HID_LOCAL_UK , ///< UK + HID_LOCAL_US , ///< US + HID_LOCAL_Yugoslavia , ///< Yugoslavia + HID_LOCAL_Turkish_F ///< Turkish-F +} hid_country_code_t; - //--------------------------------------------------------------------+ - // GAMEPAD - //--------------------------------------------------------------------+ - /** \addtogroup ClassDriver_HID_Gamepad Gamepad - * @{ */ +/** @} */ - /* From https://www.kernel.org/doc/html/latest/input/gamepad.html - ____________________________ __ - / [__ZL__] [__ZR__] \ | - / [__ TL __] [__ TR __] \ | Front Triggers - __/________________________________\__ __| - / _ \ | - / /\ __ (N) \ | - / || __ |MO| __ _ _ \ | Main Pad - | <===DP===> |SE| |ST| (W) -|- (E) | | - \ || ___ ___ _ / | - /\ \/ / \ / \ (S) /\ __| - / \________ | LS | ____ | RS | ________/ \ | - | / \ \___/ / \ \___/ / \ | | Control Sticks - | / \_____/ \_____/ \ | __| - | / \ | - \_____/ \_____/ +//--------------------------------------------------------------------+ +// GAMEPAD +//--------------------------------------------------------------------+ +/** \addtogroup ClassDriver_HID_Gamepad Gamepad + * @{ */ - |________|______| |______|___________| - D-Pad Left Right Action Pad - Stick Stick +/* From https://www.kernel.org/doc/html/latest/input/gamepad.html + ____________________________ __ + / [__ZL__] [__ZR__] \ | + / [__ TL __] [__ TR __] \ | Front Triggers + __/________________________________\__ __| + / _ \ | + / /\ __ (N) \ | + / || __ |MO| __ _ _ \ | Main Pad + | <===DP===> |SE| |ST| (W) -|- (E) | | + \ || ___ ___ _ / | + /\ \/ / \ / \ (S) /\ __| + / \________ | LS | ____ | RS | ________/ \ | +| / \ \___/ / \ \___/ / \ | | Control Sticks +| / \_____/ \_____/ \ | __| +| / \ | + \_____/ \_____/ - |_____________| - Menu Pad + |________|______| |______|___________| + D-Pad Left Right Action Pad + Stick Stick - Most gamepads have the following features: - - Action-Pad 4 buttons in diamonds-shape (on the right side) NORTH, SOUTH, WEST and EAST. - - D-Pad (Direction-pad) 4 buttons (on the left side) that point up, down, left and right. - - Menu-Pad Different constellations, but most-times 2 buttons: SELECT - START. - - Analog-Sticks provide freely moveable sticks to control directions, Analog-sticks may also - provide a digital button if you press them. - - Triggers are located on the upper-side of the pad in vertical direction. The upper buttons - are normally named Left- and Right-Triggers, the lower buttons Z-Left and Z-Right. - - Rumble Many devices provide force-feedback features. But are mostly just simple rumble motors. - */ + |_____________| + Menu Pad - /// HID Gamepad Protocol Report. - typedef struct TU_ATTR_PACKED - { - int8_t x; ///< Delta x movement of left analog-stick - int8_t y; ///< Delta y movement of left analog-stick - int8_t z; ///< Delta z movement of right analog-joystick - int8_t rz; ///< Delta Rz movement of right analog-joystick - int8_t rx; ///< Delta Rx movement of analog left trigger - int8_t ry; ///< Delta Ry movement of analog right trigger - uint8_t hat; ///< Buttons mask for currently pressed buttons in the DPad/hat - uint16_t buttons; ///< Buttons mask for currently pressed buttons - } hid_gamepad_report_t; + Most gamepads have the following features: + - Action-Pad 4 buttons in diamonds-shape (on the right side) NORTH, SOUTH, WEST and EAST. + - D-Pad (Direction-pad) 4 buttons (on the left side) that point up, down, left and right. + - Menu-Pad Different constellations, but most-times 2 buttons: SELECT - START. + - Analog-Sticks provide freely moveable sticks to control directions, Analog-sticks may also + provide a digital button if you press them. + - Triggers are located on the upper-side of the pad in vertical direction. The upper buttons + are normally named Left- and Right-Triggers, the lower buttons Z-Left and Z-Right. + - Rumble Many devices provide force-feedback features. But are mostly just simple rumble motors. + */ - /// HID Switch Gamepad Protocol Report. - typedef struct TU_ATTR_PACKED - { - uint16_t buttons; ///< Buttons mask for currently pressed buttons - uint8_t hat; ///< Buttons mask for currently pressed buttons in the DPad/hat - int8_t x; ///< Delta x movement of left analog-stick - int8_t y; ///< Delta y movement of left analog-stick - int8_t rx; ///< Delta Rx movement of analog left trigger - int8_t ry; ///< Delta Ry movement of analog right trigger - int8_t z; ///< Delta z movement of right analog-joystick - int8_t rz; ///< Delta Rz movement of right analog-joystick - } hid_gamepad_ns_report_t; +/// HID Gamepad Protocol Report. +typedef struct TU_ATTR_PACKED +{ + int8_t x; ///< Delta x movement of left analog-stick + int8_t y; ///< Delta y movement of left analog-stick + int8_t z; ///< Delta z movement of right analog-joystick + int8_t rz; ///< Delta Rz movement of right analog-joystick + int8_t rx; ///< Delta Rx movement of analog left trigger + int8_t ry; ///< Delta Ry movement of analog right trigger + uint8_t hat; ///< Buttons mask for currently pressed buttons in the DPad/hat + uint16_t buttons; ///< Buttons mask for currently pressed buttons +}hid_gamepad_report_t; - /// Standard Gamepad Buttons Bitmap (from Linux input event codes) - typedef enum - { - GAMEPAD_BUTTON_A = TU_BIT(0), ///< A/South button - GAMEPAD_BUTTON_B = TU_BIT(1), ///< B/East button - GAMEPAD_BUTTON_C = TU_BIT(2), ///< C button - GAMEPAD_BUTTON_X = TU_BIT(3), ///< X/North button - GAMEPAD_BUTTON_Y = TU_BIT(4), ///< Y/West button - GAMEPAD_BUTTON_Z = TU_BIT(5), ///< Z button - GAMEPAD_BUTTON_TL = TU_BIT(6), ///< L1 button - GAMEPAD_BUTTON_TR = TU_BIT(7), ///< R1 button - GAMEPAD_BUTTON_TL2 = TU_BIT(8), ///< L2 button - GAMEPAD_BUTTON_TR2 = TU_BIT(9), ///< R2 button - GAMEPAD_BUTTON_SELECT = TU_BIT(10), ///< Select button - GAMEPAD_BUTTON_START = TU_BIT(11), ///< Start button - GAMEPAD_BUTTON_MODE = TU_BIT(12), ///< Mode button - GAMEPAD_BUTTON_THUMBL = TU_BIT(13), ///< L3 button - GAMEPAD_BUTTON_THUMBR = TU_BIT(14), ///< R3 button - // GAMEPAD_BUTTON_ = TU_BIT(15), ///< Undefined button - } hid_gamepad_button_bm_t; +/// HID Switch Gamepad Protocol Report. +typedef struct TU_ATTR_PACKED +{ + uint16_t buttons; ///< Buttons mask for currently pressed buttons + uint8_t hat; ///< Buttons mask for currently pressed buttons in the DPad/hat + int8_t x; ///< Delta x movement of left analog-stick + int8_t y; ///< Delta y movement of left analog-stick + int8_t rx; ///< Delta Rx movement of analog left trigger + int8_t ry; ///< Delta Ry movement of analog right trigger + int8_t z; ///< Delta z movement of right analog-joystick + int8_t rz; ///< Delta Rz movement of right analog-joystick +}hid_gamepad_ns_report_t; - /// Switch Gamepad Buttons Bitmap - typedef enum - { - GAMEPAD_NS_BUTTON_Y = 0x01, - GAMEPAD_NS_BUTTON_B = 0x02, - GAMEPAD_NS_BUTTON_A = 0x04, - GAMEPAD_NS_BUTTON_X = 0x08, - GAMEPAD_NS_BUTTON_TL = 0x10, - GAMEPAD_NS_BUTTON_TR = 0x20, - GAMEPAD_NS_BUTTON_TL2 = 0x40, - GAMEPAD_NS_BUTTON_TR2 = 0x80, - GAMEPAD_NS_BUTTON_MINUS = 0x100, - GAMEPAD_NS_BUTTON_PLUS = 0x200, - GAMEPAD_NS_BUTTON_THUMBL = 0x400, - GAMEPAD_NS_BUTTON_THUMBR = 0x800, - GAMEPAD_NS_BUTTON_HOME = 0x1000, - GAMEPAD_NS_BUTTON_CAPTURE = 0x2000, - GAMEPAD_NS_BUTTON_Z = 0x4000, /// UNUSED? - } hid_gamepad_ns_button_bm_t; +/// Standard Gamepad Buttons Bitmap (from Linux input event codes) +typedef enum +{ + GAMEPAD_BUTTON_A = TU_BIT(0), ///< A/South button + GAMEPAD_BUTTON_B = TU_BIT(1), ///< B/East button + GAMEPAD_BUTTON_C = TU_BIT(2), ///< C button + GAMEPAD_BUTTON_X = TU_BIT(3), ///< X/North button + GAMEPAD_BUTTON_Y = TU_BIT(4), ///< Y/West button + GAMEPAD_BUTTON_Z = TU_BIT(5), ///< Z button + GAMEPAD_BUTTON_TL = TU_BIT(6), ///< L1 button + GAMEPAD_BUTTON_TR = TU_BIT(7), ///< R1 button + GAMEPAD_BUTTON_TL2 = TU_BIT(8), ///< L2 button + GAMEPAD_BUTTON_TR2 = TU_BIT(9), ///< R2 button + GAMEPAD_BUTTON_SELECT = TU_BIT(10), ///< Select button + GAMEPAD_BUTTON_START = TU_BIT(11), ///< Start button + GAMEPAD_BUTTON_MODE = TU_BIT(12), ///< Mode button + GAMEPAD_BUTTON_THUMBL = TU_BIT(13), ///< L3 button + GAMEPAD_BUTTON_THUMBR = TU_BIT(14), ///< R3 button +//GAMEPAD_BUTTON_ = TU_BIT(15), ///< Undefined button +}hid_gamepad_button_bm_t; - /// Standard Gamepad HAT/DPAD Buttons (from Linux input event codes) - typedef enum - { - GAMEPAD_HAT_CENTERED = 0, ///< DPAD_CENTERED - GAMEPAD_HAT_UP = 1, ///< DPAD_UP - GAMEPAD_HAT_UP_RIGHT = 2, ///< DPAD_UP_RIGHT - GAMEPAD_HAT_RIGHT = 3, ///< DPAD_RIGHT - GAMEPAD_HAT_DOWN_RIGHT = 4, ///< DPAD_DOWN_RIGHT - GAMEPAD_HAT_DOWN = 5, ///< DPAD_DOWN - GAMEPAD_HAT_DOWN_LEFT = 6, ///< DPAD_DOWN_LEFT - GAMEPAD_HAT_LEFT = 7, ///< DPAD_LEFT - GAMEPAD_HAT_UP_LEFT = 8, ///< DPAD_UP_LEFT - } hid_gamepad_hat_t; +/// Switch Gamepad Buttons Bitmap +typedef enum +{ + GAMEPAD_NS_BUTTON_Y = 0x01, + GAMEPAD_NS_BUTTON_B = 0x02, + GAMEPAD_NS_BUTTON_A = 0x04, + GAMEPAD_NS_BUTTON_X = 0x08, + GAMEPAD_NS_BUTTON_TL = 0x10, + GAMEPAD_NS_BUTTON_TR = 0x20, + GAMEPAD_NS_BUTTON_TL2 = 0x40, + GAMEPAD_NS_BUTTON_TR2 = 0x80, + GAMEPAD_NS_BUTTON_MINUS = 0x100, + GAMEPAD_NS_BUTTON_PLUS = 0x200, + GAMEPAD_NS_BUTTON_THUMBL = 0x400, + GAMEPAD_NS_BUTTON_THUMBR = 0x800, + GAMEPAD_NS_BUTTON_HOME = 0x1000, + GAMEPAD_NS_BUTTON_CAPTURE = 0x2000, + GAMEPAD_NS_BUTTON_Z = 0x4000, ///UNUSED? +}hid_gamepad_ns_button_bm_t; - /// Switch Gamepad HAT/DPAD Buttons (from Linux input event codes) - typedef enum - { - GAMEPAD_NS_HAT_CENTERED = 8, ///< DPAD_CENTERED - GAMEPAD_NS_HAT_UP = 0, ///< DPAD_UP - GAMEPAD_NS_HAT_UP_RIGHT = 1, ///< DPAD_UP_RIGHT - GAMEPAD_NS_HAT_RIGHT = 2, ///< DPAD_RIGHT - GAMEPAD_NS_HAT_DOWN_RIGHT = 3, ///< DPAD_DOWN_RIGHT - GAMEPAD_NS_HAT_DOWN = 4, ///< DPAD_DOWN - GAMEPAD_NS_HAT_DOWN_LEFT = 5, ///< DPAD_DOWN_LEFT - GAMEPAD_NS_HAT_LEFT = 6, ///< DPAD_LEFT - GAMEPAD_NS_HAT_UP_LEFT = 7, ///< DPAD_UP_LEFT - } hid_gamepad_ns_hat_t; +/// Standard Gamepad HAT/DPAD Buttons (from Linux input event codes) +typedef enum +{ + GAMEPAD_HAT_CENTERED = 0, ///< DPAD_CENTERED + GAMEPAD_HAT_UP = 1, ///< DPAD_UP + GAMEPAD_HAT_UP_RIGHT = 2, ///< DPAD_UP_RIGHT + GAMEPAD_HAT_RIGHT = 3, ///< DPAD_RIGHT + GAMEPAD_HAT_DOWN_RIGHT = 4, ///< DPAD_DOWN_RIGHT + GAMEPAD_HAT_DOWN = 5, ///< DPAD_DOWN + GAMEPAD_HAT_DOWN_LEFT = 6, ///< DPAD_DOWN_LEFT + GAMEPAD_HAT_LEFT = 7, ///< DPAD_LEFT + GAMEPAD_HAT_UP_LEFT = 8, ///< DPAD_UP_LEFT +}hid_gamepad_hat_t; - /// @} +/// Switch Gamepad HAT/DPAD Buttons (from Linux input event codes) +typedef enum +{ + GAMEPAD_NS_HAT_CENTERED = 8, ///< DPAD_CENTERED + GAMEPAD_NS_HAT_UP = 0, ///< DPAD_UP + GAMEPAD_NS_HAT_UP_RIGHT = 1, ///< DPAD_UP_RIGHT + GAMEPAD_NS_HAT_RIGHT = 2, ///< DPAD_RIGHT + GAMEPAD_NS_HAT_DOWN_RIGHT = 3, ///< DPAD_DOWN_RIGHT + GAMEPAD_NS_HAT_DOWN = 4, ///< DPAD_DOWN + GAMEPAD_NS_HAT_DOWN_LEFT = 5, ///< DPAD_DOWN_LEFT + GAMEPAD_NS_HAT_LEFT = 6, ///< DPAD_LEFT + GAMEPAD_NS_HAT_UP_LEFT = 7, ///< DPAD_UP_LEFT +}hid_gamepad_ns_hat_t; - //--------------------------------------------------------------------+ - // MOUSE - //--------------------------------------------------------------------+ - /** \addtogroup ClassDriver_HID_Mouse Mouse - * @{ */ +/// @} - /// Standard HID Boot Protocol Mouse Report. - typedef struct TU_ATTR_PACKED - { - uint8_t buttons; /**< buttons mask for currently pressed buttons in the mouse. */ - int8_t x; /**< Current delta x movement of the mouse. */ - int8_t y; /**< Current delta y movement on the mouse. */ - int8_t wheel; /**< Current delta wheel movement on the mouse. */ - int8_t pan; // using AC Pan - } hid_mouse_report_t; +//--------------------------------------------------------------------+ +// MOUSE +//--------------------------------------------------------------------+ +/** \addtogroup ClassDriver_HID_Mouse Mouse + * @{ */ - /// Standard Mouse Buttons Bitmap - typedef enum - { - MOUSE_BUTTON_LEFT = TU_BIT(0), ///< Left button - MOUSE_BUTTON_RIGHT = TU_BIT(1), ///< Right button - MOUSE_BUTTON_MIDDLE = TU_BIT(2), ///< Middle button - MOUSE_BUTTON_BACKWARD = TU_BIT(3), ///< Backward button, - MOUSE_BUTTON_FORWARD = TU_BIT(4), ///< Forward button, - } hid_mouse_button_bm_t; +/// Standard HID Boot Protocol Mouse Report. +typedef struct TU_ATTR_PACKED +{ + uint8_t buttons; /**< buttons mask for currently pressed buttons in the mouse. */ + int8_t x; /**< Current delta x movement of the mouse. */ + int8_t y; /**< Current delta y movement on the mouse. */ + int8_t wheel; /**< Current delta wheel movement on the mouse. */ + int8_t pan; // using AC Pan +} hid_mouse_report_t; - /// @} +/// Standard Mouse Buttons Bitmap +typedef enum +{ + MOUSE_BUTTON_LEFT = TU_BIT(0), ///< Left button + MOUSE_BUTTON_RIGHT = TU_BIT(1), ///< Right button + MOUSE_BUTTON_MIDDLE = TU_BIT(2), ///< Middle button + MOUSE_BUTTON_BACKWARD = TU_BIT(3), ///< Backward button, + MOUSE_BUTTON_FORWARD = TU_BIT(4), ///< Forward button, +}hid_mouse_button_bm_t; - //--------------------------------------------------------------------+ - // Keyboard - //--------------------------------------------------------------------+ - /** \addtogroup ClassDriver_HID_Keyboard Keyboard - * @{ */ +/// @} - /// Standard HID Boot Protocol Keyboard Report. - typedef struct TU_ATTR_PACKED - { - uint8_t modifier; /**< Keyboard modifier (KEYBOARD_MODIFIER_* masks). */ - uint8_t reserved; /**< Reserved for OEM use, always set to 0. */ - uint8_t keycode[6]; /**< Key codes of the currently pressed keys. */ - } hid_keyboard_report_t; +//--------------------------------------------------------------------+ +// Keyboard +//--------------------------------------------------------------------+ +/** \addtogroup ClassDriver_HID_Keyboard Keyboard + * @{ */ - /// Keyboard modifier codes bitmap - typedef enum - { - KEYBOARD_MODIFIER_LEFTCTRL = TU_BIT(0), ///< Left Control - KEYBOARD_MODIFIER_LEFTSHIFT = TU_BIT(1), ///< Left Shift - KEYBOARD_MODIFIER_LEFTALT = TU_BIT(2), ///< Left Alt - KEYBOARD_MODIFIER_LEFTGUI = TU_BIT(3), ///< Left Window - KEYBOARD_MODIFIER_RIGHTCTRL = TU_BIT(4), ///< Right Control - KEYBOARD_MODIFIER_RIGHTSHIFT = TU_BIT(5), ///< Right Shift - KEYBOARD_MODIFIER_RIGHTALT = TU_BIT(6), ///< Right Alt - KEYBOARD_MODIFIER_RIGHTGUI = TU_BIT(7) ///< Right Window - } hid_keyboard_modifier_bm_t; +/// Standard HID Boot Protocol Keyboard Report. +typedef struct TU_ATTR_PACKED +{ + uint8_t modifier; /**< Keyboard modifier (KEYBOARD_MODIFIER_* masks). */ + uint8_t reserved; /**< Reserved for OEM use, always set to 0. */ + uint8_t keycode[6]; /**< Key codes of the currently pressed keys. */ +} hid_keyboard_report_t; - typedef enum - { - KEYBOARD_LED_NUMLOCK = TU_BIT(0), ///< Num Lock LED - KEYBOARD_LED_CAPSLOCK = TU_BIT(1), ///< Caps Lock LED - KEYBOARD_LED_SCROLLLOCK = TU_BIT(2), ///< Scroll Lock LED - KEYBOARD_LED_COMPOSE = TU_BIT(3), ///< Composition Mode - KEYBOARD_LED_KANA = TU_BIT(4) ///< Kana mode - } hid_keyboard_led_bm_t; +/// Keyboard modifier codes bitmap +typedef enum +{ + KEYBOARD_MODIFIER_LEFTCTRL = TU_BIT(0), ///< Left Control + KEYBOARD_MODIFIER_LEFTSHIFT = TU_BIT(1), ///< Left Shift + KEYBOARD_MODIFIER_LEFTALT = TU_BIT(2), ///< Left Alt + KEYBOARD_MODIFIER_LEFTGUI = TU_BIT(3), ///< Left Window + KEYBOARD_MODIFIER_RIGHTCTRL = TU_BIT(4), ///< Right Control + KEYBOARD_MODIFIER_RIGHTSHIFT = TU_BIT(5), ///< Right Shift + KEYBOARD_MODIFIER_RIGHTALT = TU_BIT(6), ///< Right Alt + KEYBOARD_MODIFIER_RIGHTGUI = TU_BIT(7) ///< Right Window +}hid_keyboard_modifier_bm_t; + +typedef enum +{ + KEYBOARD_LED_NUMLOCK = TU_BIT(0), ///< Num Lock LED + KEYBOARD_LED_CAPSLOCK = TU_BIT(1), ///< Caps Lock LED + KEYBOARD_LED_SCROLLLOCK = TU_BIT(2), ///< Scroll Lock LED + KEYBOARD_LED_COMPOSE = TU_BIT(3), ///< Composition Mode + KEYBOARD_LED_KANA = TU_BIT(4) ///< Kana mode +}hid_keyboard_led_bm_t; /// @} //--------------------------------------------------------------------+ // HID KEYCODE //--------------------------------------------------------------------+ -#define HID_KEY_NONE 0x00 -#define HID_KEY_A 0x04 -#define HID_KEY_B 0x05 -#define HID_KEY_C 0x06 -#define HID_KEY_D 0x07 -#define HID_KEY_E 0x08 -#define HID_KEY_F 0x09 -#define HID_KEY_G 0x0A -#define HID_KEY_H 0x0B -#define HID_KEY_I 0x0C -#define HID_KEY_J 0x0D -#define HID_KEY_K 0x0E -#define HID_KEY_L 0x0F -#define HID_KEY_M 0x10 -#define HID_KEY_N 0x11 -#define HID_KEY_O 0x12 -#define HID_KEY_P 0x13 -#define HID_KEY_Q 0x14 -#define HID_KEY_R 0x15 -#define HID_KEY_S 0x16 -#define HID_KEY_T 0x17 -#define HID_KEY_U 0x18 -#define HID_KEY_V 0x19 -#define HID_KEY_W 0x1A -#define HID_KEY_X 0x1B -#define HID_KEY_Y 0x1C -#define HID_KEY_Z 0x1D -#define HID_KEY_1 0x1E -#define HID_KEY_2 0x1F -#define HID_KEY_3 0x20 -#define HID_KEY_4 0x21 -#define HID_KEY_5 0x22 -#define HID_KEY_6 0x23 -#define HID_KEY_7 0x24 -#define HID_KEY_8 0x25 -#define HID_KEY_9 0x26 -#define HID_KEY_0 0x27 -#define HID_KEY_ENTER 0x28 -#define HID_KEY_ESCAPE 0x29 -#define HID_KEY_BACKSPACE 0x2A -#define HID_KEY_TAB 0x2B -#define HID_KEY_SPACE 0x2C -#define HID_KEY_MINUS 0x2D -#define HID_KEY_EQUAL 0x2E -#define HID_KEY_BRACKET_LEFT 0x2F -#define HID_KEY_BRACKET_RIGHT 0x30 -#define HID_KEY_BACKSLASH 0x31 -#define HID_KEY_EUROPE_1 0x32 -#define HID_KEY_SEMICOLON 0x33 -#define HID_KEY_APOSTROPHE 0x34 -#define HID_KEY_GRAVE 0x35 -#define HID_KEY_COMMA 0x36 -#define HID_KEY_PERIOD 0x37 -#define HID_KEY_SLASH 0x38 -#define HID_KEY_CAPS_LOCK 0x39 -#define HID_KEY_F1 0x3A -#define HID_KEY_F2 0x3B -#define HID_KEY_F3 0x3C -#define HID_KEY_F4 0x3D -#define HID_KEY_F5 0x3E -#define HID_KEY_F6 0x3F -#define HID_KEY_F7 0x40 -#define HID_KEY_F8 0x41 -#define HID_KEY_F9 0x42 -#define HID_KEY_F10 0x43 -#define HID_KEY_F11 0x44 -#define HID_KEY_F12 0x45 -#define HID_KEY_PRINT_SCREEN 0x46 -#define HID_KEY_SCROLL_LOCK 0x47 -#define HID_KEY_PAUSE 0x48 -#define HID_KEY_INSERT 0x49 -#define HID_KEY_HOME 0x4A -#define HID_KEY_PAGE_UP 0x4B -#define HID_KEY_DELETE 0x4C -#define HID_KEY_END 0x4D -#define HID_KEY_PAGE_DOWN 0x4E -#define HID_KEY_ARROW_RIGHT 0x4F -#define HID_KEY_ARROW_LEFT 0x50 -#define HID_KEY_ARROW_DOWN 0x51 -#define HID_KEY_ARROW_UP 0x52 -#define HID_KEY_NUM_LOCK 0x53 -#define HID_KEY_KEYPAD_DIVIDE 0x54 -#define HID_KEY_KEYPAD_MULTIPLY 0x55 -#define HID_KEY_KEYPAD_SUBTRACT 0x56 -#define HID_KEY_KEYPAD_ADD 0x57 -#define HID_KEY_KEYPAD_ENTER 0x58 -#define HID_KEY_KEYPAD_1 0x59 -#define HID_KEY_KEYPAD_2 0x5A -#define HID_KEY_KEYPAD_3 0x5B -#define HID_KEY_KEYPAD_4 0x5C -#define HID_KEY_KEYPAD_5 0x5D -#define HID_KEY_KEYPAD_6 0x5E -#define HID_KEY_KEYPAD_7 0x5F -#define HID_KEY_KEYPAD_8 0x60 -#define HID_KEY_KEYPAD_9 0x61 -#define HID_KEY_KEYPAD_0 0x62 -#define HID_KEY_KEYPAD_DECIMAL 0x63 -#define HID_KEY_EUROPE_2 0x64 -#define HID_KEY_APPLICATION 0x65 -#define HID_KEY_POWER 0x66 -#define HID_KEY_KEYPAD_EQUAL 0x67 -#define HID_KEY_F13 0x68 -#define HID_KEY_F14 0x69 -#define HID_KEY_F15 0x6A -#define HID_KEY_F16 0x6B -#define HID_KEY_F17 0x6C -#define HID_KEY_F18 0x6D -#define HID_KEY_F19 0x6E -#define HID_KEY_F20 0x6F -#define HID_KEY_F21 0x70 -#define HID_KEY_F22 0x71 -#define HID_KEY_F23 0x72 -#define HID_KEY_F24 0x73 -#define HID_KEY_EXECUTE 0x74 -#define HID_KEY_HELP 0x75 -#define HID_KEY_MENU 0x76 -#define HID_KEY_SELECT 0x77 -#define HID_KEY_STOP 0x78 -#define HID_KEY_AGAIN 0x79 -#define HID_KEY_UNDO 0x7A -#define HID_KEY_CUT 0x7B -#define HID_KEY_COPY 0x7C -#define HID_KEY_PASTE 0x7D -#define HID_KEY_FIND 0x7E -#define HID_KEY_MUTE 0x7F -#define HID_KEY_VOLUME_UP 0x80 -#define HID_KEY_VOLUME_DOWN 0x81 -#define HID_KEY_LOCKING_CAPS_LOCK 0x82 -#define HID_KEY_LOCKING_NUM_LOCK 0x83 -#define HID_KEY_LOCKING_SCROLL_LOCK 0x84 -#define HID_KEY_KEYPAD_COMMA 0x85 -#define HID_KEY_KEYPAD_EQUAL_SIGN 0x86 -#define HID_KEY_KANJI1 0x87 -#define HID_KEY_KANJI2 0x88 -#define HID_KEY_KANJI3 0x89 -#define HID_KEY_KANJI4 0x8A -#define HID_KEY_KANJI5 0x8B -#define HID_KEY_KANJI6 0x8C -#define HID_KEY_KANJI7 0x8D -#define HID_KEY_KANJI8 0x8E -#define HID_KEY_KANJI9 0x8F -#define HID_KEY_LANG1 0x90 -#define HID_KEY_LANG2 0x91 -#define HID_KEY_LANG3 0x92 -#define HID_KEY_LANG4 0x93 -#define HID_KEY_LANG5 0x94 -#define HID_KEY_LANG6 0x95 -#define HID_KEY_LANG7 0x96 -#define HID_KEY_LANG8 0x97 -#define HID_KEY_LANG9 0x98 -#define HID_KEY_ALTERNATE_ERASE 0x99 -#define HID_KEY_SYSREQ_ATTENTION 0x9A -#define HID_KEY_CANCEL 0x9B -#define HID_KEY_CLEAR 0x9C -#define HID_KEY_PRIOR 0x9D -#define HID_KEY_RETURN 0x9E -#define HID_KEY_SEPARATOR 0x9F -#define HID_KEY_OUT 0xA0 -#define HID_KEY_OPER 0xA1 -#define HID_KEY_CLEAR_AGAIN 0xA2 -#define HID_KEY_CRSEL_PROPS 0xA3 -#define HID_KEY_EXSEL 0xA4 +#define HID_KEY_NONE 0x00 +#define HID_KEY_A 0x04 +#define HID_KEY_B 0x05 +#define HID_KEY_C 0x06 +#define HID_KEY_D 0x07 +#define HID_KEY_E 0x08 +#define HID_KEY_F 0x09 +#define HID_KEY_G 0x0A +#define HID_KEY_H 0x0B +#define HID_KEY_I 0x0C +#define HID_KEY_J 0x0D +#define HID_KEY_K 0x0E +#define HID_KEY_L 0x0F +#define HID_KEY_M 0x10 +#define HID_KEY_N 0x11 +#define HID_KEY_O 0x12 +#define HID_KEY_P 0x13 +#define HID_KEY_Q 0x14 +#define HID_KEY_R 0x15 +#define HID_KEY_S 0x16 +#define HID_KEY_T 0x17 +#define HID_KEY_U 0x18 +#define HID_KEY_V 0x19 +#define HID_KEY_W 0x1A +#define HID_KEY_X 0x1B +#define HID_KEY_Y 0x1C +#define HID_KEY_Z 0x1D +#define HID_KEY_1 0x1E +#define HID_KEY_2 0x1F +#define HID_KEY_3 0x20 +#define HID_KEY_4 0x21 +#define HID_KEY_5 0x22 +#define HID_KEY_6 0x23 +#define HID_KEY_7 0x24 +#define HID_KEY_8 0x25 +#define HID_KEY_9 0x26 +#define HID_KEY_0 0x27 +#define HID_KEY_ENTER 0x28 +#define HID_KEY_ESCAPE 0x29 +#define HID_KEY_BACKSPACE 0x2A +#define HID_KEY_TAB 0x2B +#define HID_KEY_SPACE 0x2C +#define HID_KEY_MINUS 0x2D +#define HID_KEY_EQUAL 0x2E +#define HID_KEY_BRACKET_LEFT 0x2F +#define HID_KEY_BRACKET_RIGHT 0x30 +#define HID_KEY_BACKSLASH 0x31 +#define HID_KEY_EUROPE_1 0x32 +#define HID_KEY_SEMICOLON 0x33 +#define HID_KEY_APOSTROPHE 0x34 +#define HID_KEY_GRAVE 0x35 +#define HID_KEY_COMMA 0x36 +#define HID_KEY_PERIOD 0x37 +#define HID_KEY_SLASH 0x38 +#define HID_KEY_CAPS_LOCK 0x39 +#define HID_KEY_F1 0x3A +#define HID_KEY_F2 0x3B +#define HID_KEY_F3 0x3C +#define HID_KEY_F4 0x3D +#define HID_KEY_F5 0x3E +#define HID_KEY_F6 0x3F +#define HID_KEY_F7 0x40 +#define HID_KEY_F8 0x41 +#define HID_KEY_F9 0x42 +#define HID_KEY_F10 0x43 +#define HID_KEY_F11 0x44 +#define HID_KEY_F12 0x45 +#define HID_KEY_PRINT_SCREEN 0x46 +#define HID_KEY_SCROLL_LOCK 0x47 +#define HID_KEY_PAUSE 0x48 +#define HID_KEY_INSERT 0x49 +#define HID_KEY_HOME 0x4A +#define HID_KEY_PAGE_UP 0x4B +#define HID_KEY_DELETE 0x4C +#define HID_KEY_END 0x4D +#define HID_KEY_PAGE_DOWN 0x4E +#define HID_KEY_ARROW_RIGHT 0x4F +#define HID_KEY_ARROW_LEFT 0x50 +#define HID_KEY_ARROW_DOWN 0x51 +#define HID_KEY_ARROW_UP 0x52 +#define HID_KEY_NUM_LOCK 0x53 +#define HID_KEY_KEYPAD_DIVIDE 0x54 +#define HID_KEY_KEYPAD_MULTIPLY 0x55 +#define HID_KEY_KEYPAD_SUBTRACT 0x56 +#define HID_KEY_KEYPAD_ADD 0x57 +#define HID_KEY_KEYPAD_ENTER 0x58 +#define HID_KEY_KEYPAD_1 0x59 +#define HID_KEY_KEYPAD_2 0x5A +#define HID_KEY_KEYPAD_3 0x5B +#define HID_KEY_KEYPAD_4 0x5C +#define HID_KEY_KEYPAD_5 0x5D +#define HID_KEY_KEYPAD_6 0x5E +#define HID_KEY_KEYPAD_7 0x5F +#define HID_KEY_KEYPAD_8 0x60 +#define HID_KEY_KEYPAD_9 0x61 +#define HID_KEY_KEYPAD_0 0x62 +#define HID_KEY_KEYPAD_DECIMAL 0x63 +#define HID_KEY_EUROPE_2 0x64 +#define HID_KEY_APPLICATION 0x65 +#define HID_KEY_POWER 0x66 +#define HID_KEY_KEYPAD_EQUAL 0x67 +#define HID_KEY_F13 0x68 +#define HID_KEY_F14 0x69 +#define HID_KEY_F15 0x6A +#define HID_KEY_F16 0x6B +#define HID_KEY_F17 0x6C +#define HID_KEY_F18 0x6D +#define HID_KEY_F19 0x6E +#define HID_KEY_F20 0x6F +#define HID_KEY_F21 0x70 +#define HID_KEY_F22 0x71 +#define HID_KEY_F23 0x72 +#define HID_KEY_F24 0x73 +#define HID_KEY_EXECUTE 0x74 +#define HID_KEY_HELP 0x75 +#define HID_KEY_MENU 0x76 +#define HID_KEY_SELECT 0x77 +#define HID_KEY_STOP 0x78 +#define HID_KEY_AGAIN 0x79 +#define HID_KEY_UNDO 0x7A +#define HID_KEY_CUT 0x7B +#define HID_KEY_COPY 0x7C +#define HID_KEY_PASTE 0x7D +#define HID_KEY_FIND 0x7E +#define HID_KEY_MUTE 0x7F +#define HID_KEY_VOLUME_UP 0x80 +#define HID_KEY_VOLUME_DOWN 0x81 +#define HID_KEY_LOCKING_CAPS_LOCK 0x82 +#define HID_KEY_LOCKING_NUM_LOCK 0x83 +#define HID_KEY_LOCKING_SCROLL_LOCK 0x84 +#define HID_KEY_KEYPAD_COMMA 0x85 +#define HID_KEY_KEYPAD_EQUAL_SIGN 0x86 +#define HID_KEY_KANJI1 0x87 +#define HID_KEY_KANJI2 0x88 +#define HID_KEY_KANJI3 0x89 +#define HID_KEY_KANJI4 0x8A +#define HID_KEY_KANJI5 0x8B +#define HID_KEY_KANJI6 0x8C +#define HID_KEY_KANJI7 0x8D +#define HID_KEY_KANJI8 0x8E +#define HID_KEY_KANJI9 0x8F +#define HID_KEY_LANG1 0x90 +#define HID_KEY_LANG2 0x91 +#define HID_KEY_LANG3 0x92 +#define HID_KEY_LANG4 0x93 +#define HID_KEY_LANG5 0x94 +#define HID_KEY_LANG6 0x95 +#define HID_KEY_LANG7 0x96 +#define HID_KEY_LANG8 0x97 +#define HID_KEY_LANG9 0x98 +#define HID_KEY_ALTERNATE_ERASE 0x99 +#define HID_KEY_SYSREQ_ATTENTION 0x9A +#define HID_KEY_CANCEL 0x9B +#define HID_KEY_CLEAR 0x9C +#define HID_KEY_PRIOR 0x9D +#define HID_KEY_RETURN 0x9E +#define HID_KEY_SEPARATOR 0x9F +#define HID_KEY_OUT 0xA0 +#define HID_KEY_OPER 0xA1 +#define HID_KEY_CLEAR_AGAIN 0xA2 +#define HID_KEY_CRSEL_PROPS 0xA3 +#define HID_KEY_EXSEL 0xA4 // RESERVED 0xA5-DF -#define HID_KEY_CONTROL_LEFT 0xE0 -#define HID_KEY_SHIFT_LEFT 0xE1 -#define HID_KEY_ALT_LEFT 0xE2 -#define HID_KEY_GUI_LEFT 0xE3 -#define HID_KEY_CONTROL_RIGHT 0xE4 -#define HID_KEY_SHIFT_RIGHT 0xE5 -#define HID_KEY_ALT_RIGHT 0xE6 -#define HID_KEY_GUI_RIGHT 0xE7 +#define HID_KEY_CONTROL_LEFT 0xE0 +#define HID_KEY_SHIFT_LEFT 0xE1 +#define HID_KEY_ALT_LEFT 0xE2 +#define HID_KEY_GUI_LEFT 0xE3 +#define HID_KEY_CONTROL_RIGHT 0xE4 +#define HID_KEY_SHIFT_RIGHT 0xE5 +#define HID_KEY_ALT_RIGHT 0xE6 +#define HID_KEY_GUI_RIGHT 0xE7 + //--------------------------------------------------------------------+ // REPORT DESCRIPTOR @@ -1254,269 +1249,267 @@ extern "C" #define HID_REPORT_DATA_3(data) , U32_TO_U8S_LE(data) #define HID_REPORT_ITEM(data, tag, type, size) \ - (((tag) << 4) | ((type) << 2) | (size)) HID_REPORT_DATA_##size(data) + (((tag) << 4) | ((type) << 2) | (size)) HID_REPORT_DATA_##size(data) -#define RI_TYPE_MAIN 0 +#define RI_TYPE_MAIN 0 #define RI_TYPE_GLOBAL 1 -#define RI_TYPE_LOCAL 2 +#define RI_TYPE_LOCAL 2 //------------- MAIN ITEMS 6.2.2.4 -------------// -#define HID_INPUT(x) HID_REPORT_ITEM(x, 8, RI_TYPE_MAIN, 1) -#define HID_OUTPUT(x) HID_REPORT_ITEM(x, 9, RI_TYPE_MAIN, 1) -#define HID_COLLECTION(x) HID_REPORT_ITEM(x, 10, RI_TYPE_MAIN, 1) -#define HID_FEATURE(x) HID_REPORT_ITEM(x, 11, RI_TYPE_MAIN, 1) -#define HID_COLLECTION_END HID_REPORT_ITEM(x, 12, RI_TYPE_MAIN, 0) +#define HID_INPUT(x) HID_REPORT_ITEM(x, 8, RI_TYPE_MAIN, 1) +#define HID_OUTPUT(x) HID_REPORT_ITEM(x, 9, RI_TYPE_MAIN, 1) +#define HID_COLLECTION(x) HID_REPORT_ITEM(x, 10, RI_TYPE_MAIN, 1) +#define HID_FEATURE(x) HID_REPORT_ITEM(x, 11, RI_TYPE_MAIN, 1) +#define HID_COLLECTION_END HID_REPORT_ITEM(x, 12, RI_TYPE_MAIN, 0) //------------- INPUT, OUTPUT, FEATURE 6.2.2.5 -------------// -#define HID_DATA (0 << 0) -#define HID_CONSTANT (1 << 0) +#define HID_DATA (0<<0) +#define HID_CONSTANT (1<<0) -#define HID_ARRAY (0 << 1) -#define HID_VARIABLE (1 << 1) +#define HID_ARRAY (0<<1) +#define HID_VARIABLE (1<<1) -#define HID_ABSOLUTE (0 << 2) -#define HID_RELATIVE (1 << 2) +#define HID_ABSOLUTE (0<<2) +#define HID_RELATIVE (1<<2) -#define HID_WRAP_NO (0 << 3) -#define HID_WRAP (1 << 3) +#define HID_WRAP_NO (0<<3) +#define HID_WRAP (1<<3) -#define HID_LINEAR (0 << 4) -#define HID_NONLINEAR (1 << 4) +#define HID_LINEAR (0<<4) +#define HID_NONLINEAR (1<<4) -#define HID_PREFERRED_STATE (0 << 5) -#define HID_PREFERRED_NO (1 << 5) +#define HID_PREFERRED_STATE (0<<5) +#define HID_PREFERRED_NO (1<<5) -#define HID_NO_NULL_POSITION (0 << 6) -#define HID_NULL_STATE (1 << 6) +#define HID_NO_NULL_POSITION (0<<6) +#define HID_NULL_STATE (1<<6) -#define HID_NON_VOLATILE (0 << 7) -#define HID_VOLATILE (1 << 7) +#define HID_NON_VOLATILE (0<<7) +#define HID_VOLATILE (1<<7) -#define HID_BITFIELD (0 << 8) -#define HID_BUFFERED_BYTES (1 << 8) +#define HID_BITFIELD (0<<8) +#define HID_BUFFERED_BYTES (1<<8) - //------------- COLLECTION ITEM 6.2.2.6 -------------// - enum - { - HID_COLLECTION_PHYSICAL = 0, - HID_COLLECTION_APPLICATION, - HID_COLLECTION_LOGICAL, - HID_COLLECTION_REPORT, - HID_COLLECTION_NAMED_ARRAY, - HID_COLLECTION_USAGE_SWITCH, - HID_COLLECTION_USAGE_MODIFIER - }; +//------------- COLLECTION ITEM 6.2.2.6 -------------// +enum { + HID_COLLECTION_PHYSICAL = 0, + HID_COLLECTION_APPLICATION, + HID_COLLECTION_LOGICAL, + HID_COLLECTION_REPORT, + HID_COLLECTION_NAMED_ARRAY, + HID_COLLECTION_USAGE_SWITCH, + HID_COLLECTION_USAGE_MODIFIER +}; //------------- GLOBAL ITEMS 6.2.2.7 -------------// -#define HID_USAGE_PAGE(x) HID_REPORT_ITEM(x, 0, RI_TYPE_GLOBAL, 1) -#define HID_USAGE_PAGE_N(x, n) HID_REPORT_ITEM(x, 0, RI_TYPE_GLOBAL, n) +#define HID_USAGE_PAGE(x) HID_REPORT_ITEM(x, 0, RI_TYPE_GLOBAL, 1) +#define HID_USAGE_PAGE_N(x, n) HID_REPORT_ITEM(x, 0, RI_TYPE_GLOBAL, n) -#define HID_LOGICAL_MIN(x) HID_REPORT_ITEM(x, 1, RI_TYPE_GLOBAL, 1) -#define HID_LOGICAL_MIN_N(x, n) HID_REPORT_ITEM(x, 1, RI_TYPE_GLOBAL, n) +#define HID_LOGICAL_MIN(x) HID_REPORT_ITEM(x, 1, RI_TYPE_GLOBAL, 1) +#define HID_LOGICAL_MIN_N(x, n) HID_REPORT_ITEM(x, 1, RI_TYPE_GLOBAL, n) -#define HID_LOGICAL_MAX(x) HID_REPORT_ITEM(x, 2, RI_TYPE_GLOBAL, 1) -#define HID_LOGICAL_MAX_N(x, n) HID_REPORT_ITEM(x, 2, RI_TYPE_GLOBAL, n) +#define HID_LOGICAL_MAX(x) HID_REPORT_ITEM(x, 2, RI_TYPE_GLOBAL, 1) +#define HID_LOGICAL_MAX_N(x, n) HID_REPORT_ITEM(x, 2, RI_TYPE_GLOBAL, n) -#define HID_PHYSICAL_MIN(x) HID_REPORT_ITEM(x, 3, RI_TYPE_GLOBAL, 1) -#define HID_PHYSICAL_MIN_N(x, n) HID_REPORT_ITEM(x, 3, RI_TYPE_GLOBAL, n) +#define HID_PHYSICAL_MIN(x) HID_REPORT_ITEM(x, 3, RI_TYPE_GLOBAL, 1) +#define HID_PHYSICAL_MIN_N(x, n) HID_REPORT_ITEM(x, 3, RI_TYPE_GLOBAL, n) -#define HID_PHYSICAL_MAX(x) HID_REPORT_ITEM(x, 4, RI_TYPE_GLOBAL, 1) -#define HID_PHYSICAL_MAX_N(x, n) HID_REPORT_ITEM(x, 4, RI_TYPE_GLOBAL, n) +#define HID_PHYSICAL_MAX(x) HID_REPORT_ITEM(x, 4, RI_TYPE_GLOBAL, 1) +#define HID_PHYSICAL_MAX_N(x, n) HID_REPORT_ITEM(x, 4, RI_TYPE_GLOBAL, n) -#define HID_UNIT_EXPONENT(x) HID_REPORT_ITEM(x, 5, RI_TYPE_GLOBAL, 1) +#define HID_UNIT_EXPONENT(x) HID_REPORT_ITEM(x, 5, RI_TYPE_GLOBAL, 1) #define HID_UNIT_EXPONENT_N(x, n) HID_REPORT_ITEM(x, 5, RI_TYPE_GLOBAL, n) -#define HID_UNIT(x) HID_REPORT_ITEM(x, 6, RI_TYPE_GLOBAL, 1) -#define HID_UNIT_N(x, n) HID_REPORT_ITEM(x, 6, RI_TYPE_GLOBAL, n) +#define HID_UNIT(x) HID_REPORT_ITEM(x, 6, RI_TYPE_GLOBAL, 1) +#define HID_UNIT_N(x, n) HID_REPORT_ITEM(x, 6, RI_TYPE_GLOBAL, n) -#define HID_REPORT_SIZE(x) HID_REPORT_ITEM(x, 7, RI_TYPE_GLOBAL, 1) -#define HID_REPORT_SIZE_N(x, n) HID_REPORT_ITEM(x, 7, RI_TYPE_GLOBAL, n) +#define HID_REPORT_SIZE(x) HID_REPORT_ITEM(x, 7, RI_TYPE_GLOBAL, 1) +#define HID_REPORT_SIZE_N(x, n) HID_REPORT_ITEM(x, 7, RI_TYPE_GLOBAL, n) -#define HID_REPORT_ID(x) HID_REPORT_ITEM(x, 8, RI_TYPE_GLOBAL, 1), -#define HID_REPORT_ID_N(x) HID_REPORT_ITEM(x, 8, RI_TYPE_GLOBAL, n), +#define HID_REPORT_ID(x) HID_REPORT_ITEM(x, 8, RI_TYPE_GLOBAL, 1), +#define HID_REPORT_ID_N(x) HID_REPORT_ITEM(x, 8, RI_TYPE_GLOBAL, n), -#define HID_REPORT_COUNT(x) HID_REPORT_ITEM(x, 9, RI_TYPE_GLOBAL, 1) -#define HID_REPORT_COUNT_N(x, n) HID_REPORT_ITEM(x, 9, RI_TYPE_GLOBAL, n) +#define HID_REPORT_COUNT(x) HID_REPORT_ITEM(x, 9, RI_TYPE_GLOBAL, 1) +#define HID_REPORT_COUNT_N(x, n) HID_REPORT_ITEM(x, 9, RI_TYPE_GLOBAL, n) -#define HID_PUSH HID_REPORT_ITEM(x, 10, RI_TYPE_GLOBAL, 0) -#define HID_POP HID_REPORT_ITEM(x, 11, RI_TYPE_GLOBAL, 0) +#define HID_PUSH HID_REPORT_ITEM(x, 10, RI_TYPE_GLOBAL, 0) +#define HID_POP HID_REPORT_ITEM(x, 11, RI_TYPE_GLOBAL, 0) //------------- LOCAL ITEMS 6.2.2.8 -------------// -#define HID_USAGE(x) HID_REPORT_ITEM(x, 0, RI_TYPE_LOCAL, 1) -#define HID_USAGE_N(x, n) HID_REPORT_ITEM(x, 0, RI_TYPE_LOCAL, n) +#define HID_USAGE(x) HID_REPORT_ITEM(x, 0, RI_TYPE_LOCAL, 1) +#define HID_USAGE_N(x, n) HID_REPORT_ITEM(x, 0, RI_TYPE_LOCAL, n) -#define HID_USAGE_MIN(x) HID_REPORT_ITEM(x, 1, RI_TYPE_LOCAL, 1) -#define HID_USAGE_MIN_N(x, n) HID_REPORT_ITEM(x, 1, RI_TYPE_LOCAL, n) +#define HID_USAGE_MIN(x) HID_REPORT_ITEM(x, 1, RI_TYPE_LOCAL, 1) +#define HID_USAGE_MIN_N(x, n) HID_REPORT_ITEM(x, 1, RI_TYPE_LOCAL, n) -#define HID_USAGE_MAX(x) HID_REPORT_ITEM(x, 2, RI_TYPE_LOCAL, 1) -#define HID_USAGE_MAX_N(x, n) HID_REPORT_ITEM(x, 2, RI_TYPE_LOCAL, n) +#define HID_USAGE_MAX(x) HID_REPORT_ITEM(x, 2, RI_TYPE_LOCAL, 1) +#define HID_USAGE_MAX_N(x, n) HID_REPORT_ITEM(x, 2, RI_TYPE_LOCAL, n) - //--------------------------------------------------------------------+ - // Usage Table - //--------------------------------------------------------------------+ +//--------------------------------------------------------------------+ +// Usage Table +//--------------------------------------------------------------------+ - /// HID Usage Table - Table 1: Usage Page Summary - enum - { - HID_USAGE_PAGE_DESKTOP = 0x01, - HID_USAGE_PAGE_SIMULATE = 0x02, - HID_USAGE_PAGE_VIRTUAL_REALITY = 0x03, - HID_USAGE_PAGE_SPORT = 0x04, - HID_USAGE_PAGE_GAME = 0x05, - HID_USAGE_PAGE_GENERIC_DEVICE = 0x06, - HID_USAGE_PAGE_KEYBOARD = 0x07, - HID_USAGE_PAGE_LED = 0x08, - HID_USAGE_PAGE_BUTTON = 0x09, - HID_USAGE_PAGE_ORDINAL = 0x0a, - HID_USAGE_PAGE_TELEPHONY = 0x0b, - HID_USAGE_PAGE_CONSUMER = 0x0c, - HID_USAGE_PAGE_DIGITIZER = 0x0d, - HID_USAGE_PAGE_PID = 0x0f, - HID_USAGE_PAGE_UNICODE = 0x10, - HID_USAGE_PAGE_ALPHA_DISPLAY = 0x14, - HID_USAGE_PAGE_MEDICAL = 0x40, - HID_USAGE_PAGE_MONITOR = 0x80, // 0x80 - 0x83 - HID_USAGE_PAGE_POWER = 0x84, // 0x084 - 0x87 - HID_USAGE_PAGE_BARCODE_SCANNER = 0x8c, - HID_USAGE_PAGE_SCALE = 0x8d, - HID_USAGE_PAGE_MSR = 0x8e, - HID_USAGE_PAGE_CAMERA = 0x90, - HID_USAGE_PAGE_ARCADE = 0x91, - HID_USAGE_PAGE_VENDOR = 0xFF00 // 0xFF00 - 0xFFFF - }; +/// HID Usage Table - Table 1: Usage Page Summary +enum { + HID_USAGE_PAGE_DESKTOP = 0x01, + HID_USAGE_PAGE_SIMULATE = 0x02, + HID_USAGE_PAGE_VIRTUAL_REALITY = 0x03, + HID_USAGE_PAGE_SPORT = 0x04, + HID_USAGE_PAGE_GAME = 0x05, + HID_USAGE_PAGE_GENERIC_DEVICE = 0x06, + HID_USAGE_PAGE_KEYBOARD = 0x07, + HID_USAGE_PAGE_LED = 0x08, + HID_USAGE_PAGE_BUTTON = 0x09, + HID_USAGE_PAGE_ORDINAL = 0x0a, + HID_USAGE_PAGE_TELEPHONY = 0x0b, + HID_USAGE_PAGE_CONSUMER = 0x0c, + HID_USAGE_PAGE_DIGITIZER = 0x0d, + HID_USAGE_PAGE_PID = 0x0f, + HID_USAGE_PAGE_UNICODE = 0x10, + HID_USAGE_PAGE_ALPHA_DISPLAY = 0x14, + HID_USAGE_PAGE_MEDICAL = 0x40, + HID_USAGE_PAGE_MONITOR = 0x80, //0x80 - 0x83 + HID_USAGE_PAGE_POWER = 0x84, // 0x084 - 0x87 + HID_USAGE_PAGE_BARCODE_SCANNER = 0x8c, + HID_USAGE_PAGE_SCALE = 0x8d, + HID_USAGE_PAGE_MSR = 0x8e, + HID_USAGE_PAGE_CAMERA = 0x90, + HID_USAGE_PAGE_ARCADE = 0x91, + HID_USAGE_PAGE_VENDOR = 0xFF00 // 0xFF00 - 0xFFFF +}; - /// HID Usage Table - Table 6: Generic Desktop Page - enum - { - HID_USAGE_DESKTOP_POINTER = 0x01, - HID_USAGE_DESKTOP_MOUSE = 0x02, - HID_USAGE_DESKTOP_JOYSTICK = 0x04, - HID_USAGE_DESKTOP_GAMEPAD = 0x05, - HID_USAGE_DESKTOP_KEYBOARD = 0x06, - HID_USAGE_DESKTOP_KEYPAD = 0x07, - HID_USAGE_DESKTOP_MULTI_AXIS_CONTROLLER = 0x08, - HID_USAGE_DESKTOP_TABLET_PC_SYSTEM = 0x09, - HID_USAGE_DESKTOP_X = 0x30, - HID_USAGE_DESKTOP_Y = 0x31, - HID_USAGE_DESKTOP_Z = 0x32, - HID_USAGE_DESKTOP_RX = 0x33, - HID_USAGE_DESKTOP_RY = 0x34, - HID_USAGE_DESKTOP_RZ = 0x35, - HID_USAGE_DESKTOP_SLIDER = 0x36, - HID_USAGE_DESKTOP_DIAL = 0x37, - HID_USAGE_DESKTOP_WHEEL = 0x38, - HID_USAGE_DESKTOP_HAT_SWITCH = 0x39, - HID_USAGE_DESKTOP_COUNTED_BUFFER = 0x3a, - HID_USAGE_DESKTOP_BYTE_COUNT = 0x3b, - HID_USAGE_DESKTOP_MOTION_WAKEUP = 0x3c, - HID_USAGE_DESKTOP_START = 0x3d, - HID_USAGE_DESKTOP_SELECT = 0x3e, - HID_USAGE_DESKTOP_VX = 0x40, - HID_USAGE_DESKTOP_VY = 0x41, - HID_USAGE_DESKTOP_VZ = 0x42, - HID_USAGE_DESKTOP_VBRX = 0x43, - HID_USAGE_DESKTOP_VBRY = 0x44, - HID_USAGE_DESKTOP_VBRZ = 0x45, - HID_USAGE_DESKTOP_VNO = 0x46, - HID_USAGE_DESKTOP_FEATURE_NOTIFICATION = 0x47, - HID_USAGE_DESKTOP_RESOLUTION_MULTIPLIER = 0x48, - HID_USAGE_DESKTOP_SYSTEM_CONTROL = 0x80, - HID_USAGE_DESKTOP_SYSTEM_POWER_DOWN = 0x81, - HID_USAGE_DESKTOP_SYSTEM_SLEEP = 0x82, - HID_USAGE_DESKTOP_SYSTEM_WAKE_UP = 0x83, - HID_USAGE_DESKTOP_SYSTEM_CONTEXT_MENU = 0x84, - HID_USAGE_DESKTOP_SYSTEM_MAIN_MENU = 0x85, - HID_USAGE_DESKTOP_SYSTEM_APP_MENU = 0x86, - HID_USAGE_DESKTOP_SYSTEM_MENU_HELP = 0x87, - HID_USAGE_DESKTOP_SYSTEM_MENU_EXIT = 0x88, - HID_USAGE_DESKTOP_SYSTEM_MENU_SELECT = 0x89, - HID_USAGE_DESKTOP_SYSTEM_MENU_RIGHT = 0x8A, - HID_USAGE_DESKTOP_SYSTEM_MENU_LEFT = 0x8B, - HID_USAGE_DESKTOP_SYSTEM_MENU_UP = 0x8C, - HID_USAGE_DESKTOP_SYSTEM_MENU_DOWN = 0x8D, - HID_USAGE_DESKTOP_SYSTEM_COLD_RESTART = 0x8E, - HID_USAGE_DESKTOP_SYSTEM_WARM_RESTART = 0x8F, - HID_USAGE_DESKTOP_DPAD_UP = 0x90, - HID_USAGE_DESKTOP_DPAD_DOWN = 0x91, - HID_USAGE_DESKTOP_DPAD_RIGHT = 0x92, - HID_USAGE_DESKTOP_DPAD_LEFT = 0x93, - HID_USAGE_DESKTOP_SYSTEM_DOCK = 0xA0, - HID_USAGE_DESKTOP_SYSTEM_UNDOCK = 0xA1, - HID_USAGE_DESKTOP_SYSTEM_SETUP = 0xA2, - HID_USAGE_DESKTOP_SYSTEM_BREAK = 0xA3, - HID_USAGE_DESKTOP_SYSTEM_DEBUGGER_BREAK = 0xA4, - HID_USAGE_DESKTOP_APPLICATION_BREAK = 0xA5, - HID_USAGE_DESKTOP_APPLICATION_DEBUGGER_BREAK = 0xA6, - HID_USAGE_DESKTOP_SYSTEM_SPEAKER_MUTE = 0xA7, - HID_USAGE_DESKTOP_SYSTEM_HIBERNATE = 0xA8, - HID_USAGE_DESKTOP_SYSTEM_DISPLAY_INVERT = 0xB0, - HID_USAGE_DESKTOP_SYSTEM_DISPLAY_INTERNAL = 0xB1, - HID_USAGE_DESKTOP_SYSTEM_DISPLAY_EXTERNAL = 0xB2, - HID_USAGE_DESKTOP_SYSTEM_DISPLAY_BOTH = 0xB3, - HID_USAGE_DESKTOP_SYSTEM_DISPLAY_DUAL = 0xB4, - HID_USAGE_DESKTOP_SYSTEM_DISPLAY_TOGGLE_INT_EXT = 0xB5, - HID_USAGE_DESKTOP_SYSTEM_DISPLAY_SWAP_PRIMARY_SECONDARY = 0xB6, - HID_USAGE_DESKTOP_SYSTEM_DISPLAY_LCD_AUTOSCALE = 0xB7 - }; +/// HID Usage Table - Table 6: Generic Desktop Page +enum { + HID_USAGE_DESKTOP_POINTER = 0x01, + HID_USAGE_DESKTOP_MOUSE = 0x02, + HID_USAGE_DESKTOP_JOYSTICK = 0x04, + HID_USAGE_DESKTOP_GAMEPAD = 0x05, + HID_USAGE_DESKTOP_KEYBOARD = 0x06, + HID_USAGE_DESKTOP_KEYPAD = 0x07, + HID_USAGE_DESKTOP_MULTI_AXIS_CONTROLLER = 0x08, + HID_USAGE_DESKTOP_TABLET_PC_SYSTEM = 0x09, + HID_USAGE_DESKTOP_X = 0x30, + HID_USAGE_DESKTOP_Y = 0x31, + HID_USAGE_DESKTOP_Z = 0x32, + HID_USAGE_DESKTOP_RX = 0x33, + HID_USAGE_DESKTOP_RY = 0x34, + HID_USAGE_DESKTOP_RZ = 0x35, + HID_USAGE_DESKTOP_SLIDER = 0x36, + HID_USAGE_DESKTOP_DIAL = 0x37, + HID_USAGE_DESKTOP_WHEEL = 0x38, + HID_USAGE_DESKTOP_HAT_SWITCH = 0x39, + HID_USAGE_DESKTOP_COUNTED_BUFFER = 0x3a, + HID_USAGE_DESKTOP_BYTE_COUNT = 0x3b, + HID_USAGE_DESKTOP_MOTION_WAKEUP = 0x3c, + HID_USAGE_DESKTOP_START = 0x3d, + HID_USAGE_DESKTOP_SELECT = 0x3e, + HID_USAGE_DESKTOP_VX = 0x40, + HID_USAGE_DESKTOP_VY = 0x41, + HID_USAGE_DESKTOP_VZ = 0x42, + HID_USAGE_DESKTOP_VBRX = 0x43, + HID_USAGE_DESKTOP_VBRY = 0x44, + HID_USAGE_DESKTOP_VBRZ = 0x45, + HID_USAGE_DESKTOP_VNO = 0x46, + HID_USAGE_DESKTOP_FEATURE_NOTIFICATION = 0x47, + HID_USAGE_DESKTOP_RESOLUTION_MULTIPLIER = 0x48, + HID_USAGE_DESKTOP_SYSTEM_CONTROL = 0x80, + HID_USAGE_DESKTOP_SYSTEM_POWER_DOWN = 0x81, + HID_USAGE_DESKTOP_SYSTEM_SLEEP = 0x82, + HID_USAGE_DESKTOP_SYSTEM_WAKE_UP = 0x83, + HID_USAGE_DESKTOP_SYSTEM_CONTEXT_MENU = 0x84, + HID_USAGE_DESKTOP_SYSTEM_MAIN_MENU = 0x85, + HID_USAGE_DESKTOP_SYSTEM_APP_MENU = 0x86, + HID_USAGE_DESKTOP_SYSTEM_MENU_HELP = 0x87, + HID_USAGE_DESKTOP_SYSTEM_MENU_EXIT = 0x88, + HID_USAGE_DESKTOP_SYSTEM_MENU_SELECT = 0x89, + HID_USAGE_DESKTOP_SYSTEM_MENU_RIGHT = 0x8A, + HID_USAGE_DESKTOP_SYSTEM_MENU_LEFT = 0x8B, + HID_USAGE_DESKTOP_SYSTEM_MENU_UP = 0x8C, + HID_USAGE_DESKTOP_SYSTEM_MENU_DOWN = 0x8D, + HID_USAGE_DESKTOP_SYSTEM_COLD_RESTART = 0x8E, + HID_USAGE_DESKTOP_SYSTEM_WARM_RESTART = 0x8F, + HID_USAGE_DESKTOP_DPAD_UP = 0x90, + HID_USAGE_DESKTOP_DPAD_DOWN = 0x91, + HID_USAGE_DESKTOP_DPAD_RIGHT = 0x92, + HID_USAGE_DESKTOP_DPAD_LEFT = 0x93, + HID_USAGE_DESKTOP_SYSTEM_DOCK = 0xA0, + HID_USAGE_DESKTOP_SYSTEM_UNDOCK = 0xA1, + HID_USAGE_DESKTOP_SYSTEM_SETUP = 0xA2, + HID_USAGE_DESKTOP_SYSTEM_BREAK = 0xA3, + HID_USAGE_DESKTOP_SYSTEM_DEBUGGER_BREAK = 0xA4, + HID_USAGE_DESKTOP_APPLICATION_BREAK = 0xA5, + HID_USAGE_DESKTOP_APPLICATION_DEBUGGER_BREAK = 0xA6, + HID_USAGE_DESKTOP_SYSTEM_SPEAKER_MUTE = 0xA7, + HID_USAGE_DESKTOP_SYSTEM_HIBERNATE = 0xA8, + HID_USAGE_DESKTOP_SYSTEM_DISPLAY_INVERT = 0xB0, + HID_USAGE_DESKTOP_SYSTEM_DISPLAY_INTERNAL = 0xB1, + HID_USAGE_DESKTOP_SYSTEM_DISPLAY_EXTERNAL = 0xB2, + HID_USAGE_DESKTOP_SYSTEM_DISPLAY_BOTH = 0xB3, + HID_USAGE_DESKTOP_SYSTEM_DISPLAY_DUAL = 0xB4, + HID_USAGE_DESKTOP_SYSTEM_DISPLAY_TOGGLE_INT_EXT = 0xB5, + HID_USAGE_DESKTOP_SYSTEM_DISPLAY_SWAP_PRIMARY_SECONDARY = 0xB6, + HID_USAGE_DESKTOP_SYSTEM_DISPLAY_LCD_AUTOSCALE = 0xB7 +}; - /// HID Usage Table: Consumer Page (0x0C) - /// Only contains controls that supported by Windows (whole list is too long) - enum - { - // Generic Control - HID_USAGE_CONSUMER_CONTROL = 0x0001, - // Power Control - HID_USAGE_CONSUMER_POWER = 0x0030, - HID_USAGE_CONSUMER_RESET = 0x0031, - HID_USAGE_CONSUMER_SLEEP = 0x0032, +/// HID Usage Table: Consumer Page (0x0C) +/// Only contains controls that supported by Windows (whole list is too long) +enum +{ + // Generic Control + HID_USAGE_CONSUMER_CONTROL = 0x0001, - // Screen Brightness - HID_USAGE_CONSUMER_BRIGHTNESS_INCREMENT = 0x006F, - HID_USAGE_CONSUMER_BRIGHTNESS_DECREMENT = 0x0070, + // Power Control + HID_USAGE_CONSUMER_POWER = 0x0030, + HID_USAGE_CONSUMER_RESET = 0x0031, + HID_USAGE_CONSUMER_SLEEP = 0x0032, - // These HID usages operate only on mobile systems (battery powered) and - // require Windows 8 (build 8302 or greater). - HID_USAGE_CONSUMER_WIRELESS_RADIO_CONTROLS = 0x000C, - HID_USAGE_CONSUMER_WIRELESS_RADIO_BUTTONS = 0x00C6, - HID_USAGE_CONSUMER_WIRELESS_RADIO_LED = 0x00C7, - HID_USAGE_CONSUMER_WIRELESS_RADIO_SLIDER_SWITCH = 0x00C8, + // Screen Brightness + HID_USAGE_CONSUMER_BRIGHTNESS_INCREMENT = 0x006F, + HID_USAGE_CONSUMER_BRIGHTNESS_DECREMENT = 0x0070, - // Media Control - HID_USAGE_CONSUMER_PLAY_PAUSE = 0x00CD, - HID_USAGE_CONSUMER_SCAN_NEXT = 0x00B5, - HID_USAGE_CONSUMER_SCAN_PREVIOUS = 0x00B6, - HID_USAGE_CONSUMER_STOP = 0x00B7, - HID_USAGE_CONSUMER_VOLUME = 0x00E0, - HID_USAGE_CONSUMER_MUTE = 0x00E2, - HID_USAGE_CONSUMER_BASS = 0x00E3, - HID_USAGE_CONSUMER_TREBLE = 0x00E4, - HID_USAGE_CONSUMER_BASS_BOOST = 0x00E5, - HID_USAGE_CONSUMER_VOLUME_INCREMENT = 0x00E9, - HID_USAGE_CONSUMER_VOLUME_DECREMENT = 0x00EA, - HID_USAGE_CONSUMER_BASS_INCREMENT = 0x0152, - HID_USAGE_CONSUMER_BASS_DECREMENT = 0x0153, - HID_USAGE_CONSUMER_TREBLE_INCREMENT = 0x0154, - HID_USAGE_CONSUMER_TREBLE_DECREMENT = 0x0155, + // These HID usages operate only on mobile systems (battery powered) and + // require Windows 8 (build 8302 or greater). + HID_USAGE_CONSUMER_WIRELESS_RADIO_CONTROLS = 0x000C, + HID_USAGE_CONSUMER_WIRELESS_RADIO_BUTTONS = 0x00C6, + HID_USAGE_CONSUMER_WIRELESS_RADIO_LED = 0x00C7, + HID_USAGE_CONSUMER_WIRELESS_RADIO_SLIDER_SWITCH = 0x00C8, - // Application Launcher - HID_USAGE_CONSUMER_AL_CONSUMER_CONTROL_CONFIGURATION = 0x0183, - HID_USAGE_CONSUMER_AL_EMAIL_READER = 0x018A, - HID_USAGE_CONSUMER_AL_CALCULATOR = 0x0192, - HID_USAGE_CONSUMER_AL_LOCAL_BROWSER = 0x0194, + // Media Control + HID_USAGE_CONSUMER_PLAY_PAUSE = 0x00CD, + HID_USAGE_CONSUMER_SCAN_NEXT = 0x00B5, + HID_USAGE_CONSUMER_SCAN_PREVIOUS = 0x00B6, + HID_USAGE_CONSUMER_STOP = 0x00B7, + HID_USAGE_CONSUMER_VOLUME = 0x00E0, + HID_USAGE_CONSUMER_MUTE = 0x00E2, + HID_USAGE_CONSUMER_BASS = 0x00E3, + HID_USAGE_CONSUMER_TREBLE = 0x00E4, + HID_USAGE_CONSUMER_BASS_BOOST = 0x00E5, + HID_USAGE_CONSUMER_VOLUME_INCREMENT = 0x00E9, + HID_USAGE_CONSUMER_VOLUME_DECREMENT = 0x00EA, + HID_USAGE_CONSUMER_BASS_INCREMENT = 0x0152, + HID_USAGE_CONSUMER_BASS_DECREMENT = 0x0153, + HID_USAGE_CONSUMER_TREBLE_INCREMENT = 0x0154, + HID_USAGE_CONSUMER_TREBLE_DECREMENT = 0x0155, - // Browser/Explorer Specific - HID_USAGE_CONSUMER_AC_SEARCH = 0x0221, - HID_USAGE_CONSUMER_AC_HOME = 0x0223, - HID_USAGE_CONSUMER_AC_BACK = 0x0224, - HID_USAGE_CONSUMER_AC_FORWARD = 0x0225, - HID_USAGE_CONSUMER_AC_STOP = 0x0226, - HID_USAGE_CONSUMER_AC_REFRESH = 0x0227, - HID_USAGE_CONSUMER_AC_BOOKMARKS = 0x022A, + // Application Launcher + HID_USAGE_CONSUMER_AL_CONSUMER_CONTROL_CONFIGURATION = 0x0183, + HID_USAGE_CONSUMER_AL_EMAIL_READER = 0x018A, + HID_USAGE_CONSUMER_AL_CALCULATOR = 0x0192, + HID_USAGE_CONSUMER_AL_LOCAL_BROWSER = 0x0194, - // Mouse Horizontal scroll - HID_USAGE_CONSUMER_AC_PAN = 0x0238, - }; + // Browser/Explorer Specific + HID_USAGE_CONSUMER_AC_SEARCH = 0x0221, + HID_USAGE_CONSUMER_AC_HOME = 0x0223, + HID_USAGE_CONSUMER_AC_BACK = 0x0224, + HID_USAGE_CONSUMER_AC_FORWARD = 0x0225, + HID_USAGE_CONSUMER_AC_STOP = 0x0226, + HID_USAGE_CONSUMER_AC_REFRESH = 0x0227, + HID_USAGE_CONSUMER_AC_BOOKMARKS = 0x022A, + + // Mouse Horizontal scroll + HID_USAGE_CONSUMER_AC_PAN = 0x0238, +}; /*-------------------------------------------------------------------- * ASCII to KEYCODE Conversion @@ -1534,140 +1527,138 @@ extern "C" * tud_hid_keyboard_report(report_id, modifier, keycode); * *--------------------------------------------------------------------*/ -#define HID_ASCII_TO_KEYCODE \ - {0, 0}, /* 0x00 Null */ \ - {0, 0}, /* 0x01 */ \ - {0, 0}, /* 0x02 */ \ - {0, 0}, /* 0x03 */ \ - {0, 0}, /* 0x04 */ \ - {0, 0}, /* 0x05 */ \ - {0, 0}, /* 0x06 */ \ - {0, 0}, /* 0x07 */ \ - {0, HID_KEY_BACKSPACE}, /* 0x08 Backspace */ \ - {0, HID_KEY_TAB}, /* 0x09 Tab */ \ - {0, HID_KEY_RETURN}, /* 0x0A Line Feed */ \ - {0, 0}, /* 0x0B */ \ - {0, 0}, /* 0x0C */ \ - {0, HID_KEY_RETURN}, /* 0x0D CR */ \ - {0, 0}, /* 0x0E */ \ - {0, 0}, /* 0x0F */ \ - {0, 0}, /* 0x10 */ \ - {0, 0}, /* 0x11 */ \ - {0, 0}, /* 0x12 */ \ - {0, 0}, /* 0x13 */ \ - {0, 0}, /* 0x14 */ \ - {0, 0}, /* 0x15 */ \ - {0, 0}, /* 0x16 */ \ - {0, 0}, /* 0x17 */ \ - {0, 0}, /* 0x18 */ \ - {0, 0}, /* 0x19 */ \ - {0, 0}, /* 0x1A */ \ - {0, HID_KEY_ESCAPE}, /* 0x1B Escape */ \ - {0, 0}, /* 0x1C */ \ - {0, 0}, /* 0x1D */ \ - {0, 0}, /* 0x1E */ \ - {0, 0}, /* 0x1F */ \ - \ - {0, HID_KEY_SPACE}, /* 0x20 */ \ - {1, HID_KEY_1}, /* 0x21 ! */ \ - {1, HID_KEY_APOSTROPHE}, /* 0x22 " */ \ - {1, HID_KEY_3}, /* 0x23 # */ \ - {1, HID_KEY_4}, /* 0x24 $ */ \ - {1, HID_KEY_5}, /* 0x25 % */ \ - {1, HID_KEY_7}, /* 0x26 & */ \ - {0, HID_KEY_APOSTROPHE}, /* 0x27 ' */ \ - {1, HID_KEY_9}, /* 0x28 ( */ \ - {1, HID_KEY_0}, /* 0x29 ) */ \ - {1, HID_KEY_8}, /* 0x2A * */ \ - {1, HID_KEY_EQUAL}, /* 0x2B + */ \ - {0, HID_KEY_COMMA}, /* 0x2C , */ \ - {0, HID_KEY_MINUS}, /* 0x2D - */ \ - {0, HID_KEY_PERIOD}, /* 0x2E . */ \ - {0, HID_KEY_SLASH}, /* 0x2F / */ \ - {0, HID_KEY_0}, /* 0x30 0 */ \ - {0, HID_KEY_1}, /* 0x31 1 */ \ - {0, HID_KEY_2}, /* 0x32 2 */ \ - {0, HID_KEY_3}, /* 0x33 3 */ \ - {0, HID_KEY_4}, /* 0x34 4 */ \ - {0, HID_KEY_5}, /* 0x35 5 */ \ - {0, HID_KEY_6}, /* 0x36 6 */ \ - {0, HID_KEY_7}, /* 0x37 7 */ \ - {0, HID_KEY_8}, /* 0x38 8 */ \ - {0, HID_KEY_9}, /* 0x39 9 */ \ - {1, HID_KEY_SEMICOLON}, /* 0x3A : */ \ - {0, HID_KEY_SEMICOLON}, /* 0x3B ; */ \ - {1, HID_KEY_COMMA}, /* 0x3C < */ \ - {0, HID_KEY_EQUAL}, /* 0x3D = */ \ - {1, HID_KEY_PERIOD}, /* 0x3E > */ \ - {1, HID_KEY_SLASH}, /* 0x3F ? */ \ - \ - {1, HID_KEY_2}, /* 0x40 @ */ \ - {1, HID_KEY_A}, /* 0x41 A */ \ - {1, HID_KEY_B}, /* 0x42 B */ \ - {1, HID_KEY_C}, /* 0x43 C */ \ - {1, HID_KEY_D}, /* 0x44 D */ \ - {1, HID_KEY_E}, /* 0x45 E */ \ - {1, HID_KEY_F}, /* 0x46 F */ \ - {1, HID_KEY_G}, /* 0x47 G */ \ - {1, HID_KEY_H}, /* 0x48 H */ \ - {1, HID_KEY_I}, /* 0x49 I */ \ - {1, HID_KEY_J}, /* 0x4A J */ \ - {1, HID_KEY_K}, /* 0x4B K */ \ - {1, HID_KEY_L}, /* 0x4C L */ \ - {1, HID_KEY_M}, /* 0x4D M */ \ - {1, HID_KEY_N}, /* 0x4E N */ \ - {1, HID_KEY_O}, /* 0x4F O */ \ - {1, HID_KEY_P}, /* 0x50 P */ \ - {1, HID_KEY_Q}, /* 0x51 Q */ \ - {1, HID_KEY_R}, /* 0x52 R */ \ - {1, HID_KEY_S}, /* 0x53 S */ \ - {1, HID_KEY_T}, /* 0x55 T */ \ - {1, HID_KEY_U}, /* 0x55 U */ \ - {1, HID_KEY_V}, /* 0x56 V */ \ - {1, HID_KEY_W}, /* 0x57 W */ \ - {1, HID_KEY_X}, /* 0x58 X */ \ - {1, HID_KEY_Y}, /* 0x59 Y */ \ - {1, HID_KEY_Z}, /* 0x5A Z */ \ - {0, HID_KEY_BRACKET_LEFT}, /* 0x5B [ */ \ - {0, HID_KEY_BACKSLASH}, /* 0x5C '\' */ \ - {0, HID_KEY_BRACKET_RIGHT}, /* 0x5D ] */ \ - {1, HID_KEY_6}, /* 0x5E ^ */ \ - {1, HID_KEY_MINUS}, /* 0x5F _ */ \ - \ - {0, HID_KEY_GRAVE}, /* 0x60 ` */ \ - {0, HID_KEY_A}, /* 0x61 a */ \ - {0, HID_KEY_B}, /* 0x62 b */ \ - {0, HID_KEY_C}, /* 0x63 c */ \ - {0, HID_KEY_D}, /* 0x66 d */ \ - {0, HID_KEY_E}, /* 0x65 e */ \ - {0, HID_KEY_F}, /* 0x66 f */ \ - {0, HID_KEY_G}, /* 0x67 g */ \ - {0, HID_KEY_H}, /* 0x68 h */ \ - {0, HID_KEY_I}, /* 0x69 i */ \ - {0, HID_KEY_J}, /* 0x6A j */ \ - {0, HID_KEY_K}, /* 0x6B k */ \ - {0, HID_KEY_L}, /* 0x6C l */ \ - {0, HID_KEY_M}, /* 0x6D m */ \ - {0, HID_KEY_N}, /* 0x6E n */ \ - {0, HID_KEY_O}, /* 0x6F o */ \ - {0, HID_KEY_P}, /* 0x70 p */ \ - {0, HID_KEY_Q}, /* 0x71 q */ \ - {0, HID_KEY_R}, /* 0x72 r */ \ - {0, HID_KEY_S}, /* 0x73 s */ \ - {0, HID_KEY_T}, /* 0x75 t */ \ - {0, HID_KEY_U}, /* 0x75 u */ \ - {0, HID_KEY_V}, /* 0x76 v */ \ - {0, HID_KEY_W}, /* 0x77 w */ \ - {0, HID_KEY_X}, /* 0x78 x */ \ - {0, HID_KEY_Y}, /* 0x79 y */ \ - {0, HID_KEY_Z}, /* 0x7A z */ \ - {1, HID_KEY_BRACKET_LEFT}, /* 0x7B { */ \ - {1, HID_KEY_BACKSLASH}, /* 0x7C | */ \ - {1, HID_KEY_BRACKET_RIGHT}, /* 0x7D } */ \ - {1, HID_KEY_GRAVE}, /* 0x7E ~ */ \ - { \ - 0, HID_KEY_DELETE \ - } /* 0x7F Delete */ +#define HID_ASCII_TO_KEYCODE \ + {0, 0 }, /* 0x00 Null */ \ + {0, 0 }, /* 0x01 */ \ + {0, 0 }, /* 0x02 */ \ + {0, 0 }, /* 0x03 */ \ + {0, 0 }, /* 0x04 */ \ + {0, 0 }, /* 0x05 */ \ + {0, 0 }, /* 0x06 */ \ + {0, 0 }, /* 0x07 */ \ + {0, HID_KEY_BACKSPACE }, /* 0x08 Backspace */ \ + {0, HID_KEY_TAB }, /* 0x09 Tab */ \ + {0, HID_KEY_RETURN }, /* 0x0A Line Feed */ \ + {0, 0 }, /* 0x0B */ \ + {0, 0 }, /* 0x0C */ \ + {0, HID_KEY_RETURN }, /* 0x0D CR */ \ + {0, 0 }, /* 0x0E */ \ + {0, 0 }, /* 0x0F */ \ + {0, 0 }, /* 0x10 */ \ + {0, 0 }, /* 0x11 */ \ + {0, 0 }, /* 0x12 */ \ + {0, 0 }, /* 0x13 */ \ + {0, 0 }, /* 0x14 */ \ + {0, 0 }, /* 0x15 */ \ + {0, 0 }, /* 0x16 */ \ + {0, 0 }, /* 0x17 */ \ + {0, 0 }, /* 0x18 */ \ + {0, 0 }, /* 0x19 */ \ + {0, 0 }, /* 0x1A */ \ + {0, HID_KEY_ESCAPE }, /* 0x1B Escape */ \ + {0, 0 }, /* 0x1C */ \ + {0, 0 }, /* 0x1D */ \ + {0, 0 }, /* 0x1E */ \ + {0, 0 }, /* 0x1F */ \ + \ + {0, HID_KEY_SPACE }, /* 0x20 */ \ + {1, HID_KEY_1 }, /* 0x21 ! */ \ + {1, HID_KEY_APOSTROPHE }, /* 0x22 " */ \ + {1, HID_KEY_3 }, /* 0x23 # */ \ + {1, HID_KEY_4 }, /* 0x24 $ */ \ + {1, HID_KEY_5 }, /* 0x25 % */ \ + {1, HID_KEY_7 }, /* 0x26 & */ \ + {0, HID_KEY_APOSTROPHE }, /* 0x27 ' */ \ + {1, HID_KEY_9 }, /* 0x28 ( */ \ + {1, HID_KEY_0 }, /* 0x29 ) */ \ + {1, HID_KEY_8 }, /* 0x2A * */ \ + {1, HID_KEY_EQUAL }, /* 0x2B + */ \ + {0, HID_KEY_COMMA }, /* 0x2C , */ \ + {0, HID_KEY_MINUS }, /* 0x2D - */ \ + {0, HID_KEY_PERIOD }, /* 0x2E . */ \ + {0, HID_KEY_SLASH }, /* 0x2F / */ \ + {0, HID_KEY_0 }, /* 0x30 0 */ \ + {0, HID_KEY_1 }, /* 0x31 1 */ \ + {0, HID_KEY_2 }, /* 0x32 2 */ \ + {0, HID_KEY_3 }, /* 0x33 3 */ \ + {0, HID_KEY_4 }, /* 0x34 4 */ \ + {0, HID_KEY_5 }, /* 0x35 5 */ \ + {0, HID_KEY_6 }, /* 0x36 6 */ \ + {0, HID_KEY_7 }, /* 0x37 7 */ \ + {0, HID_KEY_8 }, /* 0x38 8 */ \ + {0, HID_KEY_9 }, /* 0x39 9 */ \ + {1, HID_KEY_SEMICOLON }, /* 0x3A : */ \ + {0, HID_KEY_SEMICOLON }, /* 0x3B ; */ \ + {1, HID_KEY_COMMA }, /* 0x3C < */ \ + {0, HID_KEY_EQUAL }, /* 0x3D = */ \ + {1, HID_KEY_PERIOD }, /* 0x3E > */ \ + {1, HID_KEY_SLASH }, /* 0x3F ? */ \ + \ + {1, HID_KEY_2 }, /* 0x40 @ */ \ + {1, HID_KEY_A }, /* 0x41 A */ \ + {1, HID_KEY_B }, /* 0x42 B */ \ + {1, HID_KEY_C }, /* 0x43 C */ \ + {1, HID_KEY_D }, /* 0x44 D */ \ + {1, HID_KEY_E }, /* 0x45 E */ \ + {1, HID_KEY_F }, /* 0x46 F */ \ + {1, HID_KEY_G }, /* 0x47 G */ \ + {1, HID_KEY_H }, /* 0x48 H */ \ + {1, HID_KEY_I }, /* 0x49 I */ \ + {1, HID_KEY_J }, /* 0x4A J */ \ + {1, HID_KEY_K }, /* 0x4B K */ \ + {1, HID_KEY_L }, /* 0x4C L */ \ + {1, HID_KEY_M }, /* 0x4D M */ \ + {1, HID_KEY_N }, /* 0x4E N */ \ + {1, HID_KEY_O }, /* 0x4F O */ \ + {1, HID_KEY_P }, /* 0x50 P */ \ + {1, HID_KEY_Q }, /* 0x51 Q */ \ + {1, HID_KEY_R }, /* 0x52 R */ \ + {1, HID_KEY_S }, /* 0x53 S */ \ + {1, HID_KEY_T }, /* 0x55 T */ \ + {1, HID_KEY_U }, /* 0x55 U */ \ + {1, HID_KEY_V }, /* 0x56 V */ \ + {1, HID_KEY_W }, /* 0x57 W */ \ + {1, HID_KEY_X }, /* 0x58 X */ \ + {1, HID_KEY_Y }, /* 0x59 Y */ \ + {1, HID_KEY_Z }, /* 0x5A Z */ \ + {0, HID_KEY_BRACKET_LEFT }, /* 0x5B [ */ \ + {0, HID_KEY_BACKSLASH }, /* 0x5C '\' */ \ + {0, HID_KEY_BRACKET_RIGHT }, /* 0x5D ] */ \ + {1, HID_KEY_6 }, /* 0x5E ^ */ \ + {1, HID_KEY_MINUS }, /* 0x5F _ */ \ + \ + {0, HID_KEY_GRAVE }, /* 0x60 ` */ \ + {0, HID_KEY_A }, /* 0x61 a */ \ + {0, HID_KEY_B }, /* 0x62 b */ \ + {0, HID_KEY_C }, /* 0x63 c */ \ + {0, HID_KEY_D }, /* 0x66 d */ \ + {0, HID_KEY_E }, /* 0x65 e */ \ + {0, HID_KEY_F }, /* 0x66 f */ \ + {0, HID_KEY_G }, /* 0x67 g */ \ + {0, HID_KEY_H }, /* 0x68 h */ \ + {0, HID_KEY_I }, /* 0x69 i */ \ + {0, HID_KEY_J }, /* 0x6A j */ \ + {0, HID_KEY_K }, /* 0x6B k */ \ + {0, HID_KEY_L }, /* 0x6C l */ \ + {0, HID_KEY_M }, /* 0x6D m */ \ + {0, HID_KEY_N }, /* 0x6E n */ \ + {0, HID_KEY_O }, /* 0x6F o */ \ + {0, HID_KEY_P }, /* 0x70 p */ \ + {0, HID_KEY_Q }, /* 0x71 q */ \ + {0, HID_KEY_R }, /* 0x72 r */ \ + {0, HID_KEY_S }, /* 0x73 s */ \ + {0, HID_KEY_T }, /* 0x75 t */ \ + {0, HID_KEY_U }, /* 0x75 u */ \ + {0, HID_KEY_V }, /* 0x76 v */ \ + {0, HID_KEY_W }, /* 0x77 w */ \ + {0, HID_KEY_X }, /* 0x78 x */ \ + {0, HID_KEY_Y }, /* 0x79 y */ \ + {0, HID_KEY_Z }, /* 0x7A z */ \ + {1, HID_KEY_BRACKET_LEFT }, /* 0x7B { */ \ + {1, HID_KEY_BACKSLASH }, /* 0x7C | */ \ + {1, HID_KEY_BRACKET_RIGHT }, /* 0x7D } */ \ + {1, HID_KEY_GRAVE }, /* 0x7E ~ */ \ + {0, HID_KEY_DELETE } /* 0x7F Delete */ \ /*-------------------------------------------------------------------- * KEYCODE to Ascii Conversion @@ -1680,113 +1671,120 @@ extern "C" * char ch = shift ? conv_table[chr][1] : conv_table[chr][0]; * *--------------------------------------------------------------------*/ -#define HID_KEYCODE_TO_ASCII \ - {0, 0}, /* 0x00 */ \ - {0, 0}, /* 0x01 */ \ - {0, 0}, /* 0x02 */ \ - {0, 0}, /* 0x03 */ \ - {'a', 'A'}, /* 0x04 */ \ - {'b', 'B'}, /* 0x05 */ \ - {'c', 'C'}, /* 0x06 */ \ - {'d', 'D'}, /* 0x07 */ \ - {'e', 'E'}, /* 0x08 */ \ - {'f', 'F'}, /* 0x09 */ \ - {'g', 'G'}, /* 0x0a */ \ - {'h', 'H'}, /* 0x0b */ \ - {'i', 'I'}, /* 0x0c */ \ - {'j', 'J'}, /* 0x0d */ \ - {'k', 'K'}, /* 0x0e */ \ - {'l', 'L'}, /* 0x0f */ \ - {'m', 'M'}, /* 0x10 */ \ - {'n', 'N'}, /* 0x11 */ \ - {'o', 'O'}, /* 0x12 */ \ - {'p', 'P'}, /* 0x13 */ \ - {'q', 'Q'}, /* 0x14 */ \ - {'r', 'R'}, /* 0x15 */ \ - {'s', 'S'}, /* 0x16 */ \ - {'t', 'T'}, /* 0x17 */ \ - {'u', 'U'}, /* 0x18 */ \ - {'v', 'V'}, /* 0x19 */ \ - {'w', 'W'}, /* 0x1a */ \ - {'x', 'X'}, /* 0x1b */ \ - {'y', 'Y'}, /* 0x1c */ \ - {'z', 'Z'}, /* 0x1d */ \ - {'1', '!'}, /* 0x1e */ \ - {'2', '@'}, /* 0x1f */ \ - {'3', '#'}, /* 0x20 */ \ - {'4', '$'}, /* 0x21 */ \ - {'5', '%'}, /* 0x22 */ \ - {'6', '^'}, /* 0x23 */ \ - {'7', '&'}, /* 0x24 */ \ - {'8', '*'}, /* 0x25 */ \ - {'9', '('}, /* 0x26 */ \ - {'0', ')'}, /* 0x27 */ \ - {'\r', '\r'}, /* 0x28 */ \ - {'\x1b', '\x1b'}, /* 0x29 */ \ - {'\b', '\b'}, /* 0x2a */ \ - {'\t', '\t'}, /* 0x2b */ \ - {' ', ' '}, /* 0x2c */ \ - {'-', '_'}, /* 0x2d */ \ - {'=', '+'}, /* 0x2e */ \ - {'[', '{'}, /* 0x2f */ \ - {']', '}'}, /* 0x30 */ \ - {'\\', '|'}, /* 0x31 */ \ - {'#', '~'}, /* 0x32 */ \ - {';', ':'}, /* 0x33 */ \ - {'\'', '\"'}, /* 0x34 */ \ - {'`', '~'}, /* 0x35 */ \ - {',', '<'}, /* 0x36 */ \ - {'.', '>'}, /* 0x37 */ \ - {'/', '?'}, /* 0x38 */ \ - \ - {0, 0}, /* 0x39 */ \ - {0, 0}, /* 0x3a */ \ - {0, 0}, /* 0x3b */ \ - {0, 0}, /* 0x3c */ \ - {0, 0}, /* 0x3d */ \ - {0, 0}, /* 0x3e */ \ - {0, 0}, /* 0x3f */ \ - {0, 0}, /* 0x40 */ \ - {0, 0}, /* 0x41 */ \ - {0, 0}, /* 0x42 */ \ - {0, 0}, /* 0x43 */ \ - {0, 0}, /* 0x44 */ \ - {0, 0}, /* 0x45 */ \ - {0, 0}, /* 0x46 */ \ - {0, 0}, /* 0x47 */ \ - {0, 0}, /* 0x48 */ \ - {0, 0}, /* 0x49 */ \ - {0, 0}, /* 0x4a */ \ - {0, 0}, /* 0x4b */ \ - {0, 0}, /* 0x4c */ \ - {0, 0}, /* 0x4d */ \ - {0, 0}, /* 0x4e */ \ - {0, 0}, /* 0x4f */ \ - {0, 0}, /* 0x50 */ \ - {0, 0}, /* 0x51 */ \ - {0, 0}, /* 0x52 */ \ - {0, 0}, /* 0x53 */ \ - \ - {'/', '/'}, /* 0x54 */ \ - {'*', '*'}, /* 0x55 */ \ - {'-', '-'}, /* 0x56 */ \ - {'+', '+'}, /* 0x57 */ \ - {'\r', '\r'}, /* 0x58 */ \ - {'1', 0}, /* 0x59 */ \ - {'2', 0}, /* 0x5a */ \ - {'3', 0}, /* 0x5b */ \ - {'4', 0}, /* 0x5c */ \ - {'5', '5'}, /* 0x5d */ \ - {'6', 0}, /* 0x5e */ \ - {'7', 0}, /* 0x5f */ \ - {'8', 0}, /* 0x60 */ \ - {'9', 0}, /* 0x61 */ \ - {'0', 0}, /* 0x62 */ \ - {'0', 0}, /* 0x63 */ \ - {'=', '='}, /* 0x67 */ +#define HID_KEYCODE_TO_ASCII \ + {0 , 0 }, /* 0x00 */ \ + {0 , 0 }, /* 0x01 */ \ + {0 , 0 }, /* 0x02 */ \ + {0 , 0 }, /* 0x03 */ \ + {'a' , 'A' }, /* 0x04 */ \ + {'b' , 'B' }, /* 0x05 */ \ + {'c' , 'C' }, /* 0x06 */ \ + {'d' , 'D' }, /* 0x07 */ \ + {'e' , 'E' }, /* 0x08 */ \ + {'f' , 'F' }, /* 0x09 */ \ + {'g' , 'G' }, /* 0x0a */ \ + {'h' , 'H' }, /* 0x0b */ \ + {'i' , 'I' }, /* 0x0c */ \ + {'j' , 'J' }, /* 0x0d */ \ + {'k' , 'K' }, /* 0x0e */ \ + {'l' , 'L' }, /* 0x0f */ \ + {'m' , 'M' }, /* 0x10 */ \ + {'n' , 'N' }, /* 0x11 */ \ + {'o' , 'O' }, /* 0x12 */ \ + {'p' , 'P' }, /* 0x13 */ \ + {'q' , 'Q' }, /* 0x14 */ \ + {'r' , 'R' }, /* 0x15 */ \ + {'s' , 'S' }, /* 0x16 */ \ + {'t' , 'T' }, /* 0x17 */ \ + {'u' , 'U' }, /* 0x18 */ \ + {'v' , 'V' }, /* 0x19 */ \ + {'w' , 'W' }, /* 0x1a */ \ + {'x' , 'X' }, /* 0x1b */ \ + {'y' , 'Y' }, /* 0x1c */ \ + {'z' , 'Z' }, /* 0x1d */ \ + {'1' , '!' }, /* 0x1e */ \ + {'2' , '@' }, /* 0x1f */ \ + {'3' , '#' }, /* 0x20 */ \ + {'4' , '$' }, /* 0x21 */ \ + {'5' , '%' }, /* 0x22 */ \ + {'6' , '^' }, /* 0x23 */ \ + {'7' , '&' }, /* 0x24 */ \ + {'8' , '*' }, /* 0x25 */ \ + {'9' , '(' }, /* 0x26 */ \ + {'0' , ')' }, /* 0x27 */ \ + {'\r' , '\r' }, /* 0x28 */ \ + {'\x1b', '\x1b' }, /* 0x29 */ \ + {'\b' , '\b' }, /* 0x2a */ \ + {'\t' , '\t' }, /* 0x2b */ \ + {' ' , ' ' }, /* 0x2c */ \ + {'-' , '_' }, /* 0x2d */ \ + {'=' , '+' }, /* 0x2e */ \ + {'[' , '{' }, /* 0x2f */ \ + {']' , '}' }, /* 0x30 */ \ + {'\\' , '|' }, /* 0x31 */ \ + {'#' , '~' }, /* 0x32 */ \ + {';' , ':' }, /* 0x33 */ \ + {'\'' , '\"' }, /* 0x34 */ \ + {'`' , '~' }, /* 0x35 */ \ + {',' , '<' }, /* 0x36 */ \ + {'.' , '>' }, /* 0x37 */ \ + {'/' , '?' }, /* 0x38 */ \ + \ + {0 , 0 }, /* 0x39 */ \ + {0 , 0 }, /* 0x3a */ \ + {0 , 0 }, /* 0x3b */ \ + {0 , 0 }, /* 0x3c */ \ + {0 , 0 }, /* 0x3d */ \ + {0 , 0 }, /* 0x3e */ \ + {0 , 0 }, /* 0x3f */ \ + {0 , 0 }, /* 0x40 */ \ + {0 , 0 }, /* 0x41 */ \ + {0 , 0 }, /* 0x42 */ \ + {0 , 0 }, /* 0x43 */ \ + {0 , 0 }, /* 0x44 */ \ + {0 , 0 }, /* 0x45 */ \ + {0 , 0 }, /* 0x46 */ \ + {0 , 0 }, /* 0x47 */ \ + {0 , 0 }, /* 0x48 */ \ + {0 , 0 }, /* 0x49 */ \ + {0 , 0 }, /* 0x4a */ \ + {0 , 0 }, /* 0x4b */ \ + {0 , 0 }, /* 0x4c */ \ + {0 , 0 }, /* 0x4d */ \ + {0 , 0 }, /* 0x4e */ \ + {0 , 0 }, /* 0x4f */ \ + {0 , 0 }, /* 0x50 */ \ + {0 , 0 }, /* 0x51 */ \ + {0 , 0 }, /* 0x52 */ \ + {0 , 0 }, /* 0x53 */ \ + \ + {'/' , '/' }, /* 0x54 */ \ + {'*' , '*' }, /* 0x55 */ \ + {'-' , '-' }, /* 0x56 */ \ + {'+' , '+' }, /* 0x57 */ \ + {'\r' , '\r' }, /* 0x58 */ \ + {'1' , 0 }, /* 0x59 */ \ + {'2' , 0 }, /* 0x5a */ \ + {'3' , 0 }, /* 0x5b */ \ + {'4' , 0 }, /* 0x5c */ \ + {'5' , '5' }, /* 0x5d */ \ + {'6' , 0 }, /* 0x5e */ \ + {'7' , 0 }, /* 0x5f */ \ + {'8' , 0 }, /* 0x60 */ \ + {'9' , 0 }, /* 0x61 */ \ + {'0' , 0 }, /* 0x62 */ \ + {'0' , 0 }, /* 0x63 */ \ + {'=' , '=' }, /* 0x67 */ \ + #ifdef __cplusplus -} + } #endif + + + + #endif /* _TUSB_TYPES_H_ */ + + diff --git a/src/extralibs/ws2812b_dma_spi_led_driver.h b/src/extralibs/ws2812b_dma_spi_led_driver.h index 4b083e4..0c92112 100644 --- a/src/extralibs/ws2812b_dma_spi_led_driver.h +++ b/src/extralibs/ws2812b_dma_spi_led_driver.h @@ -2,28 +2,28 @@ I may write another version of this to use DMA to timer ports, but, the SPI port can be used to generate outputs very efficiently. So, for now, SPI Port. Additionally, it uses FAR less internal bus resources than to do the same thing with timers. - + **For the CH32V003 this means output will be on PORTC Pin 6** Copyright 2023 <>< Charles Lohr, under the MIT-x11 or NewBSD License, you choose! - If you are including this in main, simply - #define WS2812DMA_IMPLEMENTATION + If you are including this in main, simply + #define WS2812DMA_IMPLEMENTATION Other defines inclue: - #define WSRAW - #define WSRBG - #define WSGRB - #define WS2812B_ALLOW_INTERRUPT_NESTING + #define WSRAW + #define WSRBG + #define WSGRB + #define WS2812B_ALLOW_INTERRUPT_NESTING You will need to implement the following two functions, as callbacks from the ISR. - uint32_t WS2812BLEDCallback( int ledno ); + uint32_t WS2812BLEDCallback( int ledno ); You willalso need to call - WS2812BDMAInit(); + WS2812BDMAInit(); Then, whenyou want to update the LEDs, call: - WS2812BDMAStart( int num_leds ); + WS2812BDMAStart( int num_leds ); */ #ifndef _WS2812_LED_DRIVER_H @@ -32,11 +32,11 @@ #include // Use DMA and SPI to stream out WS2812B LED Data via the MOSI pin. -void WS2812BDMAInit(); -void WS2812BDMAStart(int leds); +void WS2812BDMAInit( ); +void WS2812BDMAStart( int leds ); // Callbacks that you must implement. -uint32_t WS2812BLEDCallback(int ledno); +uint32_t WS2812BLEDCallback( int ledno ); #ifdef WS2812DMA_IMPLEMENTATION @@ -46,241 +46,230 @@ uint32_t WS2812BLEDCallback(int ledno); #endif // Note first n LEDs of DMA Buffer are 0's as a "break" -// Need one extra LED at end to leave line high. +// Need one extra LED at end to leave line high. // This must be greater than WS2812B_RESET_PERIOD. #define WS2812B_RESET_PERIOD 2 #ifdef WSRAW -#define DMA_BUFFER_LEN (((DMALEDS) / 2) * 8) +#define DMA_BUFFER_LEN (((DMALEDS)/2)*8) #else -#define DMA_BUFFER_LEN (((DMALEDS) / 2) * 6) +#define DMA_BUFFER_LEN (((DMALEDS)/2)*6) #endif -static uint16_t WS2812dmabuff[DMA_BUFFER_LEN]; +static uint16_t WS2812dmabuff[DMA_BUFFER_LEN]; static volatile int WS2812LEDs; static volatile int WS2812LEDPlace; static volatile int WS2812BLEDInUse; // This is the code that updates a portion of the WS2812dmabuff with new data. // This effectively creates the bitstream that outputs to the LEDs. -static void WS2812FillBuffSec(uint16_t *ptr, int numhalfwords, int tce) +static void WS2812FillBuffSec( uint16_t * ptr, int numhalfwords, int tce ) { - const static uint16_t bitquartets[16] = { - 0b1000100010001000, - 0b1000100010001110, - 0b1000100011101000, - 0b1000100011101110, - 0b1000111010001000, - 0b1000111010001110, - 0b1000111011101000, - 0b1000111011101110, - 0b1110100010001000, - 0b1110100010001110, - 0b1110100011101000, - 0b1110100011101110, - 0b1110111010001000, - 0b1110111010001110, - 0b1110111011101000, - 0b1110111011101110, - }; + const static uint16_t bitquartets[16] = { + 0b1000100010001000, 0b1000100010001110, 0b1000100011101000, 0b1000100011101110, + 0b1000111010001000, 0b1000111010001110, 0b1000111011101000, 0b1000111011101110, + 0b1110100010001000, 0b1110100010001110, 0b1110100011101000, 0b1110100011101110, + 0b1110111010001000, 0b1110111010001110, 0b1110111011101000, 0b1110111011101110, }; - int i; - uint16_t *end = ptr + numhalfwords; - int ledcount = WS2812LEDs; - int place = WS2812LEDPlace; + int i; + uint16_t * end = ptr + numhalfwords; + int ledcount = WS2812LEDs; + int place = WS2812LEDPlace; #ifdef WSRAW - while (place < 0 && ptr != end) - { - uint32_t *lptr = (uint32_t *)ptr; - lptr[0] = 0; - lptr[1] = 0; - lptr[2] = 0; - lptr[3] = 0; - ptr += 8; - place++; - } + while( place < 0 && ptr != end ) + { + uint32_t * lptr = (uint32_t *)ptr; + lptr[0] = 0; + lptr[1] = 0; + lptr[2] = 0; + lptr[3] = 0; + ptr += 8; + place++; + } #else - while (place < 0 && ptr != end) - { - (*ptr++) = 0; - (*ptr++) = 0; - (*ptr++) = 0; - (*ptr++) = 0; - (*ptr++) = 0; - (*ptr++) = 0; - place++; - } + while( place < 0 && ptr != end ) + { + (*ptr++) = 0; + (*ptr++) = 0; + (*ptr++) = 0; + (*ptr++) = 0; + (*ptr++) = 0; + (*ptr++) = 0; + place++; + } #endif - while (ptr != end) - { - if (place >= ledcount) - { - // Optionally, leave line high. - while (ptr != end) - (*ptr++) = 0; // 0xffff; + while( ptr != end ) + { + if( place >= ledcount ) + { + // Optionally, leave line high. + while( ptr != end ) + (*ptr++) = 0;//0xffff; - // Only safe to do this when we're on the second leg. - if (tce) - { - if (place == ledcount) - { - // Take the DMA out of circular mode and let it expire. - DMA1_Channel3->CFGR &= ~DMA_Mode_Circular; - WS2812BLEDInUse = 0; - } - place++; - } + // Only safe to do this when we're on the second leg. + if( tce ) + { + if( place == ledcount ) + { + // Take the DMA out of circular mode and let it expire. + DMA1_Channel3->CFGR &= ~DMA_Mode_Circular; + WS2812BLEDInUse = 0; + } + place++; + } - break; - } + break; + } #ifdef WSRAW - uint32_t ledval32bit = WS2812BLEDCallback(place++); + uint32_t ledval32bit = WS2812BLEDCallback( place++ ); - ptr[6] = bitquartets[(ledval32bit >> 28) & 0xf]; - ptr[7] = bitquartets[(ledval32bit >> 24) & 0xf]; - ptr[4] = bitquartets[(ledval32bit >> 20) & 0xf]; - ptr[5] = bitquartets[(ledval32bit >> 16) & 0xf]; - ptr[2] = bitquartets[(ledval32bit >> 12) & 0xf]; - ptr[3] = bitquartets[(ledval32bit >> 8) & 0xf]; - ptr[0] = bitquartets[(ledval32bit >> 4) & 0xf]; - ptr[1] = bitquartets[(ledval32bit >> 0) & 0xf]; + ptr[6] = bitquartets[(ledval32bit>>28)&0xf]; + ptr[7] = bitquartets[(ledval32bit>>24)&0xf]; + ptr[4] = bitquartets[(ledval32bit>>20)&0xf]; + ptr[5] = bitquartets[(ledval32bit>>16)&0xf]; + ptr[2] = bitquartets[(ledval32bit>>12)&0xf]; + ptr[3] = bitquartets[(ledval32bit>>8)&0xf]; + ptr[0] = bitquartets[(ledval32bit>>4)&0xf]; + ptr[1] = bitquartets[(ledval32bit>>0)&0xf]; - ptr += 8; - i += 8; + ptr += 8; + i += 8; #else - // Use a LUT to figure out how we should set the SPI line. - uint32_t ledval24bit = WS2812BLEDCallback(place++); + // Use a LUT to figure out how we should set the SPI line. + uint32_t ledval24bit = WS2812BLEDCallback( place++ ); #ifdef WSRBG - ptr[0] = bitquartets[(ledval24bit >> 12) & 0xf]; - ptr[1] = bitquartets[(ledval24bit >> 8) & 0xf]; - ptr[2] = bitquartets[(ledval24bit >> 20) & 0xf]; - ptr[3] = bitquartets[(ledval24bit >> 16) & 0xf]; - ptr[4] = bitquartets[(ledval24bit >> 4) & 0xf]; - ptr[5] = bitquartets[(ledval24bit >> 0) & 0xf]; -#elif defined(WSGRB) - ptr[0] = bitquartets[(ledval24bit >> 12) & 0xf]; - ptr[1] = bitquartets[(ledval24bit >> 8) & 0xf]; - ptr[2] = bitquartets[(ledval24bit >> 4) & 0xf]; - ptr[3] = bitquartets[(ledval24bit >> 0) & 0xf]; - ptr[4] = bitquartets[(ledval24bit >> 20) & 0xf]; - ptr[5] = bitquartets[(ledval24bit >> 16) & 0xf]; + ptr[0] = bitquartets[(ledval24bit>>12)&0xf]; + ptr[1] = bitquartets[(ledval24bit>>8)&0xf]; + ptr[2] = bitquartets[(ledval24bit>>20)&0xf]; + ptr[3] = bitquartets[(ledval24bit>>16)&0xf]; + ptr[4] = bitquartets[(ledval24bit>>4)&0xf]; + ptr[5] = bitquartets[(ledval24bit>>0)&0xf]; +#elif defined( WSGRB ) + ptr[0] = bitquartets[(ledval24bit>>12)&0xf]; + ptr[1] = bitquartets[(ledval24bit>>8)&0xf]; + ptr[2] = bitquartets[(ledval24bit>>4)&0xf]; + ptr[3] = bitquartets[(ledval24bit>>0)&0xf]; + ptr[4] = bitquartets[(ledval24bit>>20)&0xf]; + ptr[5] = bitquartets[(ledval24bit>>16)&0xf]; #else - ptr[0] = bitquartets[(ledval24bit >> 20) & 0xf]; - ptr[1] = bitquartets[(ledval24bit >> 16) & 0xf]; - ptr[2] = bitquartets[(ledval24bit >> 12) & 0xf]; - ptr[3] = bitquartets[(ledval24bit >> 8) & 0xf]; - ptr[4] = bitquartets[(ledval24bit >> 4) & 0xf]; - ptr[5] = bitquartets[(ledval24bit >> 0) & 0xf]; + ptr[0] = bitquartets[(ledval24bit>>20)&0xf]; + ptr[1] = bitquartets[(ledval24bit>>16)&0xf]; + ptr[2] = bitquartets[(ledval24bit>>12)&0xf]; + ptr[3] = bitquartets[(ledval24bit>>8)&0xf]; + ptr[4] = bitquartets[(ledval24bit>>4)&0xf]; + ptr[5] = bitquartets[(ledval24bit>>0)&0xf]; #endif - ptr += 6; - i += 6; + ptr += 6; + i += 6; #endif - } - WS2812LEDPlace = place; + + } + WS2812LEDPlace = place; } -void DMA1_Channel3_IRQHandler(void) __attribute__((interrupt)); -void DMA1_Channel3_IRQHandler(void) +void DMA1_Channel3_IRQHandler( void ) __attribute__((interrupt)); +void DMA1_Channel3_IRQHandler( void ) { - // GPIOD->BSHR = 1; // Turn on GPIOD0 for profiling + //GPIOD->BSHR = 1; // Turn on GPIOD0 for profiling - // Backup flags. - volatile int intfr = DMA1->INTFR; - do - { - // Clear all possible flags. - DMA1->INTFCR = DMA1_IT_GL3; + // Backup flags. + volatile int intfr = DMA1->INTFR; + do + { + // Clear all possible flags. + DMA1->INTFCR = DMA1_IT_GL3; - // Strange note: These are backwards. DMA1_IT_HT3 should be HALF and - // DMA1_IT_TC3 should be COMPLETE. But for some reason, doing this causes - // LED jitter. I am henseforth flipping the order. + // Strange note: These are backwards. DMA1_IT_HT3 should be HALF and + // DMA1_IT_TC3 should be COMPLETE. But for some reason, doing this causes + // LED jitter. I am henseforth flipping the order. - if (intfr & DMA1_IT_HT3) - { - // Halfwaay (Fill in first part) - WS2812FillBuffSec(WS2812dmabuff, DMA_BUFFER_LEN / 2, 1); - } - if (intfr & DMA1_IT_TC3) - { - // Complete (Fill in second part) - WS2812FillBuffSec(WS2812dmabuff + DMA_BUFFER_LEN / 2, DMA_BUFFER_LEN / 2, 0); - } - intfr = DMA1->INTFR; - } while (intfr & DMA1_IT_GL3); + if( intfr & DMA1_IT_HT3 ) + { + // Halfwaay (Fill in first part) + WS2812FillBuffSec( WS2812dmabuff, DMA_BUFFER_LEN / 2, 1 ); + } + if( intfr & DMA1_IT_TC3 ) + { + // Complete (Fill in second part) + WS2812FillBuffSec( WS2812dmabuff + DMA_BUFFER_LEN / 2, DMA_BUFFER_LEN / 2, 0 ); + } + intfr = DMA1->INTFR; + } while( intfr & DMA1_IT_GL3 ); - // GPIOD->BSHR = 1<<16; // Turn off GPIOD0 for profiling + //GPIOD->BSHR = 1<<16; // Turn off GPIOD0 for profiling } -void WS2812BDMAStart(int leds) +void WS2812BDMAStart( int leds ) { - // Enter critical section. - __disable_irq(); - WS2812BLEDInUse = 1; - DMA1_Channel3->CFGR &= ~DMA_Mode_Circular; - DMA1_Channel3->CNTR = 0; - DMA1_Channel3->MADDR = (uint32_t)WS2812dmabuff; - WS2812LEDs = leds; - WS2812LEDPlace = -WS2812B_RESET_PERIOD; - __enable_irq(); + // Enter critical section. + __disable_irq(); + WS2812BLEDInUse = 1; + DMA1_Channel3->CFGR &= ~DMA_Mode_Circular; + DMA1_Channel3->CNTR = 0; + DMA1_Channel3->MADDR = (uint32_t)WS2812dmabuff; + WS2812LEDs = leds; + WS2812LEDPlace = -WS2812B_RESET_PERIOD; + __enable_irq(); - WS2812FillBuffSec(WS2812dmabuff, DMA_BUFFER_LEN, 0); + WS2812FillBuffSec( WS2812dmabuff, DMA_BUFFER_LEN, 0 ); - DMA1_Channel3->CNTR = DMA_BUFFER_LEN; // Number of unique uint16_t entries. - DMA1_Channel3->CFGR |= DMA_Mode_Circular; + DMA1_Channel3->CNTR = DMA_BUFFER_LEN; // Number of unique uint16_t entries. + DMA1_Channel3->CFGR |= DMA_Mode_Circular; } -void WS2812BDMAInit() +void WS2812BDMAInit( ) { - // Enable DMA + Peripherals - RCC->AHBPCENR |= RCC_AHBPeriph_DMA1; - RCC->APB2PCENR |= RCC_APB2Periph_GPIOC | RCC_APB2Periph_SPI1; + // Enable DMA + Peripherals + RCC->AHBPCENR |= RCC_AHBPeriph_DMA1; + RCC->APB2PCENR |= RCC_APB2Periph_GPIOC | RCC_APB2Periph_SPI1; - // MOSI, Configure GPIO Pin - GPIOC->CFGLR &= ~(0xf << (4 * 6)); - GPIOC->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP_AF) << (4 * 6); + // MOSI, Configure GPIO Pin + GPIOC->CFGLR &= ~(0xf<<(4*6)); + GPIOC->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP_AF)<<(4*6); - // Configure SPI - SPI1->CTLR1 = - SPI_NSS_Soft | SPI_CPHA_1Edge | SPI_CPOL_Low | SPI_DataSize_16b | - SPI_Mode_Master | SPI_Direction_1Line_Tx | - 3 << 3; // Divisior = 16 (48/16 = 3MHz) + // Configure SPI + SPI1->CTLR1 = + SPI_NSS_Soft | SPI_CPHA_1Edge | SPI_CPOL_Low | SPI_DataSize_16b | + SPI_Mode_Master | SPI_Direction_1Line_Tx | + 3<<3; // Divisior = 16 (48/16 = 3MHz) - SPI1->CTLR2 = SPI_CTLR2_TXDMAEN; - SPI1->HSCR = 1; + SPI1->CTLR2 = SPI_CTLR2_TXDMAEN; + SPI1->HSCR = 1; - SPI1->CTLR1 |= CTLR1_SPE_Set; + SPI1->CTLR1 |= CTLR1_SPE_Set; - SPI1->DATAR = 0; // Set SPI line Low. + SPI1->DATAR = 0; // Set SPI line Low. - // DMA1_Channel3 is for SPI1TX - DMA1_Channel3->PADDR = (uint32_t)&SPI1->DATAR; - DMA1_Channel3->MADDR = (uint32_t)WS2812dmabuff; - DMA1_Channel3->CNTR = 0; // sizeof( bufferset )/2; // Number of unique copies. (Don't start, yet!) - DMA1_Channel3->CFGR = - DMA_M2M_Disable | - DMA_Priority_VeryHigh | - DMA_MemoryDataSize_HalfWord | - DMA_PeripheralDataSize_HalfWord | - DMA_MemoryInc_Enable | - DMA_Mode_Normal | // OR DMA_Mode_Circular or DMA_Mode_Normal - DMA_DIR_PeripheralDST | - DMA_IT_TC | DMA_IT_HT; // Transmission Complete + Half Empty Interrupts. + //DMA1_Channel3 is for SPI1TX + DMA1_Channel3->PADDR = (uint32_t)&SPI1->DATAR; + DMA1_Channel3->MADDR = (uint32_t)WS2812dmabuff; + DMA1_Channel3->CNTR = 0;// sizeof( bufferset )/2; // Number of unique copies. (Don't start, yet!) + DMA1_Channel3->CFGR = + DMA_M2M_Disable | + DMA_Priority_VeryHigh | + DMA_MemoryDataSize_HalfWord | + DMA_PeripheralDataSize_HalfWord | + DMA_MemoryInc_Enable | + DMA_Mode_Normal | // OR DMA_Mode_Circular or DMA_Mode_Normal + DMA_DIR_PeripheralDST | + DMA_IT_TC | DMA_IT_HT; // Transmission Complete + Half Empty Interrupts. - // NVIC_SetPriority( DMA1_Channel3_IRQn, 0<<4 ); //We don't need to tweak priority. - NVIC_EnableIRQ(DMA1_Channel3_IRQn); - DMA1_Channel3->CFGR |= DMA_CFGR1_EN; +// NVIC_SetPriority( DMA1_Channel3_IRQn, 0<<4 ); //We don't need to tweak priority. + NVIC_EnableIRQ( DMA1_Channel3_IRQn ); + DMA1_Channel3->CFGR |= DMA_CFGR1_EN; #ifdef WS2812B_ALLOW_INTERRUPT_NESTING - __set_INTSYSCR(__get_INTSYSCR() | 2); // Enable interrupt nesting. - PFIC->IPRIOR[24] = 0b10000000; // Turn on preemption for DMA1Ch3 + __set_INTSYSCR( __get_INTSYSCR() | 2 ); // Enable interrupt nesting. + PFIC->IPRIOR[24] = 0b10000000; // Turn on preemption for DMA1Ch3 #endif } #endif #endif + diff --git a/src/extralibs/ws2812b_simple.h b/src/extralibs/ws2812b_simple.h index efc8c07..0e35add 100644 --- a/src/extralibs/ws2812b_simple.h +++ b/src/extralibs/ws2812b_simple.h @@ -3,10 +3,10 @@ Copyright 2023 <>< Charles Lohr, under the MIT-x11 or NewBSD License, you choose! If you are including this in main, simply - #define WS2812BSIMPLE_IMPLEMENTATION + #define WS2812BSIMPLE_IMPLEMENTATION You may also want to define - #define WS2812BSIMPLE_NO_IRQ_TWEAKING + #define WS2812BSIMPLE_NO_IRQ_TWEAKING */ @@ -15,7 +15,7 @@ #include -void WS2812BSimpleSend(GPIO_TypeDef *port, int pin, uint8_t *data, int len_in_bytes); +void WS2812BSimpleSend( GPIO_TypeDef * port, int pin, uint8_t * data, int len_in_bytes ); #ifdef WS2812BSIMPLE_IMPLEMENTATION @@ -25,58 +25,59 @@ void WS2812BSimpleSend(GPIO_TypeDef *port, int pin, uint8_t *data, int len_in_by #error WS2812B Driver Requires FUNCONF_SYSTICK_USE_HCLK #endif -void WS2812BSimpleSend(GPIO_TypeDef *port, int pin, uint8_t *data, int len_in_bytes) +void WS2812BSimpleSend( GPIO_TypeDef * port, int pin, uint8_t * data, int len_in_bytes ) { - int port_id = (((intptr_t)port - (intptr_t)GPIOA) >> 10); - RCC->APB2PCENR |= (RCC_APB2Periph_GPIOA << port_id); // Make sure port is enabled. + int port_id = (((intptr_t)port-(intptr_t)GPIOA)>>10); + RCC->APB2PCENR |= (RCC_APB2Periph_GPIOA<CFGLR = (port->CFGLR & (~(0xf << poffset))) | ((GPIO_Speed_2MHz | GPIO_CNF_OUT_PP) << (poffset)); + int poffset = (pin*4); + port->CFGLR = ( port->CFGLR & (~(0xf<BSHR = maskoff; + port->BSHR = maskoff; - uint8_t *end = data + len_in_bytes; - while (data != end) - { - uint8_t byte = *data; + uint8_t * end = data + len_in_bytes; + while( data != end ) + { + uint8_t byte = *data; - int i; - for (i = 0; i < 8; i++) - { - if (byte & 0x80) - { - // WS2812B's need AT LEAST 625ns for a logical "1" - port->BSHR = maskon; - DelaySysTick(25); - port->BSHR = maskoff; - DelaySysTick(1); - } - else - { - // WS2812B's need BETWEEN 62.5 to about 500 ns for a logical "0" + int i; + for( i = 0; i < 8; i++ ) + { + if( byte & 0x80 ) + { + // WS2812B's need AT LEAST 625ns for a logical "1" + port->BSHR = maskon; + DelaySysTick(25); + port->BSHR = maskoff; + DelaySysTick(1); + } + else + { + // WS2812B's need BETWEEN 62.5 to about 500 ns for a logical "0" #ifndef WS2812BSIMPLE_NO_IRQ_TWEAKING - __disable_irq(); + __disable_irq(); #endif - port->BSHR = maskon; - asm volatile("nop\nnop\nnop\nnop"); - port->BSHR = maskoff; + port->BSHR = maskon; + asm volatile( "nop\nnop\nnop\nnop" ); + port->BSHR = maskoff; #ifndef WS2812BSIMPLE_NO_IRQ_TWEAKING - __enable_irq(); + __enable_irq(); #endif - DelaySysTick(15); - } - byte <<= 1; - } + DelaySysTick(15); + } + byte <<= 1; + } - data++; - } + data++; + } - port->BSHR = maskoff; + port->BSHR = maskoff; } #endif #endif + diff --git a/src/misc/CH32V003xx.svd b/src/misc/CH32V003xx.svd new file mode 100644 index 0000000..11b06e1 --- /dev/null +++ b/src/misc/CH32V003xx.svd @@ -0,0 +1,9235 @@ + + + WCH Ltd. + WCH + CH32V00xxx + 1.2 + CH32V00xxx View File + + + + 8 + + 32 + + 0x20 + 0x0 + 0xFFFFFFFF + + + PWR + Power control + PWR + 0x40007000 + + 0x0 + 0x400 + registers + + + PVD + PVD through EXTI line detection + interrupt + 17 + + + AWU + AWU global + interrupt + 21 + + + + CTLR + CTLR + Power control register + (PWR_CTRL) + 0x0 + 0x20 + read-write + 0x00000000 + + + PDDS + Power Down Deep Sleep + 1 + 1 + + + PVDE + Power Voltage Detector + Enable + 4 + 1 + + + PLS + PVD Level Selection + 5 + 3 + + + + + CSR + CSR + Power control state register + (PWR_CSR) + 0x04 + 0x20 + 0x00000000 + + + PVDO + PVD Output + 2 + 1 + read-only + + + + + AWUCSR + AWUCSR + Automatic wake-up control state register + (PWR_AWUCSR) + 0x08 + 0x20 + 0x00000000 + + + AWUEN + Automatic wake-up enable + 1 + 1 + read-write + + + + + AWUWR + AWUWR + Automatic wake window comparison value register + (PWR_AWUWR) + 0x0C + 0x20 + 0x0000003F + + + AWUWR + AWU window value + 0 + 6 + read-write + + + + + AWUPSC + AWUPSC + Automatic wake-up prescaler register + (PWR_AWUPSC) + 0x10 + 0x20 + 0x00000000 + + + AWUPSC + Wake-up prescaler + 0 + 4 + read-write + + + + + + + RCC + Reset and clock control + RCC + 0x40021000 + + 0x00 + 0x400 + registers + + + RCC + Reset and clock control interrupt + 19 + + + + CTLR + CTLR + Clock control register + 0x00 + 0x20 + 0x00000083 + + + HSION + Internal High Speed clock + enable + 0 + 1 + read-write + + + HSIRDY + Internal High Speed clock ready + flag + 1 + 1 + read-only + + + HSITRIM + Internal High Speed clock + trimming + 3 + 5 + read-write + + + HSICAL + Internal High Speed clock + Calibration + 8 + 8 + read-only + + + HSEON + External High Speed clock + enable + 16 + 1 + read-write + + + HSERDY + External High Speed clock ready + flag + 17 + 1 + read-only + + + HSEBYP + External High Speed clock + Bypass + 18 + 1 + read-write + + + CSSON + Clock Security System + enable + 19 + 1 + read-write + + + PLLON + PLL enable + 24 + 1 + read-write + + + PLLRDY + PLL clock ready flag + 25 + 1 + read-only + + + + + CFGR0 + CFGR0 + Clock configuration register + (RCC_CFGR0) + 0x04 + 0x20 + 0x00000020 + + + SW + System clock Switch + 0 + 2 + read-write + + + SWS + System Clock Switch Status + 2 + 2 + read-only + + + HPRE + HB prescaler + 4 + 4 + read-write + + + ADCPRE + ADC prescaler + 11 + 5 + read-write + + + PLLSRC + PLL entry clock source + 16 + 1 + read-write + + + MCO + Microcontroller clock + output + 24 + 3 + read-write + + + + + INTR + INTR + Clock interrupt register + (RCC_INTR) + 0x08 + 0x20 + 0x00000000 + + + LSIRDYF + LSI Ready Interrupt flag + 0 + 1 + read-only + + + HSIRDYF + HSI Ready Interrupt flag + 2 + 1 + read-only + + + HSERDYF + HSE Ready Interrupt flag + 3 + 1 + read-only + + + PLLRDYF + PLL Ready Interrupt flag + 4 + 1 + read-only + + + CSSF + Clock Security System Interrupt + flag + 7 + 1 + read-only + + + LSIRDYIE + LSI Ready Interrupt Enable + 8 + 1 + read-write + + + HSIRDYIE + HSI Ready Interrupt Enable + 10 + 1 + read-write + + + HSERDYIE + HSE Ready Interrupt Enable + 11 + 1 + read-write + + + PLLRDYIE + PLL Ready Interrupt Enable + 12 + 1 + read-write + + + LSIRDYC + LSI Ready Interrupt Clear + 16 + 1 + write-only + + + HSIRDYC + HSI Ready Interrupt Clear + 18 + 1 + write-only + + + HSERDYC + HSE Ready Interrupt Clear + 19 + 1 + write-only + + + PLLRDYC + PLL Ready Interrupt Clear + 20 + 1 + write-only + + + CSSC + Clock security system interrupt + clear + 23 + 1 + write-only + + + + + APB2PRSTR + APB2PRSTR + PB2 peripheral reset register + (RCC_APB2PRSTR) + 0x0C + 0x20 + read-write + 0x00000000 + + + AFIORST + Alternate function I/O + reset + 0 + 1 + + + IOPARST + IO port A reset + 2 + 1 + + + IOPCRST + IO port C reset + 4 + 1 + + + IOPDRST + IO port D reset + 5 + 1 + + + ADC1RST + ADC 1 interface reset + 9 + 1 + + + TIM1RST + TIM1 timer reset + 11 + 1 + + + SPI1RST + SPI 1 reset + 12 + 1 + + + USART1RST + USART1 reset + 14 + 1 + + + + + APB1PRSTR + APB1PRSTR + PB1 peripheral reset register + (RCC_APB1PRSTR) + 0x10 + 0x20 + read-write + 0x00000000 + + + TIM2RST + TIM2 reset + 0 + 1 + + + WWDGRST + Window watchdog reset + 11 + 1 + + + I2C1RST + I2C1 reset + 21 + 1 + + + PWRRST + Power interface reset + 28 + 1 + + + + + AHBPCENR + AHBPCENR + HB Peripheral Clock enable register + (RCC_AHBPCENR) + 0x14 + 0x20 + read-write + 0x00000004 + + + DMA1EN + DMA clock enable + 0 + 1 + + + SRAMEN + SRAM interface clock + enable + 2 + 1 + + + + + APB2PCENR + APB2PCENR + PB2 peripheral clock enable register + (RCC_APB2PCENR) + 0x18 + 0x20 + read-write + 0x00000000 + + + AFIOEN + Alternate function I/O clock + enable + 0 + 1 + + + IOPAEN + I/O port A clock enable + 2 + 1 + + + IOPCEN + I/O port C clock enable + 4 + 1 + + + IOPDEN + I/O port D clock enable + 5 + 1 + + + ADC1EN + ADC1 interface clock + enable + 9 + 1 + + + TIM1EN + TIM1 Timer clock enable + 11 + 1 + + + SPI1EN + SPI 1 clock enable + 12 + 1 + + + USART1EN + USART1 clock enable + 14 + 1 + + + + + APB1PCENR + APB1PCENR + PB1 peripheral clock enable register + (RCC_APB1PCENR) + 0x1C + 0x20 + read-write + 0x00000000 + + + TIM2EN + Timer 2 clock enable + 0 + 1 + + + WWDGEN + Window watchdog clock + enable + 11 + 1 + + + I2C1EN + I2C 1 clock enable + 21 + 1 + + + PWREN + Power interface clock + enable + 28 + 1 + + + + + RSTSCKR + RSTSCKR + Control/status register + (RCC_RSTSCKR) + 0x24 + 0x20 + 0x0C000000 + + + LSION + Internal low speed oscillator + enable + 0 + 1 + read-write + + + LSIRDY + Internal low speed oscillator + ready + 1 + 1 + read-only + + + RMVF + Remove reset flag + 24 + 1 + read-write + + + PINRSTF + PIN reset flag + 26 + 1 + read-only + + + PORRSTF + POR/PDR reset flag + 27 + 1 + read-only + + + SFTRSTF + Software reset flag + 28 + 1 + read-only + + + IWDGRSTF + Independent watchdog reset + flag + 29 + 1 + read-only + + + WWDGRSTF + Window watchdog reset flag + 30 + 1 + read-only + + + LPWRRSTF + Low-power reset flag + 31 + 1 + read-only + + + + + + + EXTEN + Extend configuration + EXTEN + 0x40023800 + + 0x00 + 0x400 + registers + + + + EXTEN_CTR + EXTEND + Configure the extended control register + 0x00 + 0x20 + 0x00000400 + + + LKUPEN + LOCKUP_Enable + 6 + 1 + read-write + + + LKUPRST + LOCKUP RESET + 7 + 1 + read/clear + + + LDO_TRIM + LDO_TRIM + 10 + 1 + read-write + + + OPAEN + OPA Enalbe + 16 + 1 + read-write + + + OPANSEL + OPA negative end channel selection + 17 + 1 + read-write + + + OPAPSEL + OPA positive end channel selection + 18 + 1 + read-write + + + + + + + GPIOA + General purpose I/O + GPIO + 0x40010800 + + 0x0 + 0x400 + registers + + + + CFGLR + CFGLR + Port configuration register low + (GPIOn_CFGLR) + 0x0 + 0x20 + read-write + 0x44444444 + + + MODE0 + Port n.0 mode bits + 0 + 2 + + + CNF0 + Port n.0 configuration + bits + 2 + 2 + + + MODE1 + Port n.1 mode bits + 4 + 2 + + + CNF1 + Port n.1 configuration + bits + 6 + 2 + + + MODE2 + Port n.2 mode bits + 8 + 2 + + + CNF2 + Port n.2 configuration + bits + 10 + 2 + + + MODE3 + Port n.3 mode bits + 12 + 2 + + + CNF3 + Port n.3 configuration + bits + 14 + 2 + + + MODE4 + Port n.4 mode bits + 16 + 2 + + + CNF4 + Port n.4 configuration + bits + 18 + 2 + + + MODE5 + Port n.5 mode bits + 20 + 2 + + + CNF5 + Port n.5 configuration + bits + 22 + 2 + + + MODE6 + Port n.6 mode bits + 24 + 2 + + + CNF6 + Port n.6 configuration + bits + 26 + 2 + + + MODE7 + Port n.7 mode bits + 28 + 2 + + + CNF7 + Port n.7 configuration + bits + 30 + 2 + + + + + INDR + INDR + Port input data register + (GPIOn_INDR) + 0x8 + 0x20 + read-only + 0x00000000 + + + IDR0 + Port input data + 0 + 1 + + + IDR1 + Port input data + 1 + 1 + + + IDR2 + Port input data + 2 + 1 + + + IDR3 + Port input data + 3 + 1 + + + IDR4 + Port input data + 4 + 1 + + + IDR5 + Port input data + 5 + 1 + + + IDR6 + Port input data + 6 + 1 + + + IDR7 + Port input data + 7 + 1 + + + + + OUTDR + OUTDR + Port output data register + (GPIOn_OUTDR) + 0xC + 0x20 + read-write + 0x00000000 + + + ODR0 + Port output data + 0 + 1 + + + ODR1 + Port output data + 1 + 1 + + + ODR2 + Port output data + 2 + 1 + + + ODR3 + Port output data + 3 + 1 + + + ODR4 + Port output data + 4 + 1 + + + ODR5 + Port output data + 5 + 1 + + + ODR6 + Port output data + 6 + 1 + + + ODR7 + Port output data + 7 + 1 + + + + + BSHR + BSHR + Port bit set/reset register + (GPIOn_BSHR) + 0x10 + 0x20 + write-only + 0x00000000 + + + BS0 + Set bit 0 + 0 + 1 + + + BS1 + Set bit 1 + 1 + 1 + + + BS2 + Set bit 1 + 2 + 1 + + + BS3 + Set bit 3 + 3 + 1 + + + BS4 + Set bit 4 + 4 + 1 + + + BS5 + Set bit 5 + 5 + 1 + + + BS6 + Set bit 6 + 6 + 1 + + + BS7 + Set bit 7 + 7 + 1 + + + BR0 + Reset bit 0 + 16 + 1 + + + BR1 + Reset bit 1 + 17 + 1 + + + BR2 + Reset bit 2 + 18 + 1 + + + BR3 + Reset bit 3 + 19 + 1 + + + BR4 + Reset bit 4 + 20 + 1 + + + BR5 + Reset bit 5 + 21 + 1 + + + BR6 + Reset bit 6 + 22 + 1 + + + BR7 + Reset bit 7 + 23 + 1 + + + + + BCR + BCR + Port bit reset register + (GPIOn_BCR) + 0x14 + 0x20 + write-only + 0x00000000 + + + BR0 + Reset bit 0 + 0 + 1 + + + BR1 + Reset bit 1 + 1 + 1 + + + BR2 + Reset bit 1 + 2 + 1 + + + BR3 + Reset bit 3 + 3 + 1 + + + BR4 + Reset bit 4 + 4 + 1 + + + BR5 + Reset bit 5 + 5 + 1 + + + BR6 + Reset bit 6 + 6 + 1 + + + BR7 + Reset bit 7 + 7 + 1 + + + + + LCKR + LCKR + Port configuration lock + register + 0x18 + 0x20 + read-write + 0x00000000 + + + LCK0 + Port A Lock bit 0 + 0 + 1 + + + LCK1 + Port A Lock bit 1 + 1 + 1 + + + LCK2 + Port A Lock bit 2 + 2 + 1 + + + LCK3 + Port A Lock bit 3 + 3 + 1 + + + LCK4 + Port A Lock bit 4 + 4 + 1 + + + LCK5 + Port A Lock bit 5 + 5 + 1 + + + LCK6 + Port A Lock bit 6 + 6 + 1 + + + LCK7 + Port A Lock bit 7 + 7 + 1 + + + LCKK + Lock key + 8 + 1 + + + + + + + GPIOC + 0x40011000 + + + GPIOD + 0x40011400 + + + AFIO + Alternate function I/O + AFIO + 0x40010000 + + 0x0 + 0x400 + registers + + + + PCFR1 + PCFR1 + AF remap and debug I/O configuration + register (AFIO_PCFR1) + 0x4 + 0x20 + 0x00000000 + + + SPI1_RM + SPI1 remapping + 0 + 1 + read-write + + + I2C1_RM + I2C1 remapping + 1 + 1 + read-write + + + USART1_RM + USART1 remapping + 2 + 1 + read-write + + + TIM1_RM + TIM1 remapping + 6 + 2 + read-write + + + TIM2_RM + TIM2 remapping + 8 + 2 + read-write + + + PA12_RM + Port A1/Port A2 mapping on + OSCIN/OSCOUT + 15 + 1 + read-write + + + ADC1_ETRGINJ_RM + ADC 1 External trigger injected conversion remapping + 17 + 1 + read-write + + + ADC1_ETRGREG_RM + ADC 1 external trigger regular conversion remapping + 18 + 1 + read-write + + + USART1REMAP1 + USART1 remapping + 21 + 1 + read-write + + + I2C1REMAP1 + I2C1 remapping + 22 + 1 + read-write + + + TIM1_1_RM + TIM1_CH1 channel selection + 23 + 1 + read-write + + + SWCFG + Serial wire JTAG + configuration + 24 + 3 + write-only + + + + + EXTICR + EXTICR + External interrupt configuration register + (AFIO_EXTICR) + 0x08 + 0x20 + read-write + 0x00000000 + + + EXTI0 + EXTI0 configuration + 0 + 2 + + + EXTI1 + EXTI1 configuration + 2 + 2 + + + EXTI2 + EXTI2 configuration + 4 + 2 + + + EXTI3 + EXTI3 configuration + 6 + 2 + + + EXTI4 + EXTI4 configuration + 8 + 2 + + + EXTI5 + EXTI5 configuration + 10 + 2 + + + EXTI6 + EXTI6 configuration + 12 + 2 + + + EXTI7 + EXTI7 configuration + 14 + 2 + + + + + + + EXTI + EXTI + EXTI + 0x40010400 + + 0x00 + 0x400 + registers + + + EXTI7_0 + EXTI Line[7:0] interrupt + 20 + + + + INTENR + INTENR + Interrupt mask register + (EXTI_INTENR) + 0x00 + 0x20 + read-write + 0x00000000 + + + MR0 + Interrupt Mask on line 0 + 0 + 1 + + + MR1 + Interrupt Mask on line 1 + 1 + 1 + + + MR2 + Interrupt Mask on line 2 + 2 + 1 + + + MR3 + Interrupt Mask on line 3 + 3 + 1 + + + MR4 + Interrupt Mask on line 4 + 4 + 1 + + + MR5 + Interrupt Mask on line 5 + 5 + 1 + + + MR6 + Interrupt Mask on line 6 + 6 + 1 + + + MR7 + Interrupt Mask on line 7 + 7 + 1 + + + MR8 + Interrupt Mask on line 8 + 8 + 1 + + + MR9 + Interrupt Mask on line 9 + 9 + 1 + + + + + EVENR + EVENR + Event mask register (EXTI_EVENR) + 0x04 + 0x20 + read-write + 0x00000000 + + + MR0 + Event Mask on line 0 + 0 + 1 + + + MR1 + Event Mask on line 1 + 1 + 1 + + + MR2 + Event Mask on line 2 + 2 + 1 + + + MR3 + Event Mask on line 3 + 3 + 1 + + + MR4 + Event Mask on line 4 + 4 + 1 + + + MR5 + Event Mask on line 5 + 5 + 1 + + + MR6 + Event Mask on line 6 + 6 + 1 + + + MR7 + Event Mask on line 7 + 7 + 1 + + + MR8 + Event Mask on line 8 + 8 + 1 + + + MR9 + Event Mask on line 9 + 9 + 1 + + + + + RTENR + RTENR + Rising Trigger selection register + (EXTI_RTENR) + 0x08 + 0x20 + read-write + 0x00000000 + + + TR0 + Rising trigger event configuration of + line 0 + 0 + 1 + + + TR1 + Rising trigger event configuration of + line 1 + 1 + 1 + + + TR2 + Rising trigger event configuration of + line 2 + 2 + 1 + + + TR3 + Rising trigger event configuration of + line 3 + 3 + 1 + + + TR4 + Rising trigger event configuration of + line 4 + 4 + 1 + + + TR5 + Rising trigger event configuration of + line 5 + 5 + 1 + + + TR6 + Rising trigger event configuration of + line 6 + 6 + 1 + + + TR7 + Rising trigger event configuration of + line 7 + 7 + 1 + + + TR8 + Rising trigger event configuration of + line 8 + 8 + 1 + + + TR9 + Rising trigger event configuration of + line 9 + 9 + 1 + + + + + FTENR + FTENR + Falling Trigger selection register + (EXTI_FTENR) + 0xC + 0x20 + read-write + 0x00000000 + + + TR0 + Falling trigger event configuration of + line 0 + 0 + 1 + + + TR1 + Falling trigger event configuration of + line 1 + 1 + 1 + + + TR2 + Falling trigger event configuration of + line 2 + 2 + 1 + + + TR3 + Falling trigger event configuration of + line 3 + 3 + 1 + + + TR4 + Falling trigger event configuration of + line 4 + 4 + 1 + + + TR5 + Falling trigger event configuration of + line 5 + 5 + 1 + + + TR6 + Falling trigger event configuration of + line 6 + 6 + 1 + + + TR7 + Falling trigger event configuration of + line 7 + 7 + 1 + + + TR8 + Falling trigger event configuration of + line 8 + 8 + 1 + + + TR9 + Falling trigger event configuration of + line 9 + 9 + 1 + + + + + SWIEVR + SWIEVR + Software interrupt event register + (EXTI_SWIEVR) + 0x10 + 0x20 + read-write + 0x00000000 + + + SWIER0 + Software Interrupt on line + 0 + 0 + 1 + + + SWIER1 + Software Interrupt on line + 1 + 1 + 1 + + + SWIER2 + Software Interrupt on line + 2 + 2 + 1 + + + SWIER3 + Software Interrupt on line + 3 + 3 + 1 + + + SWIER4 + Software Interrupt on line + 4 + 4 + 1 + + + SWIER5 + Software Interrupt on line + 5 + 5 + 1 + + + SWIER6 + Software Interrupt on line + 6 + 6 + 1 + + + SWIER7 + Software Interrupt on line + 7 + 7 + 1 + + + SWIER8 + Software Interrupt on line + 8 + 8 + 1 + + + SWIER9 + Software Interrupt on line + 9 + 9 + 1 + + + + + INTFR + INTFR + Pending register (EXTI_INTFR) + 0x14 + 0x20 + read-write + 0x00000000 + + + IF0 + Pending bit 0 + 0 + 1 + + + IF1 + Pending bit 1 + 1 + 1 + + + IF2 + Pending bit 2 + 2 + 1 + + + IF3 + Pending bit 3 + 3 + 1 + + + IF4 + Pending bit 4 + 4 + 1 + + + IF5 + Pending bit 5 + 5 + 1 + + + IF6 + Pending bit 6 + 6 + 1 + + + IF7 + Pending bit 7 + 7 + 1 + + + IF8 + Pending bit 8 + 8 + 1 + + + IF9 + Pending bit 9 + 9 + 1 + + + + + + + DMA1 + DMA1 controller + DMA1 + 0x40020000 + + 0x0 + 0x400 + registers + + + DMA1_Channel1 + DMA1 Channel 1 global interrupt + 22 + + + DMA1_Channel2 + DMA1 Channel 2 global interrupt + 23 + + + DMA1_Channel3 + DMA1 Channel 3 global interrupt + 24 + + + DMA1_Channel4 + DMA1 Channel 4 global interrupt + 25 + + + DMA1_Channel5 + DMA1 Channel 5 global interrupt + 26 + + + DMA1_Channel6 + DMA1 Channel 6 global interrupt + 27 + + + DMA1_Channel7 + DMA1 Channel 7 global interrupt + 28 + + + + INTFR + INTFR + DMA interrupt status register + (DMA_INTFR) + 0x0 + 0x20 + read-only + 0x00000000 + + + GIF1 + Channel 1 Global interrupt + flag + 0 + 1 + + + TCIF1 + Channel 1 Transfer Complete + flag + 1 + 1 + + + HTIF1 + Channel 1 Half Transfer Complete + flag + 2 + 1 + + + TEIF1 + Channel 1 Transfer Error + flag + 3 + 1 + + + GIF2 + Channel 2 Global interrupt + flag + 4 + 1 + + + TCIF2 + Channel 2 Transfer Complete + flag + 5 + 1 + + + HTIF2 + Channel 2 Half Transfer Complete + flag + 6 + 1 + + + TEIF2 + Channel 2 Transfer Error + flag + 7 + 1 + + + GIF3 + Channel 3 Global interrupt + flag + 8 + 1 + + + TCIF3 + Channel 3 Transfer Complete + flag + 9 + 1 + + + HTIF3 + Channel 3 Half Transfer Complete + flag + 10 + 1 + + + TEIF3 + Channel 3 Transfer Error + flag + 11 + 1 + + + GIF4 + Channel 4 Global interrupt + flag + 12 + 1 + + + TCIF4 + Channel 4 Transfer Complete + flag + 13 + 1 + + + HTIF4 + Channel 4 Half Transfer Complete + flag + 14 + 1 + + + TEIF4 + Channel 4 Transfer Error + flag + 15 + 1 + + + GIF5 + Channel 5 Global interrupt + flag + 16 + 1 + + + TCIF5 + Channel 5 Transfer Complete + flag + 17 + 1 + + + HTIF5 + Channel 5 Half Transfer Complete + flag + 18 + 1 + + + TEIF5 + Channel 5 Transfer Error + flag + 19 + 1 + + + GIF6 + Channel 6 Global interrupt + flag + 20 + 1 + + + TCIF6 + Channel 6 Transfer Complete + flag + 21 + 1 + + + HTIF6 + Channel 6 Half Transfer Complete + flag + 22 + 1 + + + TEIF6 + Channel 6 Transfer Error + flag + 23 + 1 + + + GIF7 + Channel 7 Global interrupt + flag + 24 + 1 + + + TCIF7 + Channel 7 Transfer Complete + flag + 25 + 1 + + + HTIF7 + Channel 7 Half Transfer Complete + flag + 26 + 1 + + + TEIF7 + Channel 7 Transfer Error + flag + 27 + 1 + + + + + INTFCR + INTFCR + DMA interrupt flag clear register + (DMA_INTFCR) + 0x4 + 0x20 + write-only + 0x00000000 + + + CGIF1 + Channel 1 Global interrupt + clear + 0 + 1 + + + CGIF2 + Channel 2 Global interrupt + clear + 4 + 1 + + + CGIF3 + Channel 3 Global interrupt + clear + 8 + 1 + + + CGIF4 + Channel 4 Global interrupt + clear + 12 + 1 + + + CGIF5 + Channel 5 Global interrupt + clear + 16 + 1 + + + CGIF6 + Channel 6 Global interrupt + clear + 20 + 1 + + + CGIF7 + Channel 7 Global interrupt + clear + 24 + 1 + + + CTCIF1 + Channel 1 Transfer Complete + clear + 1 + 1 + + + CTCIF2 + Channel 2 Transfer Complete + clear + 5 + 1 + + + CTCIF3 + Channel 3 Transfer Complete + clear + 9 + 1 + + + CTCIF4 + Channel 4 Transfer Complete + clear + 13 + 1 + + + CTCIF5 + Channel 5 Transfer Complete + clear + 17 + 1 + + + CTCIF6 + Channel 6 Transfer Complete + clear + 21 + 1 + + + CTCIF7 + Channel 7 Transfer Complete + clear + 25 + 1 + + + CHTIF1 + Channel 1 Half Transfer + clear + 2 + 1 + + + CHTIF2 + Channel 2 Half Transfer + clear + 6 + 1 + + + CHTIF3 + Channel 3 Half Transfer + clear + 10 + 1 + + + CHTIF4 + Channel 4 Half Transfer + clear + 14 + 1 + + + CHTIF5 + Channel 5 Half Transfer + clear + 18 + 1 + + + CHTIF6 + Channel 6 Half Transfer + clear + 22 + 1 + + + CHTIF7 + Channel 7 Half Transfer + clear + 26 + 1 + + + CTEIF1 + Channel 1 Transfer Error + clear + 3 + 1 + + + CTEIF2 + Channel 2 Transfer Error + clear + 7 + 1 + + + CTEIF3 + Channel 3 Transfer Error + clear + 11 + 1 + + + CTEIF4 + Channel 4 Transfer Error + clear + 15 + 1 + + + CTEIF5 + Channel 5 Transfer Error + clear + 19 + 1 + + + CTEIF6 + Channel 6 Transfer Error + clear + 23 + 1 + + + CTEIF7 + Channel 7 Transfer Error + clear + 27 + 1 + + + + + CFGR1 + CFGR1 + DMA channel configuration register + (DMA_CFGR) + 0x8 + 0x20 + read-write + 0x00000000 + + + EN + Channel enable + 0 + 1 + + + TCIE + Transfer complete interrupt + enable + 1 + 1 + + + HTIE + Half Transfer interrupt + enable + 2 + 1 + + + TEIE + Transfer error interrupt + enable + 3 + 1 + + + DIR + Data transfer direction + 4 + 1 + + + CIRC + Circular mode + 5 + 1 + + + PINC + Peripheral increment mode + 6 + 1 + + + MINC + Memory increment mode + 7 + 1 + + + PSIZE + Peripheral size + 8 + 2 + + + MSIZE + Memory size + 10 + 2 + + + PL + Channel Priority level + 12 + 2 + + + MEM2MEM + Memory to memory mode + 14 + 1 + + + + + CNTR1 + CNTR1 + DMA channel 1 number of data + register + 0xC + 0x20 + read-write + 0x00000000 + + + NDT + Number of data to transfer + 0 + 16 + + + + + PADDR1 + PADDR1 + DMA channel 1 peripheral address + register + 0x10 + 0x20 + read-write + 0x00000000 + + + PA + Peripheral address + 0 + 32 + + + + + MADDR1 + MADDR1 + DMA channel 1 memory address + register + 0x14 + 0x20 + read-write + 0x00000000 + + + MA + Memory address + 0 + 32 + + + + + CFGR2 + CFGR2 + DMA channel configuration register + (DMA_CFGR) + 0x1C + 0x20 + read-write + 0x00000000 + + + EN + Channel enable + 0 + 1 + + + TCIE + Transfer complete interrupt + enable + 1 + 1 + + + HTIE + Half Transfer interrupt + enable + 2 + 1 + + + TEIE + Transfer error interrupt + enable + 3 + 1 + + + DIR + Data transfer direction + 4 + 1 + + + CIRC + Circular mode + 5 + 1 + + + PINC + Peripheral increment mode + 6 + 1 + + + MINC + Memory increment mode + 7 + 1 + + + PSIZE + Peripheral size + 8 + 2 + + + MSIZE + Memory size + 10 + 2 + + + PL + Channel Priority level + 12 + 2 + + + MEM2MEM + Memory to memory mode + 14 + 1 + + + + + CNTR2 + CNTR2 + DMA channel 2 number of data + register + 0x20 + 0x20 + read-write + 0x00000000 + + + NDT + Number of data to transfer + 0 + 16 + + + + + PADDR2 + PADDR2 + DMA channel 2 peripheral address + register + 0x24 + 0x20 + read-write + 0x00000000 + + + PA + Peripheral address + 0 + 32 + + + + + MADDR2 + MADDR2 + DMA channel 2 memory address + register + 0x28 + 0x20 + read-write + 0x00000000 + + + MA + Memory address + 0 + 32 + + + + + CFGR3 + CFGR3 + DMA channel configuration register + (DMA_CFGR) + 0x30 + 0x20 + read-write + 0x00000000 + + + EN + Channel enable + 0 + 1 + + + TCIE + Transfer complete interrupt + enable + 1 + 1 + + + HTIE + Half Transfer interrupt + enable + 2 + 1 + + + TEIE + Transfer error interrupt + enable + 3 + 1 + + + DIR + Data transfer direction + 4 + 1 + + + CIRC + Circular mode + 5 + 1 + + + PINC + Peripheral increment mode + 6 + 1 + + + MINC + Memory increment mode + 7 + 1 + + + PSIZE + Peripheral size + 8 + 2 + + + MSIZE + Memory size + 10 + 2 + + + PL + Channel Priority level + 12 + 2 + + + MEM2MEM + Memory to memory mode + 14 + 1 + + + + + CNTR3 + CNTR3 + DMA channel 3 number of data + register + 0x34 + 0x20 + read-write + 0x00000000 + + + NDT + Number of data to transfer + 0 + 16 + + + + + PADDR3 + PADDR3 + DMA channel 3 peripheral address + register + 0x38 + 0x20 + read-write + 0x00000000 + + + PA + Peripheral address + 0 + 32 + + + + + MADDR3 + MADDR3 + DMA channel 3 memory address + register + 0x3C + 0x20 + read-write + 0x00000000 + + + MA + Memory address + 0 + 32 + + + + + CFGR4 + CFGR4 + DMA channel configuration register + (DMA_CFGR) + 0x44 + 0x20 + read-write + 0x00000000 + + + EN + Channel enable + 0 + 1 + + + TCIE + Transfer complete interrupt + enable + 1 + 1 + + + HTIE + Half Transfer interrupt + enable + 2 + 1 + + + TEIE + Transfer error interrupt + enable + 3 + 1 + + + DIR + Data transfer direction + 4 + 1 + + + CIRC + Circular mode + 5 + 1 + + + PINC + Peripheral increment mode + 6 + 1 + + + MINC + Memory increment mode + 7 + 1 + + + PSIZE + Peripheral size + 8 + 2 + + + MSIZE + Memory size + 10 + 2 + + + PL + Channel Priority level + 12 + 2 + + + MEM2MEM + Memory to memory mode + 14 + 1 + + + + + CNTR4 + CNTR4 + DMA channel 4 number of data + register + 0x48 + 0x20 + read-write + 0x00000000 + + + NDT + Number of data to transfer + 0 + 16 + + + + + PADDR4 + PADDR4 + DMA channel 4 peripheral address + register + 0x4C + 0x20 + read-write + 0x00000000 + + + PA + Peripheral address + 0 + 32 + + + + + MADDR4 + MADDR4 + DMA channel 4 memory address + register + 0x50 + 0x20 + read-write + 0x00000000 + + + MA + Memory address + 0 + 32 + + + + + CFGR5 + CFGR5 + DMA channel configuration register + (DMA_CFGR) + 0x58 + 0x20 + read-write + 0x00000000 + + + EN + Channel enable + 0 + 1 + + + TCIE + Transfer complete interrupt + enable + 1 + 1 + + + HTIE + Half Transfer interrupt + enable + 2 + 1 + + + TEIE + Transfer error interrupt + enable + 3 + 1 + + + DIR + Data transfer direction + 4 + 1 + + + CIRC + Circular mode + 5 + 1 + + + PINC + Peripheral increment mode + 6 + 1 + + + MINC + Memory increment mode + 7 + 1 + + + PSIZE + Peripheral size + 8 + 2 + + + MSIZE + Memory size + 10 + 2 + + + PL + Channel Priority level + 12 + 2 + + + MEM2MEM + Memory to memory mode + 14 + 1 + + + + + CNTR5 + CNTR5 + DMA channel 5 number of data + register + 0x5C + 0x20 + read-write + 0x00000000 + + + NDT + Number of data to transfer + 0 + 16 + + + + + PADDR5 + PADDR5 + DMA channel 5 peripheral address + register + 0x60 + 0x20 + read-write + 0x00000000 + + + PA + Peripheral address + 0 + 32 + + + + + MADDR5 + MADDR5 + DMA channel 5 memory address + register + 0x64 + 0x20 + read-write + 0x00000000 + + + MA + Memory address + 0 + 32 + + + + + CFGR6 + CFGR6 + DMA channel configuration register + (DMA_CFGR) + 0x6C + 0x20 + read-write + 0x00000000 + + + EN + Channel enable + 0 + 1 + + + TCIE + Transfer complete interrupt + enable + 1 + 1 + + + HTIE + Half Transfer interrupt + enable + 2 + 1 + + + TEIE + Transfer error interrupt + enable + 3 + 1 + + + DIR + Data transfer direction + 4 + 1 + + + CIRC + Circular mode + 5 + 1 + + + PINC + Peripheral increment mode + 6 + 1 + + + MINC + Memory increment mode + 7 + 1 + + + PSIZE + Peripheral size + 8 + 2 + + + MSIZE + Memory size + 10 + 2 + + + PL + Channel Priority level + 12 + 2 + + + MEM2MEM + Memory to memory mode + 14 + 1 + + + + + CNTR6 + CNTR6 + DMA channel 6 number of data + register + 0x70 + 0x20 + read-write + 0x00000000 + + + NDT + Number of data to transfer + 0 + 16 + + + + + PADDR6 + PADDR6 + DMA channel 6 peripheral address + register + 0x74 + 0x20 + read-write + 0x00000000 + + + PA + Peripheral address + 0 + 32 + + + + + MADDR6 + MADDR6 + DMA channel 6 memory address + register + 0x78 + 0x20 + read-write + 0x00000000 + + + MA + Memory address + 0 + 32 + + + + + CFGR7 + CFGR7 + DMA channel configuration register + (DMA_CFGR) + 0x80 + 0x20 + read-write + 0x00000000 + + + EN + Channel enable + 0 + 1 + + + TCIE + Transfer complete interrupt + enable + 1 + 1 + + + HTIE + Half Transfer interrupt + enable + 2 + 1 + + + TEIE + Transfer error interrupt + enable + 3 + 1 + + + DIR + Data transfer direction + 4 + 1 + + + CIRC + Circular mode + 5 + 1 + + + PINC + Peripheral increment mode + 6 + 1 + + + MINC + Memory increment mode + 7 + 1 + + + PSIZE + Peripheral size + 8 + 2 + + + MSIZE + Memory size + 10 + 2 + + + PL + Channel Priority level + 12 + 2 + + + MEM2MEM + Memory to memory mode + 14 + 1 + + + + + CNTR7 + CNTR7 + DMA channel 7 number of data + register + 0x84 + 0x20 + read-write + 0x00000000 + + + NDT + Number of data to transfer + 0 + 16 + + + + + PADDR7 + PADDR7 + DMA channel 7 peripheral address + register + 0x88 + 0x20 + read-write + 0x00000000 + + + PA + Peripheral address + 0 + 32 + + + + + MADDR7 + MADDR7 + DMA channel 7 memory address + register + 0x8C + 0x20 + read-write + 0x00000000 + + + MA + Memory address + 0 + 32 + + + + + + + IWDG + Independent watchdog + IWDG + 0x40003000 + + 0x0 + 0x400 + registers + + + + CTLR + CTLR + Key register (IWDG_CTLR) + 0x0 + 0x20 + write-only + 0x0000 + + + KEY + Key value + 0 + 16 + write-only + + + + + PSCR + PSCR + Prescaler register (IWDG_PSCR) + 0x4 + 0x20 + read-write + 0x0000 + + + PR + Prescaler divider + 0 + 3 + read-write + + + + + RLDR + RLDR + Reload register (IWDG_RLDR) + 0x8 + 0x20 + read-write + 0x0FFF + + + RL + Watchdog counter reload + value + 0 + 12 + read-write + + + + + STATR + STATR + Status register (IWDG_SR) + 0xC + 0x20 + read-only + 0x0000 + + + PVU + Watchdog prescaler value + update + 0 + 1 + read-only + + + RVU + Watchdog counter reload value + update + 1 + 1 + read-only + + + + + + + WWDG + Window watchdog + WWDG + 0x40002C00 + + 0x0 + 0x400 + registers + + + WWDG + Window Watchdog interrupt + 16 + + + + CTLR + CTLR + Control register (WWDG_CR) + 0x0 + 0x20 + read-write + 0x007F + + + T + 7-bit counter (MSB to LSB) + 0 + 7 + read-write + + + WDGA + Activation bit + 7 + 1 + read-write + + + + + CFGR + CFGR + Configuration register + (WWDG_CFR) + 0x4 + 0x20 + read-write + 0x007F + + + W + 7-bit window value + 0 + 7 + read-write + + + WDGTB + Timer Base + 7 + 2 + read-write + + + EWI + Early Wakeup Interrupt + 9 + 1 + read-write + + + + + STATR + STATR + Status register (WWDG_SR) + 0x8 + 0x20 + read-write + 0x0000 + + + EWIF + Early Wakeup Interrupt Flag + 0 + 1 + read-write + + + + + + + TIM1 + Advanced timer + TIM + 0x40012C00 + + 0x0 + 0x400 + registers + + + TIM1BRK + TIM1 Break + interrupt + 34 + + + TIM1UP + TIM1 Update + interrupt + 35 + + + TIM1RG + TIM1 Trigger and Commutation interrupts + 36 + + + TIM1CC + TIM1 Capture Compare interrupt + 37 + + + + CTLR1 + CTLR1 + control register 1 + 0x0 + 0x20 + read-write + 0x0000 + + + CAPLVL + Timer capture level indication + enable + 15 + 1 + + + CAPOV + Timer capture value configuration + enable + 14 + 1 + + + CKD + Clock division + 8 + 2 + + + ARPE + Auto-reload preload enable + 7 + 1 + + + CMS + Center-aligned mode + selection + 5 + 2 + + + DIR + Direction + 4 + 1 + + + OPM + One-pulse mode + 3 + 1 + + + URS + Update request source + 2 + 1 + + + UDIS + Update disable + 1 + 1 + + + CEN + Counter enable + 0 + 1 + + + + + CTLR2 + CTLR2 + control register 2 + 0x4 + 0x20 + read-write + 0x0000 + + + OIS4 + Output Idle state 4 + 14 + 1 + + + OIS3N + Output Idle state 3 + 13 + 1 + + + OIS3 + Output Idle state 3 + 12 + 1 + + + OIS2N + Output Idle state 2 + 11 + 1 + + + OIS2 + Output Idle state 2 + 10 + 1 + + + OIS1N + Output Idle state 1 + 9 + 1 + + + OIS1 + Output Idle state 1 + 8 + 1 + + + TI1S + TI1 selection + 7 + 1 + + + MMS + Master mode selection + 4 + 3 + + + CCDS + Capture/compare DMA + selection + 3 + 1 + + + CCUS + Capture/compare control update + selection + 2 + 1 + + + CCPC + Capture/compare preloaded + control + 0 + 1 + + + + + SMCFGR + SMCFGR + slave mode control register + 0x8 + 0x20 + 0x0000 + + + ETP + External trigger polarity + 15 + 1 + read-only + + + ECE + External clock enable + 14 + 1 + read-write + + + ETPS + External trigger prescaler + 12 + 2 + read-write + + + ETF + External trigger filter + 8 + 4 + read-write + + + MSM + Master/Slave mode + 7 + 1 + read-write + + + TS + Trigger selection + 4 + 3 + read-write + + + SMS + Slave mode selection + 0 + 3 + read-write + + + + + DMAINTENR + DMAINTENR + DMA/Interrupt enable register + 0xC + 0x20 + read-write + 0x0000 + + + TDE + Trigger DMA request enable + 14 + 1 + + + COMDE + COM DMA request enable + 13 + 1 + + + CC4DE + Capture/Compare 4 DMA request + enable + 12 + 1 + + + CC3DE + Capture/Compare 3 DMA request + enable + 11 + 1 + + + CC2DE + Capture/Compare 2 DMA request + enable + 10 + 1 + + + CC1DE + Capture/Compare 1 DMA request + enable + 9 + 1 + + + UDE + Update DMA request enable + 8 + 1 + + + BIE + Break interrupt enable + 7 + 1 + + + TIE + Trigger interrupt enable + 6 + 1 + + + COMIE + COM interrupt enable + 5 + 1 + + + CC4IE + Capture/Compare 4 interrupt + enable + 4 + 1 + + + CC3IE + Capture/Compare 3 interrupt + enable + 3 + 1 + + + CC2IE + Capture/Compare 2 interrupt + enable + 2 + 1 + + + CC1IE + Capture/Compare 1 interrupt + enable + 1 + 1 + + + UIE + Update interrupt enable + 0 + 1 + + + + + INTFR + INTFR + status register + 0x10 + 0x20 + read-write + 0x0000 + + + CC4OF + Capture/Compare 4 overcapture + flag + 12 + 1 + + + CC3OF + Capture/Compare 3 overcapture + flag + 11 + 1 + + + CC2OF + Capture/compare 2 overcapture + flag + 10 + 1 + + + CC1OF + Capture/Compare 1 overcapture + flag + 9 + 1 + + + BIF + Break interrupt flag + 7 + 1 + + + TIF + Trigger interrupt flag + 6 + 1 + + + COMIF + COM interrupt flag + 5 + 1 + + + CC4IF + Capture/Compare 4 interrupt + flag + 4 + 1 + + + CC3IF + Capture/Compare 3 interrupt + flag + 3 + 1 + + + CC2IF + Capture/Compare 2 interrupt + flag + 2 + 1 + + + CC1IF + Capture/compare 1 interrupt + flag + 1 + 1 + + + UIF + Update interrupt flag + 0 + 1 + + + + + SWEVGR + SWEVGR + event generation register + 0x14 + 0x20 + write-only + 0x0000 + + + BG + Break generation + 7 + 1 + + + TG + Trigger generation + 6 + 1 + + + COMG + Capture/Compare control update + generation + 5 + 1 + + + CC4G + Capture/compare 4 + generation + 4 + 1 + + + CC3G + Capture/compare 3 + generation + 3 + 1 + + + CC2G + Capture/compare 2 + generation + 2 + 1 + + + CC1G + Capture/compare 1 + generation + 1 + 1 + + + UG + Update generation + 0 + 1 + + + + + CHCTLR1_Output + CHCTLR1_Output + capture/compare mode register (output + mode) + 0x18 + 0x20 + read-write + 0x0000 + + + OC2CE + Output Compare 2 clear + enable + 15 + 1 + + + OC2M + Output Compare 2 mode + 12 + 3 + + + OC2PE + Output Compare 2 preload + enable + 11 + 1 + + + OC2FE + Output Compare 2 fast + enable + 10 + 1 + + + CC2S + Capture/Compare 2 + selection + 8 + 2 + + + OC1CE + Output Compare 1 clear + enable + 7 + 1 + + + OC1M + Output Compare 1 mode + 4 + 3 + + + OC1PE + Output Compare 1 preload + enable + 3 + 1 + + + OC1FE + Output Compare 1 fast + enable + 2 + 1 + + + CC1S + Capture/Compare 1 + selection + 0 + 2 + + + + + CHCTLR1_Input + CHCTLR1_Input + capture/compare mode register 1 (input + mode) + CHCTLR1_Output + 0x18 + 0x20 + read-write + 0x0000 + + + IC2F + Input capture 2 filter + 12 + 4 + + + IC2PCS + Input capture 2 prescaler + 10 + 2 + + + CC2S + Capture/Compare 2 + selection + 8 + 2 + + + IC1F + Input capture 1 filter + 4 + 4 + + + IC1PSC + Input capture 1 prescaler + 2 + 2 + + + CC1S + Capture/Compare 1 + selection + 0 + 2 + + + + + CHCTLR2_Output + CHCTLR2_Output + capture/compare mode register (output + mode) + 0x1C + 0x20 + read-write + 0x0000 + + + OC4CE + Output compare 4 clear + enable + 15 + 1 + + + OC4M + Output compare 4 mode + 12 + 3 + + + OC4PE + Output compare 4 preload + enable + 11 + 1 + + + OC4FE + Output compare 4 fast + enable + 10 + 1 + + + CC4S + Capture/Compare 4 + selection + 8 + 2 + + + OC3CE + Output compare 3 clear + enable + 7 + 1 + + + OC3M + Output compare 3 mode + 4 + 3 + + + OC3PE + Output compare 3 preload + enable + 3 + 1 + + + OC3FE + Output compare 3 fast + enable + 2 + 1 + + + CC3S + Capture/Compare 3 + selection + 0 + 2 + + + + + CHCTLR2_Input + CHCTLR2_Input + capture/compare mode register 2 (input + mode) + CHCTLR2_Output + 0x1C + 0x20 + read-write + 0x0000 + + + IC4F + Input capture 4 filter + 12 + 4 + + + IC4PSC + Input capture 4 prescaler + 10 + 2 + + + CC4S + Capture/Compare 4 + selection + 8 + 2 + + + IC3F + Input capture 3 filter + 4 + 4 + + + IC3PSC + Input capture 3 prescaler + 2 + 2 + + + CC3S + Capture/compare 3 + selection + 0 + 2 + + + + + CCER + CCER + capture/compare enable + register + 0x20 + 0x20 + read-write + 0x0000 + + + CC4P + Capture/Compare 3 output + Polarity + 13 + 1 + + + CC4E + Capture/Compare 4 output + enable + 12 + 1 + + + CC3NP + Capture/Compare 3 output + Polarity + 11 + 1 + + + CC3NE + Capture/Compare 3 complementary output + enable + 10 + 1 + + + CC3P + Capture/Compare 3 output + Polarity + 9 + 1 + + + CC3E + Capture/Compare 3 output + enable + 8 + 1 + + + CC2NP + Capture/Compare 2 output + Polarity + 7 + 1 + + + CC2NE + Capture/Compare 2 complementary output + enable + 6 + 1 + + + CC2P + Capture/Compare 2 output + Polarity + 5 + 1 + + + CC2E + Capture/Compare 2 output + enable + 4 + 1 + + + CC1NP + Capture/Compare 1 output + Polarity + 3 + 1 + + + CC1NE + Capture/Compare 1 complementary output + enable + 2 + 1 + + + CC1P + Capture/Compare 1 output + Polarity + 1 + 1 + + + CC1E + Capture/Compare 1 output + enable + 0 + 1 + + + + + CNT + CNT + counter + 0x24 + 0x20 + read-write + 0x0000 + + + CNT + counter value + 0 + 16 + + + + + PSC + PSC + prescaler + 0x28 + 0x20 + read-write + 0x0000 + + + PSC + Prescaler value + 0 + 16 + + + + + ATRLR + ATRLR + auto-reload register + 0x2C + 0x20 + read-write + 0xFFFF + + + ATRLR + Auto-reload value + 0 + 16 + + + + + RPTCR + RPTCR + repetition counter register + 0x30 + 0x20 + read-write + 0x0000 + + + RPTCR + Repetition counter value + 0 + 8 + + + + + CH1CVR + CH1CVR + capture/compare register 1 + 0x34 + 0x20 + read-write + 0x0000 + + + CH1CVR + Capture/Compare 1 value + 0 + 16 + + + + + CH2CVR + CH2CVR + capture/compare register 2 + 0x38 + 0x20 + read-write + 0x0000 + + + CH2CVR + Capture/Compare 2 value + 0 + 16 + + + + + CH3CVR + CH3CVR + capture/compare register 3 + 0x3C + 0x20 + read-write + 0x0000 + + + CH3CVR + Capture/Compare value + 0 + 16 + + + + + CH4CVR + CH4CVR + capture/compare register 4 + 0x40 + 0x20 + read-write + 0x0000 + + + CH4CVR + Capture/Compare value + 0 + 16 + + + + + BDTR + BDTR + break and dead-time register + 0x44 + 0x20 + read-write + 0x0000 + + + MOE + Main output enable + 15 + 1 + + + AOE + Automatic output enable + 14 + 1 + + + BKP + Break polarity + 13 + 1 + + + BKE + Break enable + 12 + 1 + + + OSSR + Off-state selection for Run + mode + 11 + 1 + + + OSSI + Off-state selection for Idle + mode + 10 + 1 + + + LOCK + Lock configuration + 8 + 2 + + + DTG + Dead-time generator setup + 0 + 8 + + + + + DMACFGR + DMACFGR + DMA control register + 0x48 + 0x20 + read-write + 0x0000 + + + DBL + DMA burst length + 8 + 5 + + + DBA + DMA base address + 0 + 5 + + + + + DMAADR + DMAADR + DMA address for full transfer + 0x4C + 0x20 + read-write + 0x0000 + + + DMAB + DMA register for burst + accesses + 0 + 16 + + + + + + + TIM2 + General purpose timer + TIM + 0x40000000 + + 0x0 + 0x400 + registers + + + TIM2 + TIM2 global interrupt + 38 + + + + CTLR1 + CTLR1 + control register 1 + 0x0 + 0x20 + read-write + 0x0000 + + + CAPLVL + Timer capture level indication + enable + 15 + 1 + + + CAPOV + Timer capture value configuration + enable + 14 + 1 + + + CKD + Clock division + 8 + 2 + + + ARPE + Auto-reload preload enable + 7 + 1 + + + CMS + Center-aligned mode + selection + 5 + 2 + + + DIR + Direction + 4 + 1 + + + OPM + One-pulse mode + 3 + 1 + + + URS + Update request source + 2 + 1 + + + UDIS + Update disable + 1 + 1 + + + CEN + Counter enable + 0 + 1 + + + + + CTLR2 + CTLR2 + control register 2 + 0x4 + 0x20 + read-write + 0x0000 + + + TI1S + TI1 selection + 7 + 1 + + + MMS + Master mode selection + 4 + 3 + + + CCDS + Capture/compare DMA + selection + 3 + 1 + + + + + SMCFGR + SMCFGR + slave mode control register + 0x8 + 0x20 + read-write + 0x0000 + + + ETP + External trigger polarity + 15 + 1 + + + ECE + External clock enable + 14 + 1 + + + ETPS + External trigger prescaler + 12 + 2 + + + ETF + External trigger filter + 8 + 4 + + + MSM + Master/Slave mode + 7 + 1 + + + TS + Trigger selection + 4 + 3 + + + SMS + Slave mode selection + 0 + 3 + + + + + DMAINTENR + DMAINTENR + DMA/Interrupt enable register + 0xC + 0x20 + read-write + 0x0000 + + + TDE + Trigger DMA request enable + 14 + 1 + + + CC4DE + Capture/Compare 4 DMA request + enable + 12 + 1 + + + CC3DE + Capture/Compare 3 DMA request + enable + 11 + 1 + + + CC2DE + Capture/Compare 2 DMA request + enable + 10 + 1 + + + CC1DE + Capture/Compare 1 DMA request + enable + 9 + 1 + + + UDE + Update DMA request enable + 8 + 1 + + + TIE + Trigger interrupt enable + 6 + 1 + + + CC4IE + Capture/Compare 4 interrupt + enable + 4 + 1 + + + CC3IE + Capture/Compare 3 interrupt + enable + 3 + 1 + + + CC2IE + Capture/Compare 2 interrupt + enable + 2 + 1 + + + CC1IE + Capture/Compare 1 interrupt + enable + 1 + 1 + + + UIE + Update interrupt enable + 0 + 1 + + + + + INTFR + INTFR + status register + 0x10 + 0x20 + read-write + 0x0000 + + + CC4OF + Capture/Compare 4 overcapture + flag + 12 + 1 + + + CC3OF + Capture/Compare 3 overcapture + flag + 11 + 1 + + + CC2OF + Capture/compare 2 overcapture + flag + 10 + 1 + + + CC1OF + Capture/Compare 1 overcapture + flag + 9 + 1 + + + TIF + Trigger interrupt flag + 6 + 1 + + + CC4IF + Capture/Compare 4 interrupt + flag + 4 + 1 + + + CC3IF + Capture/Compare 3 interrupt + flag + 3 + 1 + + + CC2IF + Capture/Compare 2 interrupt + flag + 2 + 1 + + + CC1IF + Capture/compare 1 interrupt + flag + 1 + 1 + + + UIF + Update interrupt flag + 0 + 1 + + + + + SWEVGR + SWEVGR + event generation register + 0x14 + 0x20 + write-only + 0x0000 + + + TG + Trigger generation + 6 + 1 + + + CC4G + Capture/compare 4 + generation + 4 + 1 + + + CC3G + Capture/compare 3 + generation + 3 + 1 + + + CC2G + Capture/compare 2 + generation + 2 + 1 + + + CC1G + Capture/compare 1 + generation + 1 + 1 + + + UG + Update generation + 0 + 1 + + + + + CHCTLR1_Output + CHCTLR1_Output + capture/compare mode register 1 (output + mode) + 0x18 + 0x20 + read-write + 0x0000 + + + OC2CE + Output compare channel 2 clear + enable + 15 + 1 + + + OC2M + Output compare channel 2 mode + 12 + 3 + + + OC2PE + Compare capture register 1 preload + enable + 11 + 1 + + + OC2FE + Output compare channel 2 fast + enable + 10 + 1 + + + CC2S + Capture/Compare channel 2 input + selection + 8 + 2 + + + OC1CE + Output compare 1 clear + enable + 7 + 1 + + + OC1M + Output compare 1 mode + 4 + 3 + + + OC1PE + Output compare 1 preload + enable + 3 + 1 + + + OC1FE + Output compare 1 fast + enable + 2 + 1 + + + CC1S + Capture/Compare 1 + selection + 0 + 2 + + + + + CHCTLR1_Input + CHCTLR1_Input + capture/compare mode register 1 (input + mode) + CHCTLR1_Output + 0x18 + 0x20 + read-write + 0x0000 + + + IC2F + Input capture 2 filter + 12 + 4 + + + IC2PSC + Input capture 2 prescaler + 10 + 2 + + + CC2S + Capture/compare 2 + selection + 8 + 2 + + + IC1F + Input capture 1 filter + 4 + 4 + + + IC1PSC + Input capture 1 prescaler + 2 + 2 + + + CC1S + Capture/Compare 1 + selection + 0 + 2 + + + + + CHCTLR2_Output + CHCTLR2_Output + capture/compare mode register 2 (output + mode) + 0x1C + 0x20 + read-write + 0x0000 + + + OC4CE + Output compare 4 clear + enable + 15 + 1 + + + OC4M + Output compare 4 mode + 12 + 3 + + + OC4PE + Output compare 4 preload + enable + 11 + 1 + + + OC4FE + Output compare 4 fast + enable + 10 + 1 + + + CC4S + Capture/Compare 4 + selection + 8 + 2 + + + OC3CE + Output compare 3 clear + enable + 7 + 1 + + + OC3M + Output compare 3 mode + 4 + 3 + + + OC3PE + Output compare 3 preload + enable + 3 + 1 + + + OC3FE + Output compare 3 fast + enable + 2 + 1 + + + CC3S + Capture/Compare 3 + selection + 0 + 2 + + + + + CHCTLR2_Input + CHCTLR2_Input + capture/compare mode register 2 (input + mode) + CHCTLR2_Output + 0x1C + 0x20 + read-write + 0x0000 + + + IC4F + Input capture 4 filter + 12 + 4 + + + IC4PSC + Input capture 4 prescaler + 10 + 2 + + + CC4S + Capture/Compare 4 + selection + 8 + 2 + + + IC3F + Input capture 3 filter + 4 + 4 + + + IC3PSC + Input capture 3 prescaler + 2 + 2 + + + CC3S + Capture/Compare 3 + selection + 0 + 2 + + + + + CCER + CCER + capture/compare enable + register + 0x20 + 0x20 + read-write + 0x0000 + + + CC4P + Capture/Compare channel 4 output + Polarity + 13 + 1 + + + CC4E + Capture/Compare channel 4 output + enable + 12 + 1 + + + CC3P + Capture/Compare channel 3 output + Polarity + 9 + 1 + + + CC3E + Capture/Compare channel 3 output + enable + 8 + 1 + + + CC2P + Capture/Compare channel 2 output + Polarity + 5 + 1 + + + CC2E + Capture/Compare channel 2 output + enable + 4 + 1 + + + CC1P + Capture/Compare channel 1 output + Polarity + 1 + 1 + + + CC1E + Capture/Compare channel 1 output + enable + 0 + 1 + + + + + CNT + CNT + counter + 0x24 + 0x20 + read-write + 0x0000 + + + CNT + counter value + 0 + 16 + + + + + PSC + PSC + prescaler + 0x28 + 0x20 + read-write + 0x0000 + + + PSC + Prescaler value + 0 + 16 + + + + + ATRLR + ATRLR + auto-reload register + 0x2C + 0x20 + read-write + 0xFFFF + + + ATRLR + Auto-reload value + 0 + 16 + + + + + CH1CVR + CH1CVR + capture/compare register 1 + 0x34 + 0x20 + read-write + 0x0000 + + + CH1CVR + Capture/Compare 1 value + 0 + 16 + + + + + CH2CVR + CH2CVR + capture/compare register 2 + 0x38 + 0x20 + read-write + 0x0000 + + + CH2CVR + Capture/Compare 2 value + 0 + 16 + + + + + CH3CVR + CH3CVR + capture/compare register 3 + 0x3C + 0x20 + read-write + 0x0000 + + + CH3CVR + Capture/Compare 3 value + 0 + 16 + + + + + CH4CVR + CH4CVR + capture/compare register 4 + 0x40 + 0x20 + read-write + 0x0000 + + + CH4CVR + Capture/Compare 4 value + 0 + 16 + + + + + DMACFGR + DMACFGR + DMA control register + 0x48 + 0x20 + read-write + 0x0000 + + + DBL + DMA burst length + 8 + 5 + + + DBA + DMA base address + 0 + 5 + + + + + DMAADR + DMAADR + DMA address for full transfer + 0x4C + 0x20 + read-write + 0x0000 + + + DMAADR + DMA register for burst + accesses + 0 + 16 + + + + + + + I2C1 + Inter integrated circuit + I2C + 0x40005400 + + 0x0 + 0x400 + registers + + + I2C1_EV + I2C1 event interrupt + 30 + + + I2C1_ER + I2C1 error interrupt + 31 + + + + CTLR1 + CTLR1 + Control register 1 + 0x0 + 0x20 + read-write + 0x0000 + + + SWRST + Software reset + 15 + 1 + + + PEC + Packet error checking + 12 + 1 + + + POS + Acknowledge/PEC Position (for data + reception) + 11 + 1 + + + ACK + Acknowledge enable + 10 + 1 + + + STOP + Stop generation + 9 + 1 + + + START + Start generation + 8 + 1 + + + NOSTRETCH + Clock stretching disable (Slave + mode) + 7 + 1 + + + ENGC + General call enable + 6 + 1 + + + ENPEC + PEC enable + 5 + 1 + + + PE + Peripheral enable + 0 + 1 + + + + + CTLR2 + CTLR2 + Control register 2 + 0x4 + 0x20 + read-write + 0x0000 + + + LAST + DMA last transfer + 12 + 1 + + + DMAEN + DMA requests enable + 11 + 1 + + + ITBUFEN + Buffer interrupt enable + 10 + 1 + + + ITEVTEN + Event interrupt enable + 9 + 1 + + + ITERREN + Error interrupt enable + 8 + 1 + + + FREQ + Peripheral clock frequency + 0 + 6 + + + + + OADDR1 + OADDR1 + Own address register 1 + 0x8 + 0x20 + read-write + 0x0000 + + + ADDMODE + Addressing mode (slave + mode) + 15 + 1 + + + ADD9_8 + Interface address + 8 + 2 + + + ADD7_1 + Interface address + 1 + 7 + + + ADD0 + Interface address + 0 + 1 + + + + + OADDR2 + OADDR2 + Own address register 2 + 0xC + 0x20 + read-write + 0x0000 + + + ADD2 + Interface address + 1 + 7 + + + ENDUAL + Dual addressing mode + enable + 0 + 1 + + + + + DATAR + DATAR + Data register + 0x10 + 0x20 + read-write + 0x0000 + + + DATAR + 8-bit data register + 0 + 8 + + + + + STAR1 + STAR1 + Status register 1 + 0x14 + 0x20 + 0x0000 + + + PECERR + PEC Error in reception + 12 + 1 + read-write + + + OVR + Overrun/Underrun + 11 + 1 + read-write + + + AF + Acknowledge failure + 10 + 1 + read-write + + + ARLO + Arbitration lost (master + mode) + 9 + 1 + read-write + + + BERR + Bus error + 8 + 1 + read-write + + + TxE + Data register empty + (transmitters) + 7 + 1 + read-only + + + RxNE + Data register not empty + (receivers) + 6 + 1 + read-only + + + STOPF + Stop detection (slave + mode) + 4 + 1 + read-only + + + ADD10 + 10-bit header sent (Master + mode) + 3 + 1 + read-only + + + BTF + Byte transfer finished + 2 + 1 + read-only + + + ADDR + Address sent (master mode)/matched + (slave mode) + 1 + 1 + read-only + + + SB + Start bit (Master mode) + 0 + 1 + read-only + + + + + STAR2 + STAR2 + Status register 2 + 0x18 + 0x20 + read-only + 0x0000 + + + PEC + acket error checking + register + 8 + 8 + + + DUALF + Dual flag (Slave mode) + 7 + 1 + + + GENCALL + General call address (Slave + mode) + 4 + 1 + + + TRA + Transmitter/receiver + 2 + 1 + + + BUSY + Bus busy + 1 + 1 + + + MSL + Master/slave + 0 + 1 + + + + + CKCFGR + CKCFGR + Clock control register + 0x1C + 0x20 + read-write + 0x0000 + + + F_S + I2C master mode selection + 15 + 1 + + + DUTY + Fast mode duty cycle + 14 + 1 + + + CCR + Clock control register in Fast/Standard + mode (Master mode) + 0 + 12 + + + + + + + SPI1 + Serial peripheral interface + SPI + 0x40013000 + + 0x0 + 0x400 + registers + + + SPI1 + SPI1 global interrupt + 33 + + + + CTLR1 + CTLR1 + control register 1 + 0x0 + 0x20 + read-write + 0x0000 + + + BIDIMODE + Bidirectional data mode + enable + 15 + 1 + + + BIDIOE + Output enable in bidirectional + mode + 14 + 1 + + + CRCEN + Hardware CRC calculation + enable + 13 + 1 + + + CRCNEXT + CRC transfer next + 12 + 1 + + + DFF + Data frame format + 11 + 1 + + + RXONLY + Receive only + 10 + 1 + + + SSM + Software slave management + 9 + 1 + + + SSI + Internal slave select + 8 + 1 + + + LSBFIRST + Frame format + 7 + 1 + + + SPE + SPI enable + 6 + 1 + + + BR + Baud rate control + 3 + 3 + + + MSTR + Master selection + 2 + 1 + + + CPOL + Clock polarity + 1 + 1 + + + CPHA + Clock phase + 0 + 1 + + + + + CTLR2 + CTLR2 + control register 2 + 0x4 + 0x20 + read-write + 0x0000 + + + TXEIE + Tx buffer empty interrupt + enable + 7 + 1 + + + RXNEIE + RX buffer not empty interrupt + enable + 6 + 1 + + + ERRIE + Error interrupt enable + 5 + 1 + + + SSOE + SS output enable + 2 + 1 + + + TXDMAEN + Tx buffer DMA enable + 1 + 1 + + + RXDMAEN + Rx buffer DMA enable + 0 + 1 + + + + + STATR + STATR + status register + 0x8 + 0x20 + 0x0002 + + + BSY + Busy flag + 7 + 1 + read-only + + + OVR + Overrun flag + 6 + 1 + read-write + + + MODF + Mode fault + 5 + 1 + read-only + + + CRCERR + CRC error flag + 4 + 1 + read-write + + + UDR + Underrun flag + 3 + 1 + read-only + + + CHSID + Channel side + 2 + 1 + read-only + + + TXE + Transmit buffer empty + 1 + 1 + read-only + + + RXNE + Receive buffer not empty + 0 + 1 + read-only + + + + + DATAR + DATAR + data register + 0xC + 0x20 + read-write + 0x0000 + + + DATAR + Data register + 0 + 16 + + + + + CRCR + CRCR + CRCR polynomial register + 0x10 + 0x20 + read-write + 0x0007 + + + CRCPOLY + CRC polynomial register + 0 + 16 + + + + + RCRCR + RCRCR + RX CRC register + 0x14 + 0x20 + read-only + 0x0000 + + + RXCRC + Rx CRC register + 0 + 16 + + + + + TCRCR + TCRCR + send CRC register + 0x18 + 0x20 + read-only + 0x0000 + + + TXCRC + Tx CRC register + 0 + 16 + + + + + HSCR + HSCR + high speed control register + 0x24 + 0x20 + 0x0000 + + + HSRXEN + High speed mode read enable + 0 + 1 + write-only + + + + + + + USART1 + Universal synchronous asynchronous receiver + transmitter + USART + 0x40013800 + + 0x0 + 0x400 + registers + + + USART1 + USART1 global interrupt + 32 + + + + STATR + STATR + Status register + 0x0 + 0x20 + 0x000000C0 + + + CTS + CTS flag + 9 + 1 + read-write + + + LBD + LIN break detection flag + 8 + 1 + read-write + + + TXE + Transmit data register + empty + 7 + 1 + read-only + + + TC + Transmission complete + 6 + 1 + read-write + + + RXNE + Read data register not + empty + 5 + 1 + read-write + + + IDLE + IDLE line detected + 4 + 1 + read-only + + + ORE + Overrun error + 3 + 1 + read-only + + + NE + Noise error flag + 2 + 1 + read-only + + + FE + Framing error + 1 + 1 + read-only + + + PE + Parity error + 0 + 1 + read-only + + + + + DATAR + DATAR + Data register + 0x4 + 0x20 + read-write + 0x00000000 + + + DR + Data value + 0 + 9 + + + + + BRR + BRR + Baud rate register + 0x8 + 0x20 + read-write + 0x00000000 + + + DIV_Mantissa + mantissa of USARTDIV + 4 + 12 + + + DIV_Fraction + fraction of USARTDIV + 0 + 4 + + + + + CTLR1 + CTLR1 + Control register 1 + 0xC + 0x20 + read-write + 0x00000000 + + + UE + USART enable + 13 + 1 + + + M + Word length + 12 + 1 + + + WAKE + Wakeup method + 11 + 1 + + + PCE + Parity control enable + 10 + 1 + + + PS + Parity selection + 9 + 1 + + + PEIE + PE interrupt enable + 8 + 1 + + + TXEIE + TXE interrupt enable + 7 + 1 + + + TCIE + Transmission complete interrupt + enable + 6 + 1 + + + RXNEIE + RXNE interrupt enable + 5 + 1 + + + IDLEIE + IDLE interrupt enable + 4 + 1 + + + TE + Transmitter enable + 3 + 1 + + + RE + Receiver enable + 2 + 1 + + + RWU + Receiver wakeup + 1 + 1 + + + SBK + Send break + 0 + 1 + + + + + CTLR2 + CTLR2 + Control register 2 + 0x10 + 0x20 + read-write + 0x00000000 + + + LINEN + LIN mode enable + 14 + 1 + + + STOP + STOP bits + 12 + 2 + + + CLKEN + Clock enable + 11 + 1 + + + CPOL + Clock polarity + 10 + 1 + + + CPHA + Clock phase + 9 + 1 + + + LBCL + Last bit clock pulse + 8 + 1 + + + LBDIE + LIN break detection interrupt + enable + 6 + 1 + + + LBDL + lin break detection length + 5 + 1 + + + ADD + Address of the USART node + 0 + 4 + + + + + CTLR3 + CTLR3 + Control register 3 + 0x14 + 0x20 + read-write + 0x00000000 + + + CTSIE + CTS interrupt enable + 10 + 1 + + + CTSE + CTS enable + 9 + 1 + + + RTSE + RTS enable + 8 + 1 + + + DMAT + DMA enable transmitter + 7 + 1 + + + DMAR + DMA enable receiver + 6 + 1 + + + SCEN + Smartcard mode enable + 5 + 1 + + + NACK + Smartcard NACK enable + 4 + 1 + + + HDSEL + Half-duplex selection + 3 + 1 + + + IRLP + IrDA low-power + 2 + 1 + + + IREN + IrDA mode enable + 1 + 1 + + + EIE + Error interrupt enable + 0 + 1 + + + + + GPR + GPR + Guard time and prescaler + register + 0x18 + 0x20 + read-write + 0x00000000 + + + GT + Guard time value + 8 + 8 + + + PSC + Prescaler value + 0 + 8 + + + + + + + ADC1 + Analog to digital converter + ADC1 + 0x40012400 + + 0x0 + 0x400 + registers + + + ADC + ADC global interrupt + 29 + + + + STATR + STATR + status register + 0x0 + 0x20 + read-write + 0x00000000 + + + STRT + Regular channel start flag + 4 + 1 + + + JSTRT + Injected channel start + flag + 3 + 1 + + + JEOC + Injected channel end of + conversion + 2 + 1 + + + EOC + Regular channel end of + conversion + 1 + 1 + + + AWD + Analog watchdog flag + 0 + 1 + + + + + CTLR1 + CTLR1 + control register 1/TKEY_V_CTLR + 0x4 + 0x20 + read-write + 0x00000000 + + + CALVOL + ADC Calibration voltage selection + 25 + 2 + + + AWDEN + Analog watchdog enable on regular + channels + 23 + 1 + + + JAWDEN + Analog watchdog enable on injected + channels + 22 + 1 + + + DISCNUM + Discontinuous mode channel + count + 13 + 3 + + + JDISCEN + Discontinuous mode on injected + channels + 12 + 1 + + + DISCEN + Discontinuous mode on regular + channels + 11 + 1 + + + JAUTO + Automatic injected group + conversion + 10 + 1 + + + AWDSGL + Enable the watchdog on a single channel + in scan mode + 9 + 1 + + + SCAN + Scan mode enable + 8 + 1 + + + JEOCIE + Interrupt enable for injected + channels + 7 + 1 + + + AWDIE + Analog watchdog interrupt + enable + 6 + 1 + + + EOCIE + Interrupt enable for EOC + 5 + 1 + + + AWDCH + Analog watchdog channel select + bits + 0 + 5 + + + + + CTLR2 + CTLR2 + control register 2 + 0x8 + 0x20 + read-write + 0x00000000 + + + SWSTART + Start conversion of regular + channels + 22 + 1 + + + JSWSTART + Start conversion of injected + channels + 21 + 1 + + + EXTTRIG + External trigger conversion mode for + regular channels + 20 + 1 + + + EXTSEL + External event select for regular + group + 17 + 3 + + + JEXTTRIG + External trigger conversion mode for + injected channels + 15 + 1 + + + JEXTSEL + External event select for injected + group + 12 + 3 + + + ALIGN + Data alignment + 11 + 1 + + + DMA + Direct memory access mode + 8 + 1 + + + RSTCAL + Reset calibration + 3 + 1 + + + CAL + A/D calibration + 2 + 1 + + + CONT + Continuous conversion + 1 + 1 + + + ADON + A/D converter ON / OFF + 0 + 1 + + + + + SAMPTR1 + SAMPTR1_CHARGE1 + sample time register 1 + 0xC + 0x20 + read-write + 0x00000000 + + + SMP10 + Channel 10 sample time + selection + 0 + 3 + + + SMP11 + Channel 11 sample time + selection + 3 + 3 + + + SMP12_TKCG12 + Channel 12 sample time + selection + 6 + 3 + + + SMP13 + Channel 13 sample time + selection + 9 + 3 + + + SMP14 + Channel 14 sample time + selection + 12 + 3 + + + SMP15 + Channel 15 sample time + selection + 15 + 3 + + + + + SAMPTR2 + SAMPTR2_CHARGE2 + sample time register 2 + 0x10 + 0x20 + read-write + 0x00000000 + + + SMP0 + Channel 0 sample time + selection + 0 + 3 + + + SMP1 + Channel 1 sample time + selection + 3 + 3 + + + SMP2 + Channel 2 sample time + selection + 6 + 3 + + + SMP3 + Channel 3 sample time + selection + 9 + 3 + + + SMP4 + Channel 4 sample time + selection + 12 + 3 + + + SMP5 + Channel 5 sample time + selection + 15 + 3 + + + SMP6_TKCG6 + Channel 6 sample time + selection + 18 + 3 + + + SMP7 + Channel 7 sample time + selection + 21 + 3 + + + SMP8 + Channel 8 sample time + selection + 24 + 3 + + + SMP9 + Channel 9 sample time + selection + 27 + 3 + + + + + IOFR1 + IOFR1 + injected channel data offset register + x + 0x14 + 0x20 + read-write + 0x00000000 + + + JOFFSET1 + Data offset for injected channel + x + 0 + 10 + + + + + IOFR2 + IOFR2 + injected channel data offset register + x + 0x18 + 0x20 + read-write + 0x00000000 + + + JOFFSET2 + Data offset for injected channel + x + 0 + 10 + + + + + IOFR3 + IOFR3 + injected channel data offset register + x + 0x1C + 0x20 + read-write + 0x00000000 + + + JOFFSET3 + Data offset for injected channel + x + 0 + 10 + + + + + IOFR4 + IOFR4 + injected channel data offset register + x + 0x20 + 0x20 + read-write + 0x00000000 + + + JOFFSET4 + Data offset for injected channel + x + 0 + 10 + + + + + WDHTR + WDHTR + watchdog higher threshold + register + 0x24 + 0x20 + read-write + 0x000003FF + + + HT + Analog watchdog higher + threshold + 0 + 10 + + + + + WDLTR + WDLTR + watchdog lower threshold + register + 0x28 + 0x20 + read-write + 0x00000000 + + + LT + Analog watchdog lower + threshold + 0 + 10 + + + + + RSQR1 + RSQR1 + regular sequence register 1 + 0x2C + 0x20 + read-write + 0x00000000 + + + L + Regular channel sequence + length + 20 + 4 + + + SQ16 + 16th conversion in regular + sequence + 15 + 5 + + + SQ15 + 15th conversion in regular + sequence + 10 + 5 + + + SQ14 + 14th conversion in regular + sequence + 5 + 5 + + + SQ13 + 13th conversion in regular + sequence + 0 + 5 + + + + + RSQR2 + RSQR2 + regular sequence register 2 + 0x30 + 0x20 + read-write + 0x00000000 + + + SQ12 + 12th conversion in regular + sequence + 25 + 5 + + + SQ11 + 11th conversion in regular + sequence + 20 + 5 + + + SQ10 + 10th conversion in regular + sequence + 15 + 5 + + + SQ9 + 9th conversion in regular + sequence + 10 + 5 + + + SQ8 + 8th conversion in regular + sequence + 5 + 5 + + + SQ7 + 7th conversion in regular + sequence + 0 + 5 + + + + + RSQR3 + RSQR3 + regular sequence register 3 + 0x34 + 0x20 + read-write + 0x00000000 + + + SQ6 + 6th conversion in regular + sequence + 25 + 5 + + + SQ5 + 5th conversion in regular + sequence + 20 + 5 + + + SQ4 + 4th conversion in regular + sequence + 15 + 5 + + + SQ3 + 3rd conversion in regular + sequence + 10 + 5 + + + SQ2 + 2nd conversion in regular + sequence + 5 + 5 + + + SQ1 + 1st conversion in regular + sequence + 0 + 5 + + + + + ISQR + ISQR + injected sequence register + 0x38 + 0x20 + read-write + 0x00000000 + + + JL + Injected sequence length + 20 + 2 + + + JSQ4 + 4th conversion in injected + sequence + 15 + 5 + + + JSQ3 + 3rd conversion in injected + sequence + 10 + 5 + + + JSQ2 + 2nd conversion in injected + sequence + 5 + 5 + + + JSQ1 + 1st conversion in injected + sequence + 0 + 5 + + + + + IDATAR1 + IDATAR1 + injected data register 1 + 0x3C + 0x20 + read-only + 0x00000000 + + + IDATA + Injected data + 0 + 16 + + + + + IDATAR2 + IDATAR2 + injected data register 2 + 0x40 + 0x20 + read-only + 0x00000000 + + + IDATA + Injected data + 0 + 16 + + + + + IDATAR3 + IDATAR3 + injected data register 3 + 0x44 + 0x20 + read-only + 0x00000000 + + + IDATA + Injected data + 0 + 16 + + + + + IDATAR4 + IDATAR4 + injected data register 4 + 0x48 + 0x20 + read-only + 0x00000000 + + + IDATA + Injected data + 0 + 16 + + + + + RDATAR + RDATAR + regular data register + 0x4C + 0x20 + read-only + 0x00000000 + + + DATA + Regular data + 0 + 32 + + + + + DLYR + DLYR + delay data register + 0x50 + 0x20 + read-write + 0x00000000 + + + DLYVLU + External trigger data delay time configuration + 0 + 9 + + + DLYSRC + External trigger source delay selection + 9 + 1 + + + + + + + DBG + Debug support + DBG + 0xE000D000 + + 0x0 + 0x400 + registers + + + + CR + CR + DBGMCU_CFGR1 + 0x0 + 0x20 + read-write + 0x0 + + + SLEEP + Debug Sleep mode + 0 + 1 + + + STOP + Debug stop mode + 1 + 1 + + + STANDBY + Debug standby mode + 2 + 1 + + + IWDG_STOP + IWDG_STOP + 8 + 1 + + + WWDG_STOP + WWDG_STOP + 9 + 1 + + + TIM1_STOP + TIM1_STOP + 12 + 1 + + + TIM2_STOP + TIM2_STOP + 13 + 1 + + + + + + + ESIG + Device electronic signature + ESIG + 0x1FFFF7E0 + + 0x0 + 0x14 + registers + + + + FLACAP + FLACAP + Flash capacity register + 0x0 + 0x10 + read-only + 0x0000 + + + F_SIZE_15_0 + Flash size + 0 + 16 + + + + + UNIID1 + UNIID1 + Unique identity 1 + 0x8 + 0x20 + read-only + 0x00000000 + + + U_ID + Unique identity[31:0] + 0 + 32 + + + + + UNIID2 + UNIID2 + Unique identity 2 + 0xC + 0x20 + read-only + 0x00000000 + + + U_ID + Unique identity[63:32] + 0 + 32 + + + + + UNIID3 + UNIID3 + Unique identity 3 + 0x10 + 0x20 + read-only + 0x00000000 + + + U_ID + Unique identity[95:64] + 0 + 32 + + + + + + + FLASH + FLASH + FLASH + 0x40022000 + + 0x0 + 0x400 + registers + + + FLASH + Flash global interrupt + 18 + + + + ACTLR + ACTLR + Flash key register + 0x0 + 0x20 + 0x00000000 + + + LATENCY + Number of FLASH wait states + 0 + 2 + read-write + + + + + KEYR + KEYR + Flash key register + 0x4 + 0x20 + write-only + 0x00000000 + + + KEYR + FPEC key + 0 + 32 + + + + + OBKEYR + OBKEYR + Flash option key register + 0x8 + 0x20 + write-only + 0x00000000 + + + OPTKEY + Option byte key + 0 + 32 + + + + + STATR + STATR + Status register + 0xC + 0x20 + 0x00008000 + + + BOOT_LOCK + BOOT lock + 15 + 1 + read-write + + + BOOT_MODE + BOOT mode + 14 + 1 + read-write + + + EOP + End of operation + 5 + 1 + read-write + + + WRPRTERR + Write protection error + 4 + 1 + read-write + + + BSY + Busy + 0 + 1 + read-only + + + + + CTLR + CTLR + Control register + 0x10 + 0x20 + read-write + 0x00008080 + + + PG + Programming + 0 + 1 + + + PER + Page Erase + 1 + 1 + + + MER + Mass Erase + 2 + 1 + + + OBPG + Option byte programming + 4 + 1 + + + OBER + Option byte erase + 5 + 1 + + + STRT + Start + 6 + 1 + + + LOCK + Lock + 7 + 1 + + + OBWRE + Option bytes write enable + 9 + 1 + + + ERRIE + Error interrupt enable + 10 + 1 + + + EOPIE + End of operation interrupt + enable + 12 + 1 + + + FLOCK + Fast programmable lock + 15 + 1 + + + FTPG + Fast programming + 16 + 1 + + + FTER + Fast erase + 17 + 1 + + + BUFLOAD + Buffer load + 18 + 1 + + + BUFRST + Buffer reset + 19 + 1 + + + + + ADDR + ADDR + Flash address register + 0x14 + 0x20 + write-only + 0x00000000 + + + FAR + Flash Address + 0 + 32 + + + + + OBR + OBR + Option byte register + 0x1C + 0x20 + read-only + 0x00000000 + + + OBERR + Option byte error + 0 + 1 + + + RDPRT + Read protection + 1 + 1 + + + IWDG_SW + IWDG_SW + 2 + 1 + + + STANDY_RST + STANDY_RST + 4 + 1 + + + RST_MODE + CFG_RST_MODE + 5 + 2 + + + STATR_MODE + STATR MODE + 7 + 1 + + + DATA0 + DATA0 + 10 + 8 + + + DATA1 + DATA1 + 18 + 8 + + + + + WPR + WPR + Write protection register + 0x20 + 0x20 + read-only + 0xFFFFFFFF + + + WRP + Write protect + 0 + 16 + + + + + MODEKEYR + MODEKEYR + Mode select register + 0x24 + 0x20 + write-only + 0x00000000 + + + MODEKEYR + Mode select + 0 + 32 + + + + + BOOT_MODEKEYP + BOOT_MODEKEYP + Boot mode key register + 0x28 + 0x20 + write-only + 0x00000000 + + + MODEKEYR + Boot mode key + 0 + 32 + + + + + + + PFIC + Programmable Fast Interrupt + Controller + PFIC + 0xE000E000 + + 0x00 + 0x1100 + registers + + + + ISR1 + ISR1 + Interrupt Status + Register + 0x00 + 0x20 + read-only + 0x0000000C + + + INTENSTA2_3 + Interrupt ID Status + 2 + 2 + + + INTENSTA12 + Interrupt ID Status + 12 + 1 + + + INTENSTA14 + Interrupt ID Status + 14 + 1 + + + INTENSTA16_31 + Interrupt ID Status + 16 + 16 + + + + + ISR2 + ISR2 + Interrupt Status + Register + 0x04 + 0x20 + read-only + 0x00000000 + + + INTENSTA + Interrupt ID Status + 0 + 7 + + + + + IPR1 + IPR1 + Interrupt Pending Register + 0x20 + 0x20 + read-only + 0x00000000 + + + PENDSTA2_3 + PENDSTA + 2 + 2 + + + PENDSTA12 + PENDSTA + 12 + 1 + + + INTENSTA14 + PENDSTA + 14 + 1 + + + INTENSTA16_31 + PENDSTA + 16 + 16 + + + + + IPR2 + IPR2 + Interrupt Pending Register + 0x24 + 0x20 + read-only + 0x00000000 + + + PENDSTA32_38 + PENDSTA + 0 + 7 + + + + + ITHRESDR + ITHRESDR + Interrupt Priority + Register + 0x40 + 0x20 + read-write + 0x00000000 + + + THRESHOLD + THRESHOLD + 0 + 8 + + + + + CFGR + CFGR + Interrupt Config Register + 0x48 + 0x20 + 0x00000000 + + + RSTSYS + RESET System + write-only + 7 + 1 + + + KEYCODE + KEYCODE + write-only + 16 + 16 + + + + + GISR + GISR + Interrupt Global Register + 0x4C + 0x20 + read-only + 0x00000000 + + + NESTSTA + NESTSTA + 0 + 8 + + + GACTSTA + GACTSTA + 8 + 1 + + + GPENDSTA + GPENDSTA + 9 + 1 + + + + + VTFIDR + VTFIDR + ID Config Register + 0x50 + 0x20 + read-write + 0x00000000 + + + VTFID0 + VTFID0 + 0 + 8 + + + VTFID1 + VTFID1 + 8 + 8 + + + + + VTFADDRR0 + VTFADDRR0 + Interrupt 0 address + Register + 0x60 + 0x20 + read-write + 0x00000000 + + + VTF0EN + VTF0EN + 0 + 1 + + + ADDR0 + ADDR0 + 1 + 31 + + + + + VTFADDRR1 + VTFADDRR1 + Interrupt 1 address + Register + 0x64 + 0x20 + read-write + 0x00000000 + + + VTF1EN + VTF1EN + 0 + 1 + + + ADDR1 + ADDR1 + 1 + 31 + + + + + IENR1 + IENR1 + Interrupt Setting Register + 0x100 + 0x20 + write-only + 0x00000000 + + + INTEN12 + INTEN12 + 12 + 1 + + + INTEN14 + INTEN14 + 14 + 1 + + + INTEN16_31 + INTEN16_31 + 16 + 16 + + + + + IENR2 + IENR2 + Interrupt Setting Register + 0x104 + 0x20 + write-only + 0x00000000 + + + INTEN + INTEN32_38 + 0 + 7 + + + + + IRER1 + IRER1 + Interrupt Clear Register + 0x180 + 0x20 + write-only + 0x00000000 + + + INTRSET12 + INTRSET12 + 12 + 1 + + + INTRSET14 + INTRSET14 + 14 + 1 + + + INTRSET16_31 + INTRSET16_31 + 16 + 16 + + + + + IRER2 + IRER2 + Interrupt Clear Register + 0x184 + 0x20 + write-only + 0x00000000 + + + INTRSET38_32 + INTRSET38_32 + 0 + 7 + + + + + IPSR1 + IPSR1 + Interrupt Pending Register + 0x200 + 0x20 + write-only + 0x00000000 + + + PENDSET2_3 + PENDSET + 2 + 2 + + + PENDSET12 + PENDSET + 12 + 1 + + + PENDSET14 + PENDSET + 14 + 1 + + + PENDSET16_31 + PENDSET + 16 + 16 + + + + + IPSR2 + IPSR2 + Interrupt Pending Register + 0x204 + 0x20 + write-only + 0x00000000 + + + PENDSET32_38 + PENDSET32_38 + 0 + 7 + + + + + IPRR1 + IPRR1 + Interrupt Pending Clear Register + 0x280 + 0x20 + write-only + 0x00000000 + + + PENDRST2_3 + PENDRESET + 2 + 2 + + + PENDRST12 + PENDRESET + 12 + 1 + + + PENDRST14 + PENDRESET + 14 + 1 + + + PENDRST16_31 + PENDRESET + 16 + 16 + + + + + IPRR2 + IPRR2 + Interrupt Pending Clear Register + 0x284 + 0x20 + write-only + 0x00000000 + + + PENDRST32_38 + PENDRESET32_38 + 0 + 7 + + + + + IACTR1 + IACTR1 + Interrupt ACTIVE Register + 0x300 + 0x20 + write-only + 0x00000000 + + + IACTS2_3 + IACTS + 2 + 2 + + + IACTS12 + IACTS + 12 + 1 + + + IACTS14 + IACTS + 14 + 1 + + + IACTS16_31 + IACTS + 16 + 16 + + + + + IACTR2 + IACTR2 + Interrupt ACTIVE Register + 0x304 + 0x20 + write-only + 0x00000000 + + + IACTS + IACTS + 0 + 7 + + + + + IPRIOR0 + IPRIOR0 + Interrupt Priority Register + 0x400 + 0x8 + read-write + 0x00000000 + + + IPRIOR1 + IPRIOR1 + Interrupt Priority Register + 0x401 + 0x8 + read-write + 0x00000000 + + + IPRIOR2 + IPRIOR2 + Interrupt Priority Register + 0x402 + 0x8 + read-write + 0x00000000 + + + IPRIOR3 + IPRIOR3 + Interrupt Priority Register + 0x403 + 0x8 + read-write + 0x00000000 + + + IPRIOR4 + IPRIOR4 + Interrupt Priority Register + 0x404 + 0x8 + read-write + 0x00000000 + + + IPRIOR5 + IPRIOR5 + Interrupt Priority Register + 0x405 + 0x8 + read-write + 0x00000000 + + + IPRIOR6 + IPRIOR6 + Interrupt Priority Register + 0x406 + 0x8 + read-write + 0x00000000 + + + IPRIOR7 + IPRIOR7 + Interrupt Priority Register + 0x407 + 0x8 + read-write + 0x00000000 + + + IPRIOR8 + IPRIOR8 + Interrupt Priority Register + 0x408 + 0x8 + read-write + 0x00000000 + + + IPRIOR9 + IPRIOR9 + Interrupt Priority Register + 0x409 + 0x8 + read-write + 0x00000000 + + + IPRIOR10 + IPRIOR10 + Interrupt Priority Register + 0x40A + 0x8 + read-write + 0x00000000 + + + + IPRIOR11 + IPRIOR11 + Interrupt Priority Register + 0x40B + 0x8 + read-write + 0x00000000 + + + IPRIOR12 + IPRIOR12 + Interrupt Priority Register + 0x40C + 0x8 + read-write + 0x00000000 + + + IPRIOR13 + IPRIOR13 + Interrupt Priority Register + 0x40D + 0x8 + read-write + 0x00000000 + + + IPRIOR14 + IPRIOR14 + Interrupt Priority Register + 0x40E + 0x8 + read-write + 0x00000000 + + + IPRIOR15 + IPRIOR15 + Interrupt Priority Register + 0x40F + 0x8 + read-write + 0x00000000 + + + IPRIOR16 + IPRIOR6 + Interrupt Priority Register + 0x410 + 0x8 + read-write + 0x00000000 + + + IPRIOR17 + IPRIOR7 + Interrupt Priority Register + 0x411 + 0x8 + read-write + 0x00000000 + + + IPRIOR18 + IPRIOR8 + Interrupt Priority Register + 0x412 + 0x8 + read-write + 0x00000000 + + + IPRIOR19 + IPRIOR9 + Interrupt Priority Register + 0x413 + 0x8 + read-write + 0x00000000 + + + IPRIOR20 + IPRIOR20 + Interrupt Priority Register + 0x414 + 0x8 + read-write + 0x00000000 + + + + IPRIOR21 + IPRIOR21 + Interrupt Priority Register + 0x415 + 0x8 + read-write + 0x00000000 + + + IPRIOR22 + IPRIOR22 + Interrupt Priority Register + 0x416 + 0x8 + read-write + 0x00000000 + + + IPRIOR23 + IPRIOR23 + Interrupt Priority Register + 0x417 + 0x8 + read-write + 0x00000000 + + + IPRIOR24 + IPRIOR24 + Interrupt Priority Register + 0x418 + 0x8 + read-write + 0x00000000 + + + IPRIOR25 + IPRIOR25 + Interrupt Priority Register + 0x419 + 0x8 + read-write + 0x00000000 + + + IPRIOR26 + IPRIOR26 + Interrupt Priority Register + 0x41A + 0x8 + read-write + 0x00000000 + + + IPRIOR27 + IPRIOR27 + Interrupt Priority Register + 0x41B + 0x8 + read-write + 0x00000000 + + + IPRIOR28 + IPRIOR28 + Interrupt Priority Register + 0x41C + 0x8 + read-write + 0x00000000 + + + IPRIOR29 + IPRIOR29 + Interrupt Priority Register + 0x41D + 0x8 + read-write + 0x00000000 + + + + IPRIOR30 + IPRIOR30 + Interrupt Priority Register + 0x41E + 0x8 + read-write + 0x00000000 + + + IPRIOR31 + IPRIOR31 + Interrupt Priority Register + 0x41F + 0x8 + read-write + 0x00000000 + + + IPRIOR32 + IPRIOR32 + Interrupt Priority Register + 0x420 + 0x8 + read-write + 0x00000000 + + + IPRIOR33 + IPRIOR33 + Interrupt Priority Register + 0x421 + 0x8 + read-write + 0x00000000 + + + IPRIOR34 + IPRIOR34 + Interrupt Priority Register + 0x422 + 0x8 + read-write + 0x00000000 + + + IPRIOR35 + IPRIOR35 + Interrupt Priority Register + 0x423 + 0x8 + read-write + 0x00000000 + + + IPRIOR36 + IPRIOR36 + Interrupt Priority Register + 0x424 + 0x8 + read-write + 0x00000000 + + + IPRIOR37 + IPRIOR37 + Interrupt Priority Register + 0x425 + 0x8 + read-write + 0x00000000 + + + IPRIOR38 + IPRIOR38 + Interrupt Priority Register + 0x426 + 0x8 + read-write + 0x00000000 + + + IPRIOR39 + IPRIOR39 + Interrupt Priority Register + 0x427 + 0x8 + read-write + 0x00000000 + + + + IPRIOR40 + IPRIOR40 + Interrupt Priority Register + 0x428 + 0x8 + read-write + 0x00000000 + + + IPRIOR41 + IPRIOR41 + Interrupt Priority Register + 0x429 + 0x8 + read-write + 0x00000000 + + + IPRIOR42 + IPRIOR42 + Interrupt Priority Register + 0x42A + 0x8 + read-write + 0x00000000 + + + IPRIOR43 + IPRIOR43 + Interrupt Priority Register + 0x42B + 0x8 + read-write + 0x00000000 + + + IPRIOR44 + IPRIOR44 + Interrupt Priority Register + 0x42C + 0x8 + read-write + 0x00000000 + + + IPRIOR45 + IPRIOR45 + Interrupt Priority Register + 0x42D + 0x8 + read-write + 0x00000000 + + + IPRIOR46 + IPRIOR46 + Interrupt Priority Register + 0x42E + 0x8 + read-write + 0x00000000 + + + IPRIOR47 + IPRIOR47 + Interrupt Priority Register + 0x42F + 0x8 + read-write + 0x00000000 + + + IPRIOR48 + IPRIOR48 + Interrupt Priority Register + 0x430 + 0x8 + read-write + 0x00000000 + + + IPRIOR49 + IPRIOR49 + Interrupt Priority Register + 0x431 + 0x8 + read-write + 0x00000000 + + + + IPRIOR50 + IPRIOR50 + Interrupt Priority Register + 0x432 + 0x8 + read-write + 0x00000000 + + + IPRIOR51 + IPRIOR51 + Interrupt Priority Register + 0x433 + 0x8 + read-write + 0x00000000 + + + IPRIOR52 + IPRIOR52 + Interrupt Priority Register + 0x434 + 0x8 + read-write + 0x00000000 + + + IPRIOR53 + IPRIOR53 + Interrupt Priority Register + 0x435 + 0x8 + read-write + 0x00000000 + + + IPRIOR54 + IPRIOR54 + Interrupt Priority Register + 0x436 + 0x8 + read-write + 0x00000000 + + + IPRIOR55 + IPRIOR55 + Interrupt Priority Register + 0x437 + 0x8 + read-write + 0x00000000 + + + IPRIOR56 + IPRIOR56 + Interrupt Priority Register + 0x438 + 0x8 + read-write + 0x00000000 + + + IPRIOR57 + IPRIOR57 + Interrupt Priority Register + 0x439 + 0x8 + read-write + 0x00000000 + + + IPRIOR58 + IPRIOR58 + Interrupt Priority Register + 0x43A + 0x8 + read-write + 0x00000000 + + + IPRIOR59 + IPRIOR59 + Interrupt Priority Register + 0x43B + 0x8 + read-write + 0x00000000 + + + + IPRIOR60 + IPRIOR60 + Interrupt Priority Register + 0x43C + 0x8 + read-write + 0x00000000 + + + IPRIOR61 + IPRIOR61 + Interrupt Priority Register + 0x43D + 0x8 + read-write + 0x00000000 + + + IPRIOR62 + IPRIOR62 + Interrupt Priority Register + 0x43E + 0x8 + read-write + 0x00000000 + + + IPRIOR63 + IPRIOR63 + Interrupt Priority Register + 0x43F + 0x8 + read-write + 0x00000000 + + + SCTLR + SCTLR + System Control Register + 0xd10 + 0x20 + read-write + 0x00000000 + + + SLEEPONEXIT + SLEEPONEXIT + 1 + 1 + + + SLEEPDEEP + SLEEPDEEP + 2 + 1 + + + WFITOWFE + WFITOWFE + 3 + 1 + + + SEVONPEND + SEVONPEND + 4 + 1 + + + SETEVENT + SETEVENT + 5 + 1 + + + SYSRST + SYSRESET + 31 + 1 + + + + + STK_CTLR + STK_CTLR + System counter control register + 0x1000 + 0x20 + 0x00000000 + + + STE + System counter enable + read-write + 0 + 1 + + + STIE + System counter interrupt enable + read-write + 1 + 1 + + + STCLK + System selects the clock source + read-write + 2 + 1 + + + STRE + System reload register + read-write + 3 + 1 + + + MODE + System Mode + read-write + 4 + 1 + + + INIT + System Initialization update + read-write + 5 + 1 + + + SWIE + System software triggered interrupts enable + read-write + 31 + 1 + + + + + STK_SR + System START + 0x1004 + 0x20 + read-write + 0x00000000 + + + CNTIF + CNTIF + 0 + 1 + + + + + STK_CNTL + System counter low register + 0x1008 + 0x20 + read-write + 0x00000000 + + + CNT + CNT + 0 + 32 + + + + + STK_CMPLR + System compare low register + 0x1010 + 0x20 + read-write + 0x00000000 + + + CMP + CMP + 0 + 32 + + + + + + + diff --git a/src/misc/LIBGCC_LICENSE b/src/misc/LIBGCC_LICENSE new file mode 100644 index 0000000..293b2ef --- /dev/null +++ b/src/misc/LIBGCC_LICENSE @@ -0,0 +1,773 @@ +The software in the directory newlib and the files configure.ac, Makefile.in, +and patches/newlib, is licensed as follows: + +Copyright (c) 2016, The Regents of the University of California (Regents). +All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the Regents nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, +SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING +OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS +BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED +HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE +MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + +The software in the directories binutils, gcc, and linux-headers, and the +files patches/binutils and patches/gcc, is licensed as follows: + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +The software in the directory glibc and the file patches/glibc is licensed as +follows: + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/src/misc/README.md b/src/misc/README.md new file mode 100644 index 0000000..77893c8 --- /dev/null +++ b/src/misc/README.md @@ -0,0 +1,189 @@ +# Supplementary non-official material + +This is a copy of libgcc.a that I know works well with the part. Below are the instructions on how to get the source code and how to build it. + +# Extra totally non-official info + +## GPIO Drive Currents + +At 3.3v, it seems that for all speed configurations, the short drive current is 50mA both for emitter and colletor. But the current falls off rather quickly with some voltage. + +At 5v the peak current power application is 90-100mA for emitter and collector. + +## General notes about the CH32V003. + +CPI/Processor Speed: + +Ignoring branches and load/stores, compressed instructions run at 1 CPI. Non-compressed instructions run at 1 CPI for the first 2 instructions, then further ones take 2 CPI regardless of how many more you have. Running from RAM and running from FLASH have slightly different performance characteristics depending on wait states that should be measured in-situation. + +## Building libgcc.a from source. + +1. Install prerequisites (for Debian-based systems; similar steps for other systems): + +``` +sudo apt-get install build-essential autoconf automake autotools-dev curl \ +libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo \ +gperf libtool patchutils bc zlib1g-dev git +``` + +2. Checkout sources: + +``` +git clone --recursive https://github.com/riscv/riscv-gnu-toolchain.git +cd riscv-gnu-toolchain +``` + +3. Configure and build: + +``` +./configure --prefix $(pwd)/build-ch32v003 --with-arch=rv32ec --with-abi=ilp32e +make -j8 +``` + +4. Enjoy the built libgcc.a at ./build-ch32v003/lib/gcc/riscv32-unknown-elf/12.2.0/libgcc.a + + +## The vendor bytes section + +```sh +../../ch32v003fun//../minichlink/minichlink -a -r + 0x1ffff700 36 -r + 0x1ffff7e0 20 +``` + +For a ch32v307 CH32V307WCU6: +``` +1ffff700: 34 fe 78 dc 18 05 73 30 29 c6 6a 09 85 c5 9f ff +1ffff710: 55 a1 05 00 00 00 00 86 81 31 15 38 05 fa aa 55 +1ffff720: 62 05 1a 00 +Read 16 bytes +1ffff7e0: 20 01 ff ff ff ff ff ff db 4a aa 7b 54 50 d9 16 +1ffff7f0: ff ff ff ff +``` + +Another V307 CH32V307WCU6 (from the same lot) +``` +1ffff700: 34 fe 78 dc 18 05 73 30 2a c6 8c 09 85 c5 9f ff +1ffff710: 55 a1 05 00 00 00 00 86 81 31 15 38 05 fa aa 55 +1ffff720: 5c 05 1a 00 +Read 20 bytes +1ffff7e0: 20 01 ff ff ff ff ff ff ed 4a aa 7b 54 50 eb 16 +1ffff7f0: 39 e3 39 e3 +``` + +A CH32V307VCT6 +``` +1ffff700: 34 fe 78 dc 28 05 70 30 29 c6 8f 09 85 45 ff ff +1ffff710: 55 a1 05 00 00 00 00 86 81 31 15 38 05 fa aa 55 +1ffff720: 7c 05 19 00 +Read 20 bytes +1ffff7e0: 20 01 ff ff ff ff ff ff 99 65 1a 7b 54 50 07 31 +1ffff7f0: 39 e3 39 e3 +``` + +CH32V305FBP6 +``` +1ffff700: 34 fe 78 dc 38 05 52 30 2a c6 a9 09 45 c5 9b 32 +1ffff710: 55 a1 05 00 00 00 00 86 81 31 15 38 05 fa aa 55 +1ffff720: 81 05 19 00 +Read 20 bytes +1ffff7e0: 80 00 ff ff ff ff ff ff cd ab bd 08 7b bc 05 71 +1ffff7f0: 39 e3 39 e3 +``` + +A CH32V208 +``` +1ffff700: 34 fe 78 dc 1c 05 80 20 29 86 51 09 55 00 3f c0 +1ffff710: 24 01 11 10 00 00 00 86 81 31 15 38 05 fa aa 55 +1ffff720: 71 05 1d 00 +Read 20 bytes +1ffff7e0: a0 00 ff ff ff ff ff ff 7a 8b d3 7b 54 50 a1 57 +1ffff7f0: 39 e3 39 e3 +``` + +A Ch32v203 GBU6 +``` +1ffff700: 34 fe 78 dc 38 05 5b 30 2d c6 86 09 45 c5 9f 3e +1ffff710: 15 a1 05 00 00 00 00 86 81 31 15 38 05 fa aa 55 +1ffff720: 75 05 1b 00 +Read 20 bytes +1ffff7e0: 80 00 ff ff ff ff ff ff cd ab de b7 78 bc 23 20 +1ffff7f0: 39 e3 39 e3 +``` + +Another CH32v203GBU6 +``` +1ffff700: 34 fe 78 dc 38 05 5b 30 2d c6 72 09 45 c5 9f 3e +1ffff710: 15 a1 05 00 00 00 00 86 81 31 15 38 05 fa aa 55 +1ffff720: 7c 05 1b 00 +Read 20 bytes +1ffff7e0: 80 00 ff ff ff ff ff ff cd ab c9 b7 78 bc 0e 20 +1ffff7f0: 39 e3 39 e3 +``` + +A ch32v203c8t6 +``` +1ffff700: 34 fe 78 dc 00 05 31 20 29 86 6d 09 05 00 3e c1 +1ffff710: ff ff ff ff 00 00 08 86 81 31 15 38 05 fa aa 55 +1ffff720: 7e 05 18 00 +Read 20 bytes +1ffff7e0: 40 00 ff ff ff ff ff ff cd ab 09 db 6a bc 40 43 +1ffff7f0: 39 e3 39 e3 +``` + +A ch32v203c8t6 +``` +1ffff700: 34 fe 78 dc 00 05 31 20 29 86 62 09 05 00 3e c1 +1ffff710: ff ff ff ff 00 00 08 86 81 31 15 38 05 fa aa 55 +1ffff720: 88 05 18 00 +Read 20 bytes +1ffff7e0: 40 00 ff ff ff ff ff ff cd ab e5 d6 6a bc 1c 3f +1ffff7f0: 39 e3 39 e3 +``` + +CH32X035F8U6 +``` +1ffff700: 34 fe 78 dc 11 06 5e 03 08 10 69 74 03 5a 00 00 +1ffff710: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff +1ffff720: ff ff ff ff +Read 20 bytes +1ffff7e0: 3e 00 ff ff ff ff ff ff cd ab 31 28 45 bc 43 90 +1ffff7f0: ff ff ff ff +``` + +CH32X035C8T6 +``` +1ffff700: 34 fe 78 dc 01 06 51 03 08 10 41 05 03 5a 00 00 +1ffff710: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff +1ffff720: ff ff ff ff +Read 20 bytes +1ffff7e0: 3e 00 ff ff ff ff ff ff cd ab bc 1f 48 bc d1 87 +1ffff7f0: ff ff ff ff +``` + +For a ch32v003 (QFN) +``` +1ffff700: 07 f8 98 a3 91 bb 13 07 10 0f 4d b1 13 07 e0 0f +1ffff710: 71 b9 33 86 e4 00 08 22 36 c6 3a c4 32 c2 b9 34 +1ffff720: 12 46 b2 46 +... +1ffff7e0: 10 00 ff ff ff ff ff ff cd ab 0c 78 0c bc e5 df +1ffff7f0: ff ff ff ff +``` + +Another ch32v003 (QFN) +``` +1ffff700: 12 00 00 00 03 03 09 04 88 06 00 00 0a 00 00 00 +1ffff710: 05 01 09 ff a1 01 75 08 95 7f 85 aa 09 ff b1 00 +1ffff720: c0 00 00 00 +Read 20 bytes +1ffff7e0: 10 00 ff ff ff ff ff ff cd ab 2d 6f 3d bc 37 d7 +1ffff7f0: ff ff ff ff +``` +For a ch32v003 (SOIC-8) (Different Lot) +``` +1ffff700: 07 f8 98 a3 91 bb 13 07 10 0f 4d b1 13 07 e0 0f +1ffff710: 71 b9 33 86 e4 00 08 22 36 c6 3a c4 32 c2 b9 34 +1ffff720: 12 46 b2 46 +Read 20 bytes +1ffff7e0: 10 00 ff ff ff ff ff ff cd ab 8d 3f c6 bc 20 a8 +1ffff7f0: ff ff ff ff +``` diff --git a/src/misc/attic/hardware_header_all_combined.h b/src/misc/attic/hardware_header_all_combined.h new file mode 100644 index 0000000..45c50e3 --- /dev/null +++ b/src/misc/attic/hardware_header_all_combined.h @@ -0,0 +1,12914 @@ +#ifndef TODO_HARDWARE_H +#define TODO_HARDWARE_H + +#include "ch32fun.h" + +#ifndef __ASSEMBLER__ // Things before this can be used in assembly. + +#ifdef __cplusplus +extern "C" { +#endif + +/* Interrupt Number Definition, according to the selected device */ +typedef enum IRQn +{ + /****** RISC-V Processor Exceptions Numbers *******************************************************/ + NonMaskableInt_IRQn = 2, /* 2 Non Maskable Interrupt */ + EXC_IRQn = 3, /* 3 Exception Interrupt */ +#if defined(CH32V20x) || defined(CH32V30x) + Ecall_M_Mode_IRQn = 5, /* 5 Ecall M Mode Interrupt */ + Ecall_U_Mode_IRQn = 8, /* 8 Ecall U Mode Interrupt */ + Break_Point_IRQn = 9, /* 9 Break Point Interrupt */ +#endif + SysTicK_IRQn = 12, /* 12 System timer Interrupt */ + Software_IRQn = 14, /* 14 software Interrupt */ + +#if defined(CH32V003) || defined(CH32X03x) + /****** RISC-V specific Interrupt Numbers *********************************************************/ + WWDG_IRQn = 16, /* Window WatchDog Interrupt */ + PVD_IRQn = 17, /* PVD through EXTI Line detection Interrupt */ + FLASH_IRQn = 18, /* FLASH global Interrupt */ + RCC_IRQn = 19, /* RCC global Interrupt */ + EXTI7_0_IRQn = 20, /* External Line[7:0] Interrupts */ + AWU_IRQn = 21, /* AWU global Interrupt */ + DMA1_Channel1_IRQn = 22, /* DMA1 Channel 1 global Interrupt */ + DMA1_Channel2_IRQn = 23, /* DMA1 Channel 2 global Interrupt */ + DMA1_Channel3_IRQn = 24, /* DMA1 Channel 3 global Interrupt */ + DMA1_Channel4_IRQn = 25, /* DMA1 Channel 4 global Interrupt */ + DMA1_Channel5_IRQn = 26, /* DMA1 Channel 5 global Interrupt */ + DMA1_Channel6_IRQn = 27, /* DMA1 Channel 6 global Interrupt */ + DMA1_Channel7_IRQn = 28, /* DMA1 Channel 7 global Interrupt */ + ADC_IRQn = 29, /* ADC global Interrupt */ + I2C1_EV_IRQn = 30, /* I2C1 Event Interrupt */ + I2C1_ER_IRQn = 31, /* I2C1 Error Interrupt */ + USART1_IRQn = 32, /* USART1 global Interrupt */ + SPI1_IRQn = 33, /* SPI1 global Interrupt */ + TIM1_BRK_IRQn = 34, /* TIM1 Break Interrupt */ + TIM1_UP_IRQn = 35, /* TIM1 Update Interrupt */ + TIM1_TRG_COM_IRQn = 36, /* TIM1 Trigger and Commutation Interrupt */ + TIM1_CC_IRQn = 37, /* TIM1 Capture Compare Interrupt */ + TIM2_IRQn = 38, /* TIM2 global Interrupt */ +#if defined(CH32X03x) + USART2_IRQn = 39, /* UART2 Interrupt */ + EXTI15_8_IRQn = 40, /* External Line[8:15] Interrupt */ + EXTI25_16_IRQn = 41, /* External Line[25:16] Interrupt */ + USART3_IRQn = 42, /* UART2 Interrupt */ + USART4_IRQn = 43, /* UART2 Interrupt */ + DMA1_Channel8_IRQn = 44, /* DMA1 Channel 8 global Interrupt */ + USBFS_IRQn = 45, /* USB Full-Speed Interrupt */ + USBFS_WakeUp_IRQn = 46, /* USB Full-Speed Wake-Up Interrupt */ + PIOC_IRQn = 47, /* Programmable IO Controller Interrupt */ + OPA_IRQn = 48, /* Op Amp Interrupt */ + USBPD_IRQn = 49, /* USB Power Delivery Interrupt */ + USBPD_WKUP_IRQn = 50, /* USB Power Delivery Wake-Up Interrupt */ + TIM2_CC_IRQn = 51, /* Timer 2 Compare Global Interrupt */ + TIM2_TRG_IRQn = 52, /* Timer 2 Trigger Global Interrupt */ + TIM2_BRK_IRQn = 53, /* Timer 2 Brk Global Interrupt */ + TIM3_IRQn = 54, /* Timer 3 Global Interrupt */ +#endif +#elif defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) + /****** RISC-V specific Interrupt Numbers *********************************************************/ + WWDG_IRQn = 16, /* Window WatchDog Interrupt */ + PVD_IRQn = 17, /* PVD through EXTI Line detection Interrupt */ + TAMPER_IRQn = 18, /* Tamper Interrupt */ + RTC_IRQn = 19, /* RTC global Interrupt */ + FLASH_IRQn = 20, /* FLASH global Interrupt */ + RCC_IRQn = 21, /* RCC global Interrupt */ + EXTI0_IRQn = 22, /* EXTI Line0 Interrupt */ + EXTI1_IRQn = 23, /* EXTI Line1 Interrupt */ + EXTI2_IRQn = 24, /* EXTI Line2 Interrupt */ + EXTI3_IRQn = 25, /* EXTI Line3 Interrupt */ + EXTI4_IRQn = 26, /* EXTI Line4 Interrupt */ + DMA1_Channel1_IRQn = 27, /* DMA1 Channel 1 global Interrupt */ + DMA1_Channel2_IRQn = 28, /* DMA1 Channel 2 global Interrupt */ + DMA1_Channel3_IRQn = 29, /* DMA1 Channel 3 global Interrupt */ + DMA1_Channel4_IRQn = 30, /* DMA1 Channel 4 global Interrupt */ + DMA1_Channel5_IRQn = 31, /* DMA1 Channel 5 global Interrupt */ + DMA1_Channel6_IRQn = 32, /* DMA1 Channel 6 global Interrupt */ + DMA1_Channel7_IRQn = 33, /* DMA1 Channel 7 global Interrupt */ + ADC_IRQn = 34, /* ADC1 and ADC2 global Interrupt */ +#if !defined(CH32V10x) // CH32V20x/30x only + USB_HP_CAN1_TX_IRQn = 35, /* USB Device High Priority or CAN1 TX Interrupts */ + USB_LP_CAN1_RX0_IRQn = 36, /* USB Device Low Priority or CAN1 RX0 Interrupts */ + CAN1_RX1_IRQn = 37, /* CAN1 RX1 Interrupt */ + CAN1_SCE_IRQn = 38, /* CAN1 SCE Interrupt */ +#endif + EXTI9_5_IRQn = 39, /* External Line[9:5] Interrupts */ + TIM1_BRK_IRQn = 40, /* TIM1 Break Interrupt */ + TIM1_UP_IRQn = 41, /* TIM1 Update Interrupt */ + TIM1_TRG_COM_IRQn = 42, /* TIM1 Trigger and Commutation Interrupt */ + TIM1_CC_IRQn = 43, /* TIM1 Capture Compare Interrupt */ + TIM2_IRQn = 44, /* TIM2 global Interrupt */ + TIM3_IRQn = 45, /* TIM3 global Interrupt */ + TIM4_IRQn = 46, /* TIM4 global Interrupt */ + I2C1_EV_IRQn = 47, /* I2C1 Event Interrupt */ + I2C1_ER_IRQn = 48, /* I2C1 Error Interrupt */ + I2C2_EV_IRQn = 49, /* I2C2 Event Interrupt */ + I2C2_ER_IRQn = 50, /* I2C2 Error Interrupt */ + SPI1_IRQn = 51, /* SPI1 global Interrupt */ + SPI2_IRQn = 52, /* SPI2 global Interrupt */ + USART1_IRQn = 53, /* USART1 global Interrupt */ + USART2_IRQn = 54, /* USART2 global Interrupt */ + USART3_IRQn = 55, /* USART3 global Interrupt */ + EXTI15_10_IRQn = 56, /* External Line[15:10] Interrupts */ + RTCAlarm_IRQn = 57, /* RTC Alarm through EXTI Line Interrupt */ +#endif +#if defined(CH32V10x) || defined(CH32V20x) + USBWakeUp_IRQn = 58, /* USB Device WakeUp from suspend through EXTI Line Interrupt */ + USBHD_IRQn = 59, /* USBHD global Interrupt */ +#endif +#if defined(CH32V20x) + USBHDWakeUp_IRQn = 60, /* USB Host/Device WakeUp Interrupt */ + +#ifdef CH32V20x_D6 + UART4_IRQn = 61, /* UART4 global Interrupt */ + DMA1_Channel8_IRQn = 62, /* DMA1 Channel 8 global Interrupt */ + +#elif defined(CH32V20x_D8) + ETH_IRQn = 61, /* ETH global Interrupt */ + ETHWakeUp_IRQn = 62, /* ETH WakeUp Interrupt */ + TIM5_IRQn = 65, /* TIM5 global Interrupt */ + UART4_IRQn = 66, /* UART4 global Interrupt */ + DMA1_Channel8_IRQn = 67, /* DMA1 Channel 8 global Interrupt */ + OSC32KCal_IRQn = 68, /* OSC32K global Interrupt */ + OSCWakeUp_IRQn = 69, /* OSC32K WakeUp Interrupt */ + +#elif defined(CH32V20x_D8W) + ETH_IRQn = 61, /* ETH global Interrupt */ + ETHWakeUp_IRQn = 62, /* ETH WakeUp Interrupt */ + BB_IRQn = 63, /* BLE BB global Interrupt */ + LLE_IRQn = 64, /* BLE LLE global Interrupt */ + TIM5_IRQn = 65, /* TIM5 global Interrupt */ + UART4_IRQn = 66, /* UART4 global Interrupt */ + DMA1_Channel8_IRQn = 67, /* DMA1 Channel 8 global Interrupt */ + OSC32KCal_IRQn = 68, /* OSC32K global Interrupt */ + OSCWakeUp_IRQn = 69, /* OSC32K WakeUp Interrupt */ +#endif + +#elif defined(CH32V30x) + +#ifdef CH32V30x_D8 + TIM8_BRK_IRQn = 59, /* TIM8 Break Interrupt */ +#elif defined (CH32V30x_D8C) + USBWakeUp_IRQn = 58, /* USB Device WakeUp from suspend through EXTI Line Interrupt */ + TIM8_BRK_IRQn = 59, /* TIM8 Break Interrupt */ +#endif + TIM8_UP_IRQn = 60, /* TIM8 Update Interrupt */ + TIM8_TRG_COM_IRQn = 61, /* TIM8 Trigger and Commutation Interrupt */ + TIM8_CC_IRQn = 62, /* TIM8 Capture Compare Interrupt */ + RNG_IRQn = 63, /* RNG global Interrupt */ + FSMC_IRQn = 64, /* FSMC global Interrupt */ + SDIO_IRQn = 65, /* SDIO global Interrupt */ + TIM5_IRQn = 66, /* TIM5 global Interrupt */ + SPI3_IRQn = 67, /* SPI3 global Interrupt */ + UART4_IRQn = 68, /* UART4 global Interrupt */ + UART5_IRQn = 69, /* UART5 global Interrupt */ +#endif + +#if defined(CH32V30x) + TIM6_IRQn = 70, /* TIM6 global Interrupt */ + TIM7_IRQn = 71, /* TIM7 global Interrupt */ + DMA2_Channel1_IRQn = 72, /* DMA2 Channel 1 global Interrupt */ + DMA2_Channel2_IRQn = 73, /* DMA2 Channel 2 global Interrupt */ + DMA2_Channel3_IRQn = 74, /* DMA2 Channel 3 global Interrupt */ + DMA2_Channel4_IRQn = 75, /* DMA2 Channel 4 global Interrupt */ + DMA2_Channel5_IRQn = 76, /* DMA2 Channel 5 global Interrupt */ + ETH_IRQn = 77, /* ETH global Interrupt */ + OTG_FS_IRQn = 83, /* OTGFS global Interrupt NOTE: THIS APPEAR TO BE INCORRECT */ + USBHSWakeup_IRQn = 84, /* USBHS Wakeup Interrupt */ + USBHS_IRQn = 85, /* USBHS global Interrupt */ + DVP_IRQn = 86, /* DVP global Interrupt */ + UART6_IRQn = 87, /* UART6 global Interrupt */ + UART7_IRQn = 88, /* UART7 global Interrupt */ + UART8_IRQn = 89, /* UART8 global Interrupt */ + TIM9_BRK_IRQn = 90, /* TIM9 Break Interrupt */ + TIM9_UP_IRQn = 91, /* TIM9 Update Interrupt */ + TIM9_TRG_COM_IRQn = 92, /* TIM9 Trigger and Commutation Interrupt */ + TIM9_CC_IRQn = 93, /* TIM9 Capture Compare Interrupt */ + TIM10_BRK_IRQn = 94, /* TIM10 Break Interrupt */ + TIM10_UP_IRQn = 95, /* TIM10 Update Interrupt */ + TIM10_TRG_COM_IRQn = 96, /* TIM10 Trigger and Commutation Interrupt */ + TIM10_CC_IRQn = 97, /* TIM10 Capture Compare Interrupt */ + DMA2_Channel6_IRQn = 98, /* DMA2 Channel 6 global Interrupt */ + DMA2_Channel7_IRQn = 99, /* DMA2 Channel 7 global Interrupt */ + DMA2_Channel8_IRQn = 100, /* DMA2 Channel 8 global Interrupt */ + DMA2_Channel9_IRQn = 101, /* DMA2 Channel 9 global Interrupt */ + DMA2_Channel10_IRQn = 102, /* DMA2 Channel 10 global Interrupt */ + DMA2_Channel11_IRQn = 103, /* DMA2 Channel 11 global Interrupt */ +#endif + +} IRQn_Type; + + +#if defined (CH32V003) + +/* memory mapped structure for SysTick */ +typedef struct +{ + __IO uint32_t CTLR; + __IO uint32_t SR; + __IO uint32_t CNT; + uint32_t RESERVED0; + __IO uint32_t CMP; + uint32_t RESERVED1; +} SysTick_Type; + +#elif defined(CH32V20x) || defined(CH32V30x) + +/* memory mapped structure for SysTick */ +typedef struct +{ + __IO uint32_t CTLR; + __IO uint32_t SR; + __IO uint64_t CNT; + __IO uint64_t CMP; +} SysTick_Type; + +#elif defined(CH32X03x) + +/* memory mapped structure for SysTick */ +typedef struct +{ + __IO uint32_t CTLR; + __IO uint32_t SR; + __IO uint32_t CNTL; + __IO uint32_t CNTH; + __IO uint32_t CMPL; + __IO uint32_t CMPH; +} SysTick_Type; + +#elif defined(CH32V10x) + +/* memory mapped structure for SysTick */ +typedef struct +{ + __IO uint32_t CTLR; + __IO uint32_t CNTL; + __IO uint32_t CNTH; + __IO uint32_t CMPL; + __IO uint32_t CMPH; +} SysTick_Type; + +#endif + +#endif /* __ASSEMBLER__*/ + +#define HardFault_IRQn EXC_IRQn + +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) || defined(CH32X03x) + #define ADC1_2_IRQn ADC_IRQn +#endif + +/* Standard Peripheral Library old definitions (maintained for legacy purpose) */ +#define HSI_Value HSI_VALUE +#define HSE_Value HSE_VALUE +#define HSEStartUp_TimeOut HSE_STARTUP_TIMEOUT + +#ifndef __ASSEMBLER__ +/* Analog to Digital Converter */ +typedef struct +{ + __IO uint32_t STATR; + __IO uint32_t CTLR1; + __IO uint32_t CTLR2; + __IO uint32_t SAMPTR1; + __IO uint32_t SAMPTR2; + __IO uint32_t IOFR1; + __IO uint32_t IOFR2; + __IO uint32_t IOFR3; + __IO uint32_t IOFR4; + __IO uint32_t WDHTR; + __IO uint32_t WDLTR; + __IO uint32_t RSQR1; + __IO uint32_t RSQR2; + __IO uint32_t RSQR3; + __IO uint32_t ISQR; + __IO uint32_t IDATAR1; + __IO uint32_t IDATAR2; + __IO uint32_t IDATAR3; + __IO uint32_t IDATAR4; + __IO uint32_t RDATAR; +#if defined(CH32V20x) + __IO uint32_t DLYR; +#elif defined(CH32X03x) + __IO uint32_t CTLR3; + __IO uint32_t WDTR1; + __IO uint32_t WDTR2; + __IO uint32_t WDTR3; +#endif +} ADC_TypeDef; + +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +/* Backup Registers */ +typedef struct +{ + uint32_t RESERVED0; + __IO uint16_t DATAR1; + uint16_t RESERVED1; + __IO uint16_t DATAR2; + uint16_t RESERVED2; + __IO uint16_t DATAR3; + uint16_t RESERVED3; + __IO uint16_t DATAR4; + uint16_t RESERVED4; + __IO uint16_t DATAR5; + uint16_t RESERVED5; + __IO uint16_t DATAR6; + uint16_t RESERVED6; + __IO uint16_t DATAR7; + uint16_t RESERVED7; + __IO uint16_t DATAR8; + uint16_t RESERVED8; + __IO uint16_t DATAR9; + uint16_t RESERVED9; + __IO uint16_t DATAR10; + uint16_t RESERVED10; + __IO uint16_t OCTLR; + uint16_t RESERVED11; + __IO uint16_t TPCTLR; + uint16_t RESERVED12; + __IO uint16_t TPCSR; + uint16_t RESERVED13[5]; + __IO uint16_t DATAR11; + uint16_t RESERVED14; + __IO uint16_t DATAR12; + uint16_t RESERVED15; + __IO uint16_t DATAR13; + uint16_t RESERVED16; + __IO uint16_t DATAR14; + uint16_t RESERVED17; + __IO uint16_t DATAR15; + uint16_t RESERVED18; + __IO uint16_t DATAR16; + uint16_t RESERVED19; + __IO uint16_t DATAR17; + uint16_t RESERVED20; + __IO uint16_t DATAR18; + uint16_t RESERVED21; + __IO uint16_t DATAR19; + uint16_t RESERVED22; + __IO uint16_t DATAR20; + uint16_t RESERVED23; + __IO uint16_t DATAR21; + uint16_t RESERVED24; + __IO uint16_t DATAR22; + uint16_t RESERVED25; + __IO uint16_t DATAR23; + uint16_t RESERVED26; + __IO uint16_t DATAR24; + uint16_t RESERVED27; + __IO uint16_t DATAR25; + uint16_t RESERVED28; + __IO uint16_t DATAR26; + uint16_t RESERVED29; + __IO uint16_t DATAR27; + uint16_t RESERVED30; + __IO uint16_t DATAR28; + uint16_t RESERVED31; + __IO uint16_t DATAR29; + uint16_t RESERVED32; + __IO uint16_t DATAR30; + uint16_t RESERVED33; + __IO uint16_t DATAR31; + uint16_t RESERVED34; + __IO uint16_t DATAR32; + uint16_t RESERVED35; + __IO uint16_t DATAR33; + uint16_t RESERVED36; + __IO uint16_t DATAR34; + uint16_t RESERVED37; + __IO uint16_t DATAR35; + uint16_t RESERVED38; + __IO uint16_t DATAR36; + uint16_t RESERVED39; + __IO uint16_t DATAR37; + uint16_t RESERVED40; + __IO uint16_t DATAR38; + uint16_t RESERVED41; + __IO uint16_t DATAR39; + uint16_t RESERVED42; + __IO uint16_t DATAR40; + uint16_t RESERVED43; + __IO uint16_t DATAR41; + uint16_t RESERVED44; + __IO uint16_t DATAR42; + uint16_t RESERVED45; +} BKP_TypeDef; +#endif + +#if defined(CH32V20x) || defined(CH32V30x) +/* Controller Area Network TxMailBox */ +typedef struct +{ + __IO uint32_t TXMIR; + __IO uint32_t TXMDTR; + __IO uint32_t TXMDLR; + __IO uint32_t TXMDHR; +} CAN_TxMailBox_TypeDef; + +/* Controller Area Network FIFOMailBox */ +typedef struct +{ + __IO uint32_t RXMIR; + __IO uint32_t RXMDTR; + __IO uint32_t RXMDLR; + __IO uint32_t RXMDHR; +} CAN_FIFOMailBox_TypeDef; + +/* Controller Area Network FilterRegister */ +typedef struct +{ + __IO uint32_t FR1; + __IO uint32_t FR2; +} CAN_FilterRegister_TypeDef; + +/* Controller Area Network */ +typedef struct +{ + __IO uint32_t CTLR; + __IO uint32_t STATR; + __IO uint32_t TSTATR; + __IO uint32_t RFIFO0; + __IO uint32_t RFIFO1; + __IO uint32_t INTENR; + __IO uint32_t ERRSR; + __IO uint32_t BTIMR; + uint32_t RESERVED0[88]; + CAN_TxMailBox_TypeDef sTxMailBox[3]; + CAN_FIFOMailBox_TypeDef sFIFOMailBox[2]; + uint32_t RESERVED1[12]; + __IO uint32_t FCTLR; + __IO uint32_t FMCFGR; + uint32_t RESERVED2; + __IO uint32_t FSCFGR; + uint32_t RESERVED3; + __IO uint32_t FAFIFOR; + uint32_t RESERVED4; + __IO uint32_t FWR; + uint32_t RESERVED5[8]; + CAN_FilterRegister_TypeDef sFilterRegister[28]; +} CAN_TypeDef; +#endif + +/* CRC Calculation Unit */ +typedef struct +{ + __IO uint32_t DATAR; + __IO uint8_t IDATAR; + uint8_t RESERVED0; + uint16_t RESERVED1; + __IO uint32_t CTLR; +} CRC_TypeDef; + +#if defined(CH32V10x) || defined(CH32V30x) +/* Digital to Analog Converter */ +typedef struct +{ + __IO uint32_t CTLR; + __IO uint32_t SWTR; + __IO uint32_t R12BDHR1; + __IO uint32_t L12BDHR1; + __IO uint32_t R8BDHR1; + __IO uint32_t R12BDHR2; + __IO uint32_t L12BDHR2; + __IO uint32_t R8BDHR2; + __IO uint32_t RD12BDHR; + __IO uint32_t LD12BDHR; + __IO uint32_t RD8BDHR; + __IO uint32_t DOR1; + __IO uint32_t DOR2; +} DAC_TypeDef; +#endif + +/* Debug MCU */ +typedef struct +{ + __IO uint32_t CFGR0; + __IO uint32_t CFGR1; +} DBGMCU_TypeDef; + +/* DMA Controller */ +typedef struct +{ + __IO uint32_t CFGR; + __IO uint32_t CNTR; + __IO uint32_t PADDR; + __IO uint32_t MADDR; +} DMA_Channel_TypeDef; + +typedef struct +{ + __IO uint32_t INTFR; + __IO uint32_t INTFCR; +} DMA_TypeDef; + +/* External Interrupt/Event Controller */ +typedef struct +{ + __IO uint32_t INTENR; + __IO uint32_t EVENR; + __IO uint32_t RTENR; + __IO uint32_t FTENR; + __IO uint32_t SWIEVR; + __IO uint32_t INTFR; +} EXTI_TypeDef; + +/* FLASH Registers */ +typedef struct +{ + __IO uint32_t ACTLR; + __IO uint32_t KEYR; + __IO uint32_t OBKEYR; + __IO uint32_t STATR; + __IO uint32_t CTLR; + __IO uint32_t ADDR; + __IO uint32_t RESERVED; + __IO uint32_t OBR; + __IO uint32_t WPR; + __IO uint32_t MODEKEYR; +#ifdef CH32V003 + __IO uint32_t BOOT_MODEKEYR; +#endif +} FLASH_TypeDef; + +/* Option Bytes Registers */ +typedef struct +{ + __IO uint16_t RDPR; + __IO uint16_t USER; + __IO uint16_t Data0; + __IO uint16_t Data1; + __IO uint16_t WRPR0; + __IO uint16_t WRPR1; +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) + __IO uint16_t WRPR2; + __IO uint16_t WRPR3; +#endif +} OB_TypeDef; + +typedef struct +{ + __IO uint16_t CAP; + __IO uint16_t RES1; + __IO uint32_t RES2; + __IO uint32_t UID0; + __IO uint32_t UID1; + __IO uint32_t UID2; + __IO uint32_t RES3; +} ESG_TypeDef; + +typedef struct +{ + union + { + __I uint32_t CHIPID; + struct + { + __I uint16_t REVID; + __I uint16_t DEVID; + }; + }; +} INFO_TypeDef; + +#if defined(CH32V30x) +/* FSMC Bank1 Registers */ +typedef struct +{ + __IO uint32_t BTCR[8]; +} FSMC_Bank1_TypeDef; + +/* FSMC Bank1E Registers */ +typedef struct +{ + __IO uint32_t BWTR[7]; +} FSMC_Bank1E_TypeDef; + +/* FSMC Bank2 Registers */ +typedef struct +{ + __IO uint32_t PCR2; + __IO uint32_t SR2; + __IO uint32_t PMEM2; + __IO uint32_t PATT2; + uint32_t RESERVED0; + __IO uint32_t ECCR2; +} FSMC_Bank2_TypeDef; +#endif + +/* General Purpose I/O */ +typedef enum +{ + GPIO_CFGLR_IN_ANALOG = 0, + GPIO_CFGLR_IN_FLOAT = 4, + GPIO_CFGLR_IN_PUPD = 8, + GPIO_CFGLR_OUT_10Mhz_PP = 1, + GPIO_CFGLR_OUT_2Mhz_PP = 2, + GPIO_CFGLR_OUT_50Mhz_PP = 3, + GPIO_CFGLR_OUT_10Mhz_OD = 5, + GPIO_CFGLR_OUT_2Mhz_OD = 6, + GPIO_CFGLR_OUT_50Mhz_OD = 7, + GPIO_CFGLR_OUT_10Mhz_AF_PP = 9, + GPIO_CFGLR_OUT_2Mhz_AF_PP = 10, + GPIO_CFGLR_OUT_50Mhz_AF_PP = 11, + GPIO_CFGLR_OUT_10Mhz_AF_OD = 13, + GPIO_CFGLR_OUT_2Mhz_AF_OD = 14, + GPIO_CFGLR_OUT_50Mhz_AF_OD = 15, +} GPIO_CFGLR_PIN_MODE_Typedef; + +typedef union { + uint32_t __FULL; + struct { + GPIO_CFGLR_PIN_MODE_Typedef PIN0 :4; + GPIO_CFGLR_PIN_MODE_Typedef PIN1 :4; + GPIO_CFGLR_PIN_MODE_Typedef PIN2 :4; + GPIO_CFGLR_PIN_MODE_Typedef PIN3 :4; + GPIO_CFGLR_PIN_MODE_Typedef PIN4 :4; + GPIO_CFGLR_PIN_MODE_Typedef PIN5 :4; + GPIO_CFGLR_PIN_MODE_Typedef PIN6 :4; + GPIO_CFGLR_PIN_MODE_Typedef PIN7 :4; + }; +} GPIO_CFGLR_t; +typedef union { + uint32_t __FULL; + const struct { + uint32_t IDR0 :1; + uint32_t IDR1 :1; + uint32_t IDR2 :1; + uint32_t IDR3 :1; + uint32_t IDR4 :1; + uint32_t IDR5 :1; + uint32_t IDR6 :1; + uint32_t IDR7 :1; + uint32_t :24; + }; +} GPIO_INDR_t; +typedef union { + uint32_t __FULL; + struct { + uint32_t ODR0 :1; + uint32_t ODR1 :1; + uint32_t ODR2 :1; + uint32_t ODR3 :1; + uint32_t ODR4 :1; + uint32_t ODR5 :1; + uint32_t ODR6 :1; + uint32_t ODR7 :1; + uint32_t :24; + }; +} GPIO_OUTDR_t; +typedef union { + uint32_t __FULL; + struct { + uint32_t BS0 :1; + uint32_t BS1 :1; + uint32_t BS2 :1; + uint32_t BS3 :1; + uint32_t BS4 :1; + uint32_t BS5 :1; + uint32_t BS6 :1; + uint32_t BS7 :1; + uint32_t :8; + uint32_t BR0 :1; + uint32_t BR1 :1; + uint32_t BR2 :1; + uint32_t BR3 :1; + uint32_t BR4 :1; + uint32_t BR5 :1; + uint32_t BR6 :1; + uint32_t BR7 :1; + uint32_t :8; + }; +} GPIO_BSHR_t; +typedef union { + uint32_t __FULL; + struct { + uint32_t BR0 :1; + uint32_t BR1 :1; + uint32_t BR2 :1; + uint32_t BR3 :1; + uint32_t BR4 :1; + uint32_t BR5 :1; + uint32_t BR6 :1; + uint32_t BR7 :1; + uint32_t :24; + }; +} GPIO_BCR_t; +typedef union { + uint32_t __FULL; + struct { + uint32_t LCK0 :1; + uint32_t LCK1 :1; + uint32_t LCK2 :1; + uint32_t LCK3 :1; + uint32_t LCK4 :1; + uint32_t LCK5 :1; + uint32_t LCK6 :1; + uint32_t LCK7 :1; + uint32_t LCKK :1; + uint32_t :23; + }; +} GPIO_LCKR_t; +typedef struct +{ + __IO uint32_t CFGLR; + __IO uint32_t CFGHR; + __I uint32_t INDR; + __IO uint32_t OUTDR; + __IO uint32_t BSHR; + __IO uint32_t BCR; + __IO uint32_t LCKR; +#ifdef CH32X03x + __IO uint32_t CFGXR; + __IO uint32_t BSXR; +#endif +} GPIO_TypeDef; + +#define DYN_GPIO_READ(gpio, field) ((GPIO_##field##_t) { .__FULL = gpio->field }) +#define DYN_GPIO_WRITE(gpio, field, ...) gpio->field = ((const GPIO_##field##_t) __VA_ARGS__).__FULL +#define DYN_GPIO_MOD(gpio, field, reg, val) {GPIO_##field##_t tmp; tmp.__FULL = gpio->field; tmp.reg = val; gpio->field = tmp.__FULL;} + +/* Alternate Function I/O */ +typedef struct +{ +#ifdef CH32V003 + uint32_t RESERVED0; + __IO uint32_t PCFR1; + __IO uint32_t EXTICR; +#elif defined(CH32X03x) + uint32_t RESERVED0; + __IO uint32_t PCFR1; + __IO uint32_t EXTICR1; + __IO uint32_t EXTICR2; + uint32_t RESERVED1; + uint32_t RESERVED2; + __IO uint32_t CTLR; +#elif defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) + __IO uint32_t ECR; + __IO uint32_t PCFR1; + __IO uint32_t EXTICR[4]; + uint32_t RESERVED0; + __IO uint32_t PCFR2; +#endif +} AFIO_TypeDef; + +/* Inter Integrated Circuit Interface */ +typedef struct +{ + __IO uint16_t CTLR1; + uint16_t RESERVED0; + __IO uint16_t CTLR2; + uint16_t RESERVED1; + __IO uint16_t OADDR1; + uint16_t RESERVED2; + __IO uint16_t OADDR2; + uint16_t RESERVED3; + __IO uint16_t DATAR; + uint16_t RESERVED4; + __IO uint16_t STAR1; + uint16_t RESERVED5; + __IO uint16_t STAR2; + uint16_t RESERVED6; + __IO uint16_t CKCFGR; + uint16_t RESERVED7; +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) + __IO uint16_t RTR; + uint16_t RESERVED8; +#endif +} I2C_TypeDef; + +/* Independent WatchDog */ +typedef struct +{ + __IO uint32_t CTLR; + __IO uint32_t PSCR; + __IO uint32_t RLDR; + __IO uint32_t STATR; +} IWDG_TypeDef; + +/* Power Control */ +typedef struct +{ + __IO uint32_t CTLR; + __IO uint32_t CSR; +#ifdef CH32V003 // AWU is CH32V003-only + __IO uint32_t AWUCSR; + __IO uint32_t AWUWR; + __IO uint32_t AWUPSC; +#endif +} PWR_TypeDef; + +/* Reset and Clock Control */ +typedef struct +{ + __IO uint32_t CTLR; + __IO uint32_t CFGR0; + __IO uint32_t INTR; + __IO uint32_t APB2PRSTR; + __IO uint32_t APB1PRSTR; + __IO uint32_t AHBPCENR; + __IO uint32_t APB2PCENR; + __IO uint32_t APB1PCENR; +#ifdef CH32V003 + __IO uint32_t RESERVED0; +#elif defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) + __IO uint32_t BDCTLR; +#endif + __IO uint32_t RSTSCKR; +#if defined(CH32V20x) || defined(CH32V30x) + __IO uint32_t AHBRSTR; + __IO uint32_t CFGR2; +#endif +} RCC_TypeDef; + +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +/* Real-Time Clock */ +typedef struct +{ + __IO uint16_t CTLRH; + uint16_t RESERVED0; + __IO uint16_t CTLRL; + uint16_t RESERVED1; + __IO uint16_t PSCRH; + uint16_t RESERVED2; + __IO uint16_t PSCRL; + uint16_t RESERVED3; + __IO uint16_t DIVH; + uint16_t RESERVED4; + __IO uint16_t DIVL; + uint16_t RESERVED5; + __IO uint16_t CNTH; + uint16_t RESERVED6; + __IO uint16_t CNTL; + uint16_t RESERVED7; + __IO uint16_t ALRMH; + uint16_t RESERVED8; + __IO uint16_t ALRML; + uint16_t RESERVED9; +} RTC_TypeDef; +#endif + +#if defined(CH32V30x) +/* SDIO Registers */ +typedef struct +{ + __IO uint32_t POWER; + __IO uint32_t CLKCR; + __IO uint32_t ARG; + __IO uint32_t CMD; + __I uint32_t RESPCMD; + __I uint32_t RESP1; + __I uint32_t RESP2; + __I uint32_t RESP3; + __I uint32_t RESP4; + __IO uint32_t DTIMER; + __IO uint32_t DLEN; + __IO uint32_t DCTRL; + __I uint32_t DCOUNT; + __I uint32_t STA; + __IO uint32_t ICR; + __IO uint32_t MASK; + uint32_t RESERVED0[2]; + __I uint32_t FIFOCNT; + uint32_t RESERVED1[13]; + __IO uint32_t FIFO; +} SDIO_TypeDef; +#endif + +/* Serial Peripheral Interface */ +typedef struct +{ + __IO uint16_t CTLR1; + uint16_t RESERVED0; + __IO uint16_t CTLR2; + uint16_t RESERVED1; + __IO uint16_t STATR; + uint16_t RESERVED2; + __IO uint16_t DATAR; + uint16_t RESERVED3; + __IO uint16_t CRCR; + uint16_t RESERVED4; + __IO uint16_t RCRCR; + uint16_t RESERVED5; + __IO uint16_t TCRCR; + uint16_t RESERVED6; +#ifdef CH32V003 + uint32_t RESERVED7; + uint32_t RESERVED8; +#elif defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) + __IO uint16_t I2SCFGR; + uint16_t RESERVED7; + __IO uint16_t I2SPR; + uint16_t RESERVED8; +#endif +#if !defined(CH32V10x) + __IO uint16_t HSCR; + uint16_t RESERVED9; +#endif +} SPI_TypeDef; + +/* TIM */ +typedef struct +{ + __IO uint16_t CTLR1; + uint16_t RESERVED0; + __IO uint16_t CTLR2; + uint16_t RESERVED1; + __IO uint16_t SMCFGR; + uint16_t RESERVED2; + __IO uint16_t DMAINTENR; + uint16_t RESERVED3; + __IO uint16_t INTFR; + uint16_t RESERVED4; + __IO uint16_t SWEVGR; + uint16_t RESERVED5; + __IO uint16_t CHCTLR1; + uint16_t RESERVED6; + __IO uint16_t CHCTLR2; + uint16_t RESERVED7; + __IO uint16_t CCER; + uint16_t RESERVED8; + __IO uint16_t CNT; + uint16_t RESERVED9; + __IO uint16_t PSC; + uint16_t RESERVED10; + __IO uint16_t ATRLR; + uint16_t RESERVED11; + __IO uint16_t RPTCR; + uint16_t RESERVED12; +#ifdef CH32V003 + __IO uint32_t CH1CVR; + __IO uint32_t CH2CVR; + __IO uint32_t CH3CVR; + __IO uint32_t CH4CVR; + __IO uint16_t BDTR; + uint16_t RESERVED13; + __IO uint16_t DMACFGR; + uint16_t RESERVED14; + __IO uint16_t DMAADR; + uint16_t RESERVED15; +#elif defined(CH32X03x) + __IO uint32_t CH1CVR; + __IO uint32_t CH2CVR; + __IO uint32_t CH3CVR; + __IO uint32_t CH4CVR; + __IO uint16_t BDTR; + uint16_t RESERVED13; + __IO uint16_t DMACFGR; + uint16_t RESERVED14; + __IO uint16_t DMAADR; + uint16_t RESERVED15; + __IO uint16_t SPEC; + uint16_t RESERVED16; +#elif defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) + __IO uint16_t CH1CVR; + uint16_t RESERVED13; + __IO uint16_t CH2CVR; + uint16_t RESERVED14; + __IO uint16_t CH3CVR; + uint16_t RESERVED15; + __IO uint16_t CH4CVR; + uint16_t RESERVED16; + __IO uint16_t BDTR; + uint16_t RESERVED17; + __IO uint16_t DMACFGR; + uint16_t RESERVED18; + __IO uint16_t DMAADR; + uint16_t RESERVED19; +#endif +} TIM_TypeDef; + +/* Universal Synchronous Asynchronous Receiver Transmitter */ +typedef struct +{ + __IO uint16_t STATR; + uint16_t RESERVED0; + __IO uint16_t DATAR; + uint16_t RESERVED1; + __IO uint16_t BRR; + uint16_t RESERVED2; + __IO uint16_t CTLR1; + uint16_t RESERVED3; + __IO uint16_t CTLR2; + uint16_t RESERVED4; + __IO uint16_t CTLR3; + uint16_t RESERVED5; + __IO uint16_t GPR; + uint16_t RESERVED6; +} USART_TypeDef; + +/* Window WatchDog */ +typedef struct +{ + __IO uint32_t CTLR; + __IO uint32_t CFGR; + __IO uint32_t STATR; +} WWDG_TypeDef; + +/* Enhanced Registers */ +typedef struct +{ + __IO uint32_t EXTEN_CTR; +} EXTEN_TypeDef; + +/* The reference manual for the ch32v2xx/v3xx reference this as "CTR" field in the "EXTEND" register so adding an alias here. */ +typedef struct +{ + __IO uint32_t CTR; +} EXTEND_TypeDef; + + +#if defined(CH32V20x) || defined(CH32V30x) +/* OPA Registers */ +typedef struct +{ + __IO uint32_t CR; +} OPA_TypeDef; + +#if defined(CH32V30x) +/* RNG Registers */ +typedef struct +{ + __IO uint32_t CR; + __IO uint32_t SR; + __IO uint32_t DR; +} RNG_TypeDef; + +/* DVP Registers */ +typedef struct +{ + __IO uint8_t CR0; + __IO uint8_t CR1; + __IO uint8_t IER; + __IO uint8_t Reserved0; + __IO uint16_t ROW_NUM; + __IO uint16_t COL_NUM; + __IO uint32_t DMA_BUF0; + __IO uint32_t DMA_BUF1; + __IO uint8_t IFR; + __IO uint8_t STATUS; + __IO uint16_t Reserved1; + __IO uint16_t ROW_CNT; + __IO uint16_t Reserved2; + __IO uint16_t HOFFCNT; + __IO uint16_t VST; + __IO uint16_t CAPCNT; + __IO uint16_t VLINE; + __IO uint32_t DR; +} DVP_TypeDef; + +/* USBHS Registers */ +typedef struct +{ + __IO uint8_t CONTROL; + __IO uint8_t HOST_CTRL; + __IO uint8_t INT_EN; + __IO uint8_t DEV_AD; + __IO uint16_t FRAME_NO; + __IO uint8_t SUSPEND; + __IO uint8_t RESERVED0; + __IO uint8_t SPEED_TYPE; + __IO uint8_t MIS_ST; + __IO uint8_t INT_FG; + __IO uint8_t INT_ST; + __IO uint16_t RX_LEN; + __IO uint16_t RESERVED1; + __IO uint32_t ENDP_CONFIG; + __IO uint32_t ENDP_TYPE; + __IO uint32_t BUF_MODE; + __IO uint32_t UEP0_DMA; + __IO uint32_t UEP1_RX_DMA; + __IO uint32_t UEP2_RX_DMA; + __IO uint32_t UEP3_RX_DMA; + __IO uint32_t UEP4_RX_DMA; + __IO uint32_t UEP5_RX_DMA; + __IO uint32_t UEP6_RX_DMA; + __IO uint32_t UEP7_RX_DMA; + __IO uint32_t UEP8_RX_DMA; + __IO uint32_t UEP9_RX_DMA; + __IO uint32_t UEP10_RX_DMA; + __IO uint32_t UEP11_RX_DMA; + __IO uint32_t UEP12_RX_DMA; + __IO uint32_t UEP13_RX_DMA; + __IO uint32_t UEP14_RX_DMA; + __IO uint32_t UEP15_RX_DMA; + __IO uint32_t UEP1_TX_DMA; + __IO uint32_t UEP2_TX_DMA; + __IO uint32_t UEP3_TX_DMA; + __IO uint32_t UEP4_TX_DMA; + __IO uint32_t UEP5_TX_DMA; + __IO uint32_t UEP6_TX_DMA; + __IO uint32_t UEP7_TX_DMA; + __IO uint32_t UEP8_TX_DMA; + __IO uint32_t UEP9_TX_DMA; + __IO uint32_t UEP10_TX_DMA; + __IO uint32_t UEP11_TX_DMA; + __IO uint32_t UEP12_TX_DMA; + __IO uint32_t UEP13_TX_DMA; + __IO uint32_t UEP14_TX_DMA; + __IO uint32_t UEP15_TX_DMA; + __IO uint16_t UEP0_MAX_LEN; + __IO uint16_t RESERVED2; + __IO uint16_t UEP1_MAX_LEN; + __IO uint16_t RESERVED3; + __IO uint16_t UEP2_MAX_LEN; + __IO uint16_t RESERVED4; + __IO uint16_t UEP3_MAX_LEN; + __IO uint16_t RESERVED5; + __IO uint16_t UEP4_MAX_LEN; + __IO uint16_t RESERVED6; + __IO uint16_t UEP5_MAX_LEN; + __IO uint16_t RESERVED7; + __IO uint16_t UEP6_MAX_LEN; + __IO uint16_t RESERVED8; + __IO uint16_t UEP7_MAX_LEN; + __IO uint16_t RESERVED9; + __IO uint16_t UEP8_MAX_LEN; + __IO uint16_t RESERVED10; + __IO uint16_t UEP9_MAX_LEN; + __IO uint16_t RESERVED11; + __IO uint16_t UEP10_MAX_LEN; + __IO uint16_t RESERVED12; + __IO uint16_t UEP11_MAX_LEN; + __IO uint16_t RESERVED13; + __IO uint16_t UEP12_MAX_LEN; + __IO uint16_t RESERVED14; + __IO uint16_t UEP13_MAX_LEN; + __IO uint16_t RESERVED15; + __IO uint16_t UEP14_MAX_LEN; + __IO uint16_t RESERVED16; + __IO uint16_t UEP15_MAX_LEN; + __IO uint16_t RESERVED17; + __IO uint16_t UEP0_TX_LEN; + __IO uint8_t UEP0_TX_CTRL; + __IO uint8_t UEP0_RX_CTRL; + __IO uint16_t UEP1_TX_LEN; + __IO uint8_t UEP1_TX_CTRL; + __IO uint8_t UEP1_RX_CTRL; + __IO uint16_t UEP2_TX_LEN; + __IO uint8_t UEP2_TX_CTRL; + __IO uint8_t UEP2_RX_CTRL; + __IO uint16_t UEP3_TX_LEN; + __IO uint8_t UEP3_TX_CTRL; + __IO uint8_t UEP3_RX_CTRL; + __IO uint16_t UEP4_TX_LEN; + __IO uint8_t UEP4_TX_CTRL; + __IO uint8_t UEP4_RX_CTRL; + __IO uint16_t UEP5_TX_LEN; + __IO uint8_t UEP5_TX_CTRL; + __IO uint8_t UEP5_RX_CTRL; + __IO uint16_t UEP6_TX_LEN; + __IO uint8_t UEP6_TX_CTRL; + __IO uint8_t UEP6_RX_CTRL; + __IO uint16_t UEP7_TX_LEN; + __IO uint8_t UEP7_TX_CTRL; + __IO uint8_t UEP7_RX_CTRL; + __IO uint16_t UEP8_TX_LEN; + __IO uint8_t UEP8_TX_CTRL; + __IO uint8_t UEP8_RX_CTRL; + __IO uint16_t UEP9_TX_LEN; + __IO uint8_t UEP9_TX_CTRL; + __IO uint8_t UEP9_RX_CTRL; + __IO uint16_t UEP10_TX_LEN; + __IO uint8_t UEP10_TX_CTRL; + __IO uint8_t UEP10_RX_CTRL; + __IO uint16_t UEP11_TX_LEN; + __IO uint8_t UEP11_TX_CTRL; + __IO uint8_t UEP11_RX_CTRL; + __IO uint16_t UEP12_TX_LEN; + __IO uint8_t UEP12_TX_CTRL; + __IO uint8_t UEP12_RX_CTRL; + __IO uint16_t UEP13_TX_LEN; + __IO uint8_t UEP13_TX_CTRL; + __IO uint8_t UEP13_RX_CTRL; + __IO uint16_t UEP14_TX_LEN; + __IO uint8_t UEP14_TX_CTRL; + __IO uint8_t UEP14_RX_CTRL; + __IO uint16_t UEP15_TX_LEN; + __IO uint8_t UEP15_TX_CTRL; + __IO uint8_t UEP15_RX_CTRL; +} USBHSD_TypeDef; + +typedef struct __attribute__((packed)) +{ + __IO uint8_t CONTROL; + __IO uint8_t HOST_CTRL; + __IO uint8_t INT_EN; + __IO uint8_t DEV_AD; + __IO uint16_t FRAME_NO; + __IO uint8_t SUSPEND; + __IO uint8_t RESERVED0; + __IO uint8_t SPEED_TYPE; + __IO uint8_t MIS_ST; + __IO uint8_t INT_FG; + __IO uint8_t INT_ST; + __IO uint16_t RX_LEN; + __IO uint16_t RESERVED1; + __IO uint32_t HOST_EP_CONFIG; + __IO uint32_t HOST_EP_TYPE; + __IO uint32_t RESERVED2; + __IO uint32_t RESERVED3; + __IO uint32_t RESERVED4; + __IO uint32_t HOST_RX_DMA; + __IO uint32_t RESERVED5; + __IO uint32_t RESERVED6; + __IO uint32_t RESERVED7; + __IO uint32_t RESERVED8; + __IO uint32_t RESERVED9; + __IO uint32_t RESERVED10; + __IO uint32_t RESERVED11; + __IO uint32_t RESERVED12; + __IO uint32_t RESERVED13; + __IO uint32_t RESERVED14; + __IO uint32_t RESERVED15; + __IO uint32_t RESERVED16; + __IO uint32_t RESERVED17; + __IO uint32_t RESERVED18; + __IO uint32_t RESERVED19; + __IO uint32_t HOST_TX_DMA; + __IO uint32_t RESERVED20; + __IO uint32_t RESERVED21; + __IO uint32_t RESERVED22; + __IO uint32_t RESERVED23; + __IO uint32_t RESERVED24; + __IO uint32_t RESERVED25; + __IO uint32_t RESERVED26; + __IO uint32_t RESERVED27; + __IO uint32_t RESERVED28; + __IO uint32_t RESERVED29; + __IO uint32_t RESERVED30; + __IO uint32_t RESERVED31; + __IO uint32_t RESERVED32; + __IO uint32_t RESERVED33; + __IO uint16_t HOST_RX_MAX_LEN; + __IO uint16_t RESERVED34; + __IO uint32_t RESERVED35; + __IO uint32_t RESERVED36; + __IO uint32_t RESERVED37; + __IO uint32_t RESERVED38; + __IO uint32_t RESERVED39; + __IO uint32_t RESERVED40; + __IO uint32_t RESERVED41; + __IO uint32_t RESERVED42; + __IO uint32_t RESERVED43; + __IO uint32_t RESERVED44; + __IO uint32_t RESERVED45; + __IO uint32_t RESERVED46; + __IO uint32_t RESERVED47; + __IO uint32_t RESERVED48; + __IO uint32_t RESERVED49; + __IO uint8_t HOST_EP_PID; + __IO uint8_t RESERVED50; + __IO uint8_t RESERVED51; + __IO uint8_t HOST_RX_CTRL; + __IO uint16_t HOST_TX_LEN; + __IO uint8_t HOST_TX_CTRL; + __IO uint8_t RESERVED52; + __IO uint16_t HOST_SPLIT_DATA; +} USBHSH_TypeDef; + +#endif // #if defined(CH32V30x) + +/* USBD Full-Speed Device, Chapter 21. + NOTE: USBD and CAN controller share a dedicated 512-byte SRAM area for data + transmission and reception in the design, so when using USBD and CAN functions + at the same time, this shared area needs to be allocated reasonably to prevent + data conflicts. */ + +typedef struct +{ + __IO uint32_t ADDn_TX; + __IO uint32_t COUNTn_TX; + __IO uint32_t ADDn_RX; + __IO uint32_t COUNTn_RX; +} USBD_BTABLE_TypeDef; + +typedef struct +{ + __IO uint32_t EPR[8]; + __IO uint32_t RESERVED[8]; + __IO uint32_t CNTR; + __IO uint32_t ISTR; + __IO uint32_t FNR; + __IO uint32_t DADDR; + __IO uint32_t BTABLE; +} USBD_TypeDef; + +#define CAN_USBD_SHARED_BASE ((PERIPH_BASE + 0x6000)) +#define USBD_BASE ((PERIPH_BASE + 0x5C00)) + +/* USBD_CNTR */ +#define USBD_CTRM (1<<15) +#define USBD_PMAOVRM (1<<14) +#define USBD_ERRM (1<<13) +#define USBD_WKUPM (1<<12) +#define USBD_SUSPM (1<<11) +#define USBD_RESETM (1<<10) +#define USBD_SOFM (1<<9) +#define USBD_ESOFM (1<<8) +#define USBD_RESUME (1<<4) +#define USBD_FSUP (1<<3) +#define USBD_LPMODE (1<<2) +#define USBD_PDWN (1<<1) +#define USBD_FRES (1<<0) + +/* USBD_ISTR */ +#define USBD_CTR (1<<15) +#define USBD_PMAOVR (1<<14) +#define USBD_ERR (1<<13) +#define USBD_WKUP (1<<12) +#define USBD_SUSP (1<<11) +#define USBD_RESET (1<<10) +#define USBD_SOF (1<<9) +#define USBD_ESOF (1<<8) +#define USBD_DIR (1<<4) +#define USBD_EP_ID (0xf) + +/* USBD_FNR */ +#define USBD_RXDP (1<<15) +#define USBD_RXDM (1<<14) +#define USBD_LCK (1<<13) +#define USBD_LSOF (3<<11) +#define USBD_FN (0x7ff) + +/* USBD_DADDR */ +#define USBD_EF (1<<7) +#define USBD_ADD (0x7f) + +/* USBD_EPRx */ +#define USBD_CTR_RX (1<<15) +#define USBD_DTOG_RX (1<<14) +#define USBD_STAT_RX (3<<12) +#define USBD_SETUP (1<<11) +#define USBD_EPTYPE (3<<9) +#define USBD_EPKIND (1<<8) +#define USBD_CTR_TX (1<<7) +#define USBD_DTOG_TX (1<<6) +#define USBD_STAT_TX (3<<4) +#define USBD_EA (0xf) + +/* USBD_COUNTx_RX */ +#define USBD_BLSIZE (1<<15) +#define USBD_NUM_BLOCK (0x1f<<10) +#define USBD_COUNTx_RX 0x2ff + + +#define USBD ((USBD_TypeDef *) USBD_BASE) + +/* USB-FS-OTG Registers, Chapter 23. */ +typedef struct +{ + __IO uint8_t BASE_CTRL; + __IO uint8_t UDEV_CTRL; + __IO uint8_t INT_EN; + __IO uint8_t DEV_ADDR; + __IO uint8_t Reserve0; + __IO uint8_t MIS_ST; + __IO uint8_t INT_FG; // "Combined" register in some situations. (ST_FG) + __IO uint8_t INT_ST; + __IO uint32_t RX_LEN; + __IO uint8_t UEP4_1_MOD; + __IO uint8_t UEP2_3_MOD; + __IO uint8_t UEP5_6_MOD; + __IO uint8_t UEP7_MOD; + __IO uint32_t UEP0_DMA; + __IO uint32_t UEP1_DMA; + __IO uint32_t UEP2_DMA; + __IO uint32_t UEP3_DMA; + __IO uint32_t UEP4_DMA; + __IO uint32_t UEP5_DMA; + __IO uint32_t UEP6_DMA; + __IO uint32_t UEP7_DMA; + __IO uint16_t UEP0_TX_LEN; + __IO uint8_t UEP0_TX_CTRL; + __IO uint8_t UEP0_RX_CTRL; + __IO uint16_t UEP1_TX_LEN; + __IO uint8_t UEP1_TX_CTRL; + __IO uint8_t UEP1_RX_CTRL; + __IO uint16_t UEP2_TX_LEN; + __IO uint8_t UEP2_TX_CTRL; + __IO uint8_t UEP2_RX_CTRL; + __IO uint16_t UEP3_TX_LEN; + __IO uint8_t UEP3_TX_CTRL; + __IO uint8_t UEP3_RX_CTRL; + __IO uint16_t UEP4_TX_LEN; + __IO uint8_t UEP4_TX_CTRL; + __IO uint8_t UEP4_RX_CTRL; + __IO uint16_t UEP5_TX_LEN; + __IO uint8_t UEP5_TX_CTRL; + __IO uint8_t UEP5_RX_CTRL; + __IO uint16_t UEP6_TX_LEN; + __IO uint8_t UEP6_TX_CTRL; + __IO uint8_t UEP6_RX_CTRL; + __IO uint16_t UEP7_TX_LEN; + __IO uint8_t UEP7_TX_CTRL; + __IO uint8_t UEP7_RX_CTRL; + __IO uint32_t Reserve1; + __IO uint32_t OTG_CR; + __IO uint32_t OTG_SR; +} USBOTG_FS_TypeDef; + +/* R8_USB_CTRL */ +#define USBOTG_UC_HOST_MODE (1<<7) +#define USBOTG_UC_LOW_SPEED (1<<6) +#define USBOTG_UC_DEV_PU_EN (1<<5) +#define USBOTG_UC_SYS_CTRL (1<<4) +#define USBOTG_UC_INT_BUSY (1<<3) +#define USBOTG_UC_RESET_SIE (1<<2) +#define USBOTG_UC_CLR_ALL (1<<1) +#define USBOTG_UC_DMA_EN (1<<0) + +/* R8_USB_INT_EN */ +#define USBOTG_UIE_DEV_NAK (1<<6) +#define USBOTG_UIE_FIFO_OV (1<<4) +#define USBOTG_UIE_HST_SOF (1<<3) +#define USBOTG_UIE_SUSPEND (1<<2) +#define USBOTG_UIE_TRANSFER (1<<1) +#define USBOTG_UIE_DETECT (1<<0) +#define USBOTG_UIE_BUS_RST (1<<0) + +/* R8_USB_DEV_AD */ +#define USBOTG_UDA_GP_BIT (1<<7) +#define USBOTG_USB_ADDR (1<<6) + +/* R8_USB_MIS_ST */ +#define USBOTG_UMS_SOF_PRES (1<<7) +#define USBOTG_UMS_SOF_ACT (1<<6) +#define USBOTG_UMS_SIE_FREE (1<<5) +#define USBOTG_UMS_R_FIFO_RDY (1<<4) +#define USBOTG_UMS_BUS_RESET (1<<3) +#define USBOTG_UMS_SUSPEND (1<<2) +#define USBOTG_UMS_DM_LEVEL (1<<1) +#define USBOTG_UMS_DEV_ATTACH (1<<0) + +/* R8_USB_INT_FG */ +#define USBOTG_U_IS_NAK (1<<7) +#define USBOTG_U_TOG_OK (1<<6) +#define USBOTG_U_SIE_FREE (1<<5) +#define USBOTG_UIF_FIFO_OV (1<<4) +#define USBOTG_UIF_HST_SOF (1<<3) +#define USBOTG_UIF_SUSPEND (1<<2) +#define USBOTG_UIF_TRANSFER (1<<1) +#define USBOTG_UIF_DETECT (1<<0) +#define USBOTG_UIF_BUS_RST (1<<0) + +/* R8_USB_INT_ST */ +#define USBOTG_UIS_IS_NAK (1<<7) +#define USBOTG_UIS_TOG_OK (1<<6) +#define USBOTG_UIS_TOKEN (3<<4) +#define USBOTG_UIS_ENDP 0xf +#define USBOTG_UIS_H_RES 0xf + +/* R32_USB_OTG_CR */ +#define USBOTG_CR_SESS_VTH (1<<5) +#define USBOTG_CR_VBUS_VTH (1<<4) +#define USBOTG_CR_OTG_EN (1<<3) +#define USBOTG_CR_IDPU (1<<2) +#define USBOTG_CR_CHARGE_VBUS (1<<1) +#define USBOTG_CR_DISCHAR_VBUS (1<<0) + +/* R32_USB_OTG_SR */ +#define USBOTG_SR_ID_DIG (1<<3) +#define USBOTG_SR_SESS_END (1<<2) +#define USBOTG_SR_SESS_VLD (1<<1) +#define USBOTG_SR_VBUS_VLD (1<<0) + +/* R8_UEPn_TX_CTRL */ +#define USBOTG_UEP_T_AUTO_TOG (1<<3) +#define USBOTG_UEP_T_TOG (1<<2) +#define USBOTG_UEP_T_RES_MASK (3<<0) // bit mask of handshake response type for USB endpoint X transmittal (IN) +#define USBOTG_UEP_T_RES_ACK (0<<1) +#define USBOTG_UEP_T_RES_NONE (1<<0) +#define USBOTG_UEP_T_RES_NAK (1<<1) +#define USBOTG_UEP_T_RES_STALL (3<<0) + +#define USBOTG_UEP_R_AUTO_TOG (1<<3) // enable automatic toggle after successful transfer completion on endpoint 1/2/3: 0=manual toggle, 1=automatic toggle +#define USBOTG_UEP_R_TOG (1<<2) // expected data toggle flag of USB endpoint X receiving (OUT): 0=DATA0, 1=DATA1 +#define USBOTG_UEP_R_RES_MASK (3<<0) // bit mask of handshake response type for USB endpoint X receiving (OUT) +#define USBOTG_UEP_R_RES_ACK (0<<1) +#define USBOTG_UEP_R_RES_NONE (1<<0) +#define USBOTG_UEP_R_RES_NAK (1<<1) +#define USBOTG_UEP_R_RES_STALL (3<<0) + + + +/* R8_UEPn_ RX_CTRL */ +#define USBOTG_UEP_R_AUTO_TOG (1<<3) +#define USBOTG_UEP_R_TOG (1<<2) +#define USBOTG_UEP_R_RES (3<<0) + +/* R8_UEP7_MOD */ +#define USBOTG_UEP7_RX_EN (1<<3) +#define USBOTG_UEP7_TX_EN (1<<2) +#define USBOTG_UEP7_BUF_MOD (1<<0) + +/* R8_UEP5_6_MOD */ +#define USBOTG_UEP6_RX_EN (1<<7) +#define USBOTG_UEP6_TX_EN (1<<6) +#define USBOTG_UEP6_BUF_MOD (1<<4) +#define USBOTG_UEP5_RX_EN (1<<3) +#define USBOTG_UEP5_TX_EN (1<<2) +#define USBOTG_UEP5_BUF_MOD (1<<0) + +/* R8_UEP2_3_MOD */ +#define USBOTG_UEP3_RX_EN (1<<7) +#define USBOTG_UEP3_TX_EN (1<<6) +#define USBOTG_UEP3_BUF_MOD (1<<4) +#define USBOTG_UEP2_RX_EN (1<<3) +#define USBOTG_UEP2_TX_EN (1<<2) +#define USBOTG_UEP2_BUF_MOD (1<<0) + +/* R8_UEP4_1_MOD */ +#define USBOTG_UEP1_RX_EN (1<<7) +#define USBOTG_UEP1_TX_EN (1<<6) +#define USBOTG_UEP1_BUF_MOD (1<<4) +#define USBOTG_UEP4_RX_EN (1<<3) +#define USBOTG_UEP4_TX_EN (1<<2) +#define USBOTG_UEP4_BUF_MOD (1<<0) + +/* R8_UDEV_CTRL */ +#define USBOTG_UD_PD_DIS (1<<7) +#define USBOTG_UD_DP_PIN (1<<5) +#define USBOTG_UD_DM_PIN (1<<4) +#define USBOTG_UD_LOW_SPEED (1<<2) +#define USBOTG_UD_GP_BIT (1<<1) +#define USBOTG_UD_PORT_EN (1<<0) + + +#define USBFS_UDA_GP_BIT 0x80 +#define USBFS_USB_ADDR_MASK 0x7F + +#define DEF_USBD_UEP0_SIZE 64 /* usb hs/fs device end-point 0 size */ +#define UEP_SIZE 64 + +#define DEF_UEP_IN 0x80 +#define DEF_UEP_OUT 0x00 +#define DEF_UEP_BUSY 0x01 +#define DEF_UEP_FREE 0x00 + +#define DEF_UEP0 0 +#define DEF_UEP1 1 +#define DEF_UEP2 2 +#define DEF_UEP3 3 +#define DEF_UEP4 4 +#define DEF_UEP5 5 +#define DEF_UEP6 6 +#define DEF_UEP7 7 +#define UNUM_EP 8 + +typedef struct +{ + __IO uint8_t BASE_CTRL; + __IO uint8_t HOST_CTRL; + __IO uint8_t INT_EN; + __IO uint8_t DEV_ADDR; + __IO uint8_t Reserve0; + __IO uint8_t MIS_ST; + __IO uint8_t INT_FG; + __IO uint8_t INT_ST; + __IO uint16_t RX_LEN; + __IO uint16_t Reserve1; + __IO uint8_t Reserve2; + __IO uint8_t HOST_EP_MOD; + __IO uint16_t Reserve3; + __IO uint32_t Reserve4; + __IO uint32_t Reserve5; + __IO uint32_t HOST_RX_DMA; + __IO uint32_t HOST_TX_DMA; + __IO uint32_t Reserve6; + __IO uint32_t Reserve7; + __IO uint32_t Reserve8; + __IO uint32_t Reserve9; + __IO uint32_t Reserve10; + __IO uint16_t Reserve11; + __IO uint16_t HOST_SETUP; + __IO uint8_t HOST_EP_PID; + __IO uint8_t Reserve12; + __IO uint8_t Reserve13; + __IO uint8_t HOST_RX_CTRL; + __IO uint16_t HOST_TX_LEN; + __IO uint8_t HOST_TX_CTRL; + __IO uint8_t Reserve14; + __IO uint32_t Reserve15; + __IO uint32_t Reserve16; + __IO uint32_t Reserve17; + __IO uint32_t Reserve18; + __IO uint32_t Reserve19; + __IO uint32_t OTG_CR; + __IO uint32_t OTG_SR; +} USBOTG_FS_HOST_TypeDef; + +/* R8_UHOST_CTRL */ +#define USBOTG_UH_PD_DIS (1<<7) +#define USBOTG_UH_DP_PIN (1<<5) +#define USBOTG_UH_DM_PIN (1<<4) +#define USBOTG_UH_LOW_SPEED (1<<2) +#define USBOTG_UH_BUS_RESET (1<<1) +#define USBOTG_UH_PORT_EN (1<<0) + +/* R32_UH_EP_MOD */ +#define USBOTG_UH_EP_TX_EN (1<<6) +#define USBOTG_UH_EP_TBUF_MOD (1<<4) +#define USBOTG_UH_EP_RX_EN (1<<3) +#define USBOTG_UH_EP_RBUF_MOD (1<<0) + +/* R16_UH_SETUP */ +#define USBOTG_UH_PRE_PID_EN (1<<10) +#define USBOTG_UH_SOF_EN (1<<2) + +/* R8_UH_EP_PID */ +#define USBOTG_UH_TOKEN (0xf<<4) +#define USBOTG_UH_ENDP (0xf<<0) + +/* R8_UH_RX_CTRL */ +#define USBOTG_UH_R_AUTO_TOG (1<<3) +#define USBOTG_UH_R_TOG (1<<2) +#define USBOTG_UH_R_RES (1<<0) + +/* R8_UH_TX_CTRL */ +#define USBOTG_UH_T_AUTO_TOG (1<<3) +#define USBOTG_UH_T_TOG (1<<2) +#define USBOTG_UH_T_RES (1<<0) + + + +#if defined(CH32V30x) +/* Ethernet MAC */ +typedef struct +{ + __IO uint32_t MACCR; + __IO uint32_t MACFFR; + __IO uint32_t MACHTHR; + __IO uint32_t MACHTLR; + __IO uint32_t MACMIIAR; + __IO uint32_t MACMIIDR; + __IO uint32_t MACFCR; + __IO uint32_t MACVLANTR; + uint32_t RESERVED0[2]; + __IO uint32_t MACRWUFFR; + __IO uint32_t MACPMTCSR; + uint32_t RESERVED1[2]; + __IO uint32_t MACSR; + __IO uint32_t MACIMR; + __IO uint32_t MACA0HR; + __IO uint32_t MACA0LR; + __IO uint32_t MACA1HR; + __IO uint32_t MACA1LR; + __IO uint32_t MACA2HR; + __IO uint32_t MACA2LR; + __IO uint32_t MACA3HR; + __IO uint32_t MACA3LR; + uint32_t RESERVED2[40]; + __IO uint32_t MMCCR; + __IO uint32_t MMCRIR; + __IO uint32_t MMCTIR; + __IO uint32_t MMCRIMR; + __IO uint32_t MMCTIMR; + uint32_t RESERVED3[14]; + __IO uint32_t MMCTGFSCCR; + __IO uint32_t MMCTGFMSCCR; + uint32_t RESERVED4[5]; + __IO uint32_t MMCTGFCR; + uint32_t RESERVED5[10]; + __IO uint32_t MMCRFCECR; + __IO uint32_t MMCRFAECR; + uint32_t RESERVED6[10]; + __IO uint32_t MMCRGUFCR; + uint32_t RESERVED7[334]; + __IO uint32_t PTPTSCR; + __IO uint32_t PTPSSIR; + __IO uint32_t PTPTSHR; + __IO uint32_t PTPTSLR; + __IO uint32_t PTPTSHUR; + __IO uint32_t PTPTSLUR; + __IO uint32_t PTPTSAR; + __IO uint32_t PTPTTHR; + __IO uint32_t PTPTTLR; + uint32_t RESERVED8[567]; + __IO uint32_t DMABMR; + __IO uint32_t DMATPDR; + __IO uint32_t DMARPDR; + __IO uint32_t DMARDLAR; + __IO uint32_t DMATDLAR; + __IO uint32_t DMASR; + __IO uint32_t DMAOMR; + __IO uint32_t DMAIER; + __IO uint32_t DMAMFBOCR; + uint32_t RESERVED9[9]; + __IO uint32_t DMACHTDR; + __IO uint32_t DMACHRDR; + __IO uint32_t DMACHTBAR; + __IO uint32_t DMACHRBAR; +} ETH_TypeDef; +#endif // #if defined(CH32V30x) + +#if defined(CH32V20x_D8) || defined(CH32V20x_D8W) +/* ETH10M Registers */ +typedef struct +{ + __IO uint8_t reserved1; + __IO uint8_t reserved2; + __IO uint8_t reserved3; + __IO uint8_t EIE; + + __IO uint8_t EIR; + __IO uint8_t ESTAT; + __IO uint8_t ECON2; + __IO uint8_t ECON1; + + __IO uint16_t ETXST; + __IO uint16_t ETXLN; + + __IO uint16_t ERXST; + __IO uint16_t ERXLN; + + __IO uint32_t HTL; + __IO uint32_t HTH; + + __IO uint8_t ERXFON; + __IO uint8_t MACON1; + __IO uint8_t MACON2; + __IO uint8_t MABBIPG; + + __IO uint16_t EPAUS; + __IO uint16_t MAMXFL; + + __IO uint16_t MIRD; + __IO uint16_t reserved4; + + __IO uint8_t MIERGADR; + __IO uint8_t MISTAT; + __IO uint16_t MIWR; + + __IO uint32_t MAADRL; + + __IO uint16_t MAADRH; + __IO uint16_t reserved5; +} ETH10M_TypeDef; +#endif + +#if defined(CH32V20x_D8) || defined(CH32V20x_D8W) +/* OSC Registers */ +typedef struct +{ + __IO uint32_t HSE_CAL_CTRL; + __IO uint32_t Reserve0; + __IO uint16_t Reserve1; + __IO uint16_t LSI32K_TUNE; + __IO uint32_t Reserve2; + __IO uint32_t Reserve3; + __IO uint32_t Reserve4; + __IO uint32_t Reserve5; + __IO uint8_t Reserve6; + __IO uint8_t LSI32K_CAL_CFG; + __IO uint16_t Reserve7; + __IO uint16_t LSI32K_CAL_STATR; + __IO uint8_t LSI32K_CAL_OV_CNT; + __IO uint8_t LSI32K_CAL_CTRL; +} OSC_TypeDef; + +#endif + +#endif // #if defined(CH32V20x) || defined(CH32V30x) + + +#if defined(CH32X03x) +/* Touch Sensor, Mirrors Analog to Digital Converter */ +typedef struct +{ + __IO uint32_t RESERVED0[3]; + __IO uint32_t CHARGE1; + __IO uint32_t CHARGE2; + __IO uint32_t RESERVED1[10]; + __IO uint32_t CHGOFFSET; + __IO uint32_t RESERVED2[3]; + __IO uint32_t DR_ACT_DCG; +} TKEY_TypeDef; + +/* Op amp / comparator */ +typedef struct +{ + __IO uint16_t CFGR1; + __IO uint16_t CFGR2; + __IO uint32_t CTLR1; + __IO uint32_t CTLR2; + __IO uint32_t OPA_KEY; + __IO uint32_t CMP_KEY; + __IO uint32_t POLL_KEY; +} OPACMP_TypeDef; + +/* USB Full Speed Device Mode */ +typedef struct +{ + __IO uint8_t BASE_CTRL; //XXX (spelling) + __IO uint8_t UDEV_CTRL; // or host ctlr + __IO uint8_t INT_EN; + __IO uint8_t DEV_ADDR; + __IO uint8_t RESERVED0; + __IO uint8_t MIS_ST; + __IO uint8_t INT_FG; + __IO uint8_t INT_ST; + __IO uint16_t RX_LEN; + __IO uint16_t RESERVED1; + __IO uint8_t UEP4_1_MOD; + __IO uint8_t UEP2_3_MOD; // Also HOST_EP_MOD + __IO uint8_t UEP567_MOD; + __IO uint8_t RESERVED2; + + __IO uint32_t UEP0_DMA; + __IO uint32_t UEP1_DMA; + __IO uint32_t UEP2_DMA; // Also HOST_RX_DMA + __IO uint32_t UEP3_DMA; // Also HOST_TX_DMA + + //__IO uint32_t UEP0_CTRL; + __IO uint16_t UEP0_TX_LEN; + __IO uint16_t UEP0_CTRL_H; + + //__IO uint32_t UEP1_CTRL; + __IO uint16_t UEP1_TX_LEN; + __IO uint16_t UEP1_CTRL_H; // Also HOST_SETUP + + //__IO uint32_t UEP2_CTRL; + __IO uint16_t UEP2_TX_LEN; // Also HOST_PID + __IO uint16_t UEP2_CTRL_H; // Also HOST_RX_CTL + + //__IO uint32_t UEP3_CTRL; + __IO uint16_t UEP3_TX_LEN; // Also HOST_TX_LEN + __IO uint16_t UEP3_CTRL_H; // Also HOST_TX_CTL + + //__IO uint32_t UEP4_CTRL; + __IO uint16_t UEP4_TX_LEN; + __IO uint16_t UEP4_CTRL_H; + + __IO uint32_t RESERVED3[8]; + + __IO uint32_t UEP5_DMA; + __IO uint32_t UEP6_DMA; + __IO uint32_t UEP7_DMA; + + __IO uint32_t RESERVED4; + + //__IO uint32_t UEP5_CTRL; + __IO uint16_t UEP5_TX_LEN; + __IO uint16_t UEP5_CTRL_H; + + //__IO uint32_t UEP6_CTRL; + __IO uint16_t UEP6_TX_LEN; + __IO uint16_t UEP6_CTRL_H; + + //__IO uint32_t UEP7_CTRL; + __IO uint16_t UEP7_TX_LEN; + __IO uint16_t UEP7_CTRL_H; + + __IO uint32_t UEPX_MOD; +} USBFS_TypeDef; + + + +#define USB_PHY_V33 (1<<6) +#define USB_IOEN (1<<7) + + +#define USBFSD_UEP_MOD_BASE 0x4002340C +#define USBFSD_UEP_DMA_BASE 0x40023410 +#define USBFSD_UEP_LEN_BASE 0x40023420 +#define USBFSD_UEP_CTL_BASE 0x40023422 +#define USBFSD_UEP_RX_EN 0x08 +#define USBFSD_UEP_TX_EN 0x04 +#define USBFSD_UEP_BUF_MOD 0x01 +#define USBFSD_UEP_MOD( N ) (*((volatile uint8_t *)( USBFSD_UEP_MOD_BASE + N ))) +#define USBFSD_UEP_TX_CTRL( N ) (*((volatile uint8_t *)( USBFSD_UEP_CTL_BASE + N * 0x04 ))) +#define USBFSD_UEP_RX_CTRL( N ) (*((volatile uint8_t *)( USBFSD_UEP_CTL_BASE + N * 0x04 ))) +#define USBFSD_UEP_DMA( N ) (*((volatile uint32_t *)( USBFSD_UEP_DMA_BASE + N * 0x04 ))) +#define USBFSD_UEP_BUF( N ) ((uint8_t *)(*((volatile uint32_t *)( USBFSD_UEP_DMA_BASE + N * 0x04 ))) + 0x20000000) +#define USBFSD_UEP_TLEN( N ) (*((volatile uint16_t *)( USBFSD_UEP_LEN_BASE + N * 0x04 ))) + +/* R8_UEPn_TX_CTRL */ +#define USBFS_UEP_T_AUTO_TOG (1<<4) // enable automatic toggle after successful transfer completion on endpoint 1/2/3: 0=manual toggle, 1=automatic toggle +#define USBFS_UEP_T_TOG (1<<6) // prepared data toggle flag of USB endpoint X transmittal (IN): 0=DATA0, 1=DATA1 +#define USBFS_UEP_T_RES_MASK (3<<0) // bit mask of handshake response type for USB endpoint X transmittal (IN) +#define USBFS_UEP_T_RES_ACK (0<<1) +#define USBFS_UEP_T_RES_NONE (1<<0) +#define USBFS_UEP_T_RES_NAK (1<<1) +#define USBFS_UEP_T_RES_STALL (3<<0) +// bUEP_T_RES1 & bUEP_T_RES0: handshake response type for USB endpoint X transmittal (IN) +// 00: DATA0 or DATA1 then expecting ACK (ready) +// 01: DATA0 or DATA1 then expecting no response, time out from host, for non-zero endpoint isochronous transactions +// 10: NAK (busy) +// 11: STALL (error) +// host aux setup + +/* R8_UEPn_RX_CTRL, n=0-7 */ +#define USBFS_UEP_R_AUTO_TOG (1<<4) // enable automatic toggle after successful transfer completion on endpoint 1/2/3: 0=manual toggle, 1=automatic toggle +#define USBFS_UEP_R_TOG (1<<7) // expected data toggle flag of USB endpoint X receiving (OUT): 0=DATA0, 1=DATA1 +#define USBFS_UEP_R_RES_MASK (3<<2) // bit mask of handshake response type for USB endpoint X receiving (OUT) +#define USBFS_UEP_R_RES_ACK (0<<3) +#define USBFS_UEP_R_RES_NONE (1<<2) +#define USBFS_UEP_R_RES_NAK (1<<3) +#define USBFS_UEP_R_RES_STALL (3<<2) + + +#define EP1_T_EN (1<<6) +#define EP2_T_EN (1<<2) +#define EP3_T_EN (1<<6) +#define EP4_T_EN (1<<2) +#define EP1_R_EN (1<<7) +#define EP2_R_EN (1<<3) +#define EP3_R_EN (1<<7) +#define EP4_R_EN (1<<3) + + +/* R8_USB_CTRL */ +#define USBFS_UC_HOST_MODE 0x80 +#define USBFS_UC_LOW_SPEED 0x40 +#define USBFS_UC_DEV_PU_EN 0x20 +#define USBFS_UC_SYS_CTRL_MASK 0x30 +#define USBFS_UC_SYS_CTRL0 0x00 +#define USBFS_UC_SYS_CTRL1 0x10 +#define USBFS_UC_SYS_CTRL2 0x20 +#define USBFS_UC_SYS_CTRL3 0x30 +#define USBFS_UC_INT_BUSY 0x08 +#define USBFS_UC_RESET_SIE 0x04 +#define USBFS_UC_CLR_ALL 0x02 +#define USBFS_UC_DMA_EN 0x01 + +/* R8_USB_INT_EN */ +#define USBFS_UIE_DEV_SOF 0x80 +#define USBFS_UIE_DEV_NAK 0x40 +#define USBFS_UIE_FIFO_OV 0x10 +#define USBFS_UIE_HST_SOF 0x08 +#define USBFS_UIE_SUSPEND 0x04 +#define USBFS_UIE_TRANSFER 0x02 +#define USBFS_UIE_DETECT 0x01 +#define USBFS_UIE_BUS_RST 0x01 + +/* R8_USB_DEV_AD */ +#define USBFS_UDA_GP_BIT 0x80 +#define USBFS_USB_ADDR_MASK 0x7F + +/* R8_USB_MIS_ST */ +#define USBFS_UMS_SOF_PRES 0x80 +#define USBFS_UMS_SOF_ACT 0x40 +#define USBFS_UMS_SIE_FREE 0x20 +#define USBFS_UMS_R_FIFO_RDY 0x10 +#define USBFS_UMS_BUS_RESET 0x08 +#define USBFS_UMS_SUSPEND 0x04 +#define USBFS_UMS_DM_LEVEL 0x02 +#define USBFS_UMS_DEV_ATTACH 0x01 + + + + +#define USBFS_UDA_GP_BIT 0x80 +#define USBFS_USB_ADDR_MASK 0x7F + +#define DEF_USBD_UEP0_SIZE 64 /* usb hs/fs device end-point 0 size */ +#define UEP_SIZE 64 + +#define DEF_UEP_IN 0x80 +#define DEF_UEP_OUT 0x00 +#define DEF_UEP_BUSY 0x01 +#define DEF_UEP_FREE 0x00 + +#define DEF_UEP0 0 +#define DEF_UEP1 1 +#define DEF_UEP2 2 +#define DEF_UEP3 3 +#define DEF_UEP4 4 +#define DEF_UEP5 5 +#define DEF_UEP6 6 +#define DEF_UEP7 7 +#define UNUM_EP 8 + + + +/* USB Host Mode */ + +typedef struct +{ + __IO uint8_t RESERVED0; + __IO uint8_t HOST_CTRL; + __IO uint8_t RESERVED1; + __IO uint8_t RESERVED2; + __IO uint8_t RESERVED3; + __IO uint8_t RESERVED4; + __IO uint8_t RESERVED5; + __IO uint8_t RESERVED6; + __IO uint16_t RESERVED7; + __IO uint16_t RESERVED8; + __IO uint8_t RESERVED9; + __IO uint8_t HOST_EP_MOD; + __IO uint8_t RESERVED10; + __IO uint8_t RESERVED11; + + __IO uint32_t RESERVED12; + __IO uint32_t RESERVED13; + __IO uint32_t HOST_RX_DMA; + __IO uint32_t HOST_TX_DMA; + + __IO uint16_t RESERVED14; + __IO uint16_t RESERVED15; + __IO uint16_t RESERVED16; + + __IO uint16_t HOST_SETUP; + __IO uint16_t HOST_EP_PID; + __IO uint16_t HOST_RX_CTL; + __IO uint16_t HOST_TX_LEN; + __IO uint16_t HOST_TX_CTL; + + __IO uint16_t RESERVED20; + __IO uint16_t RESERVED21; + + __IO uint32_t RESERVED22[8]; + + __IO uint32_t RESERVED23; + __IO uint32_t RESERVED24; + __IO uint32_t RESERVED25; + + __IO uint32_t RESERVED26; + + __IO uint16_t RESERVED27; + __IO uint16_t RESERVED28; + + __IO uint16_t RESERVED29; + __IO uint16_t RESERVED30; + + __IO uint16_t RESERVED31; + __IO uint16_t RESERVED32; + + __IO uint32_t RESERVED33; +} USBDH_TypeDef; + + +/* USB Power Delivery */ +typedef struct +{ + __IO uint32_t CONFIG; + __IO uint32_t CONTROL; + __IO uint32_t STATUS; + __IO uint32_t PORT; + __IO uint32_t DMA; +} USBPD_TypeDef; + + +/* USB Power Delivery */ +typedef struct +{ + __IO uint16_t CONFIG; + __IO uint16_t BCM_CLK_CNT; + + __IO uint8_t CONTROL; + __IO uint8_t TX_SEL; + __IO uint16_t BMC_TX_SZ; + + __IO uint8_t DATA_BUF; + __IO uint8_t STATUS; + __IO uint16_t BMC_BYTE_CNT; + + __IO uint16_t PORT_CC1; + __IO uint16_t PORT_CC2; + + __IO uint32_t USBPD_DMA; +} USBPD_DETAILED_TypeDef; + +#endif // #if defined(CH32X03x) + + +#endif + +/* Peripheral memory map */ +#ifdef __ASSEMBLER__ +#define FLASH_BASE (0x08000000) /* FLASH base address in the alias region */ +#define SRAM_BASE (0x20000000) /* SRAM base address in the alias region */ +#define PERIPH_BASE (0x40000000) /* Peripheral base address in the alias region */ +#define CORE_PERIPH_BASE (0xE0000000) /* System peripherals base address in the alias region */ +#else +#define FLASH_BASE ((uint32_t)0x08000000) /* FLASH base address in the alias region */ +#define SRAM_BASE ((uint32_t)0x20000000) /* SRAM base address in the alias region */ +#define PERIPH_BASE ((uint32_t)0x40000000) /* Peripheral base address in the alias region */ +#define CORE_PERIPH_BASE ((uint32_t)0xE0000000) /* System peripherals base address in the alias region */ +#endif + +#if defined(CH32V30x) +#ifdef __ASSEMBLER__ +#define FSMC_R_BASE (b 0xA0000000) /* FSMC registers base address */ +#else +#define FSMC_R_BASE ((uint32_t)0xA0000000) /* FSMC registers base address */ +#endif +#endif + +#define APB1PERIPH_BASE (PERIPH_BASE) +#define APB2PERIPH_BASE (PERIPH_BASE + 0x10000) +#define AHBPERIPH_BASE (PERIPH_BASE + 0x20000) + +#define TIM2_BASE (APB1PERIPH_BASE + 0x0000) +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) || defined(CH32X03x) +#define TIM3_BASE (APB1PERIPH_BASE + 0x0400) +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +#define TIM4_BASE (APB1PERIPH_BASE + 0x0800) +#define TIM5_BASE (APB1PERIPH_BASE + 0x0C00) +#endif // CH32V10x, CH32V20x, CH32V30x +#if defined(CH32V30x) // CH32V30x +#define TIM6_BASE (APB1PERIPH_BASE + 0x1000) +#define TIM7_BASE (APB1PERIPH_BASE + 0x1400) +#define UART6_BASE (APB1PERIPH_BASE + 0x1800) +#define UART7_BASE (APB1PERIPH_BASE + 0x1C00) +#define UART8_BASE (APB1PERIPH_BASE + 0x2000) +#endif // CH32V30x +#if defined(CH32V10x) // CH32V10x +#define TIM6_BASE (APB1PERIPH_BASE + 0x1000) +#define TIM7_BASE (APB1PERIPH_BASE + 0x1400) +#define TIM12_BASE (APB1PERIPH_BASE + 0x1800) +#define TIM13_BASE (APB1PERIPH_BASE + 0x1C00) +#define TIM14_BASE (APB1PERIPH_BASE + 0x2000) +#endif // CH32V10x +#if defined(CH32V003) || defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +#define RTC_BASE (APB1PERIPH_BASE + 0x2800) +#endif +#endif +#define WWDG_BASE (APB1PERIPH_BASE + 0x2C00) +#define IWDG_BASE (APB1PERIPH_BASE + 0x3000) +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +#define SPI2_BASE (APB1PERIPH_BASE + 0x3800) +#if defined(CH32V10x) || defined(CH32V30x) +#define SPI3_BASE (APB1PERIPH_BASE + 0x3C00) +#endif // defined(CH32V30x) || defined(CH32V10x) +#endif +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) || defined(CH32X03x) +#define USART2_BASE (APB1PERIPH_BASE + 0x4400) +#define USART3_BASE (APB1PERIPH_BASE + 0x4800) +#define UART4_BASE (APB1PERIPH_BASE + 0x4C00) +#if defined(CH32V10x) || defined(CH32V30x) +#define UART5_BASE (APB1PERIPH_BASE + 0x5000) +#endif // defined(CH32V30x) || defined(CH32V10x) +#endif // defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +#define I2C1_BASE (APB1PERIPH_BASE + 0x5400) +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +#define I2C2_BASE (APB1PERIPH_BASE + 0x5800) +#endif +#if defined(CH32V20x) || defined(CH32V30x) +#define CAN1_BASE (APB1PERIPH_BASE + 0x6400) +#endif +#if defined(CH32V30x) +#define CAN2_BASE (APB1PERIPH_BASE + 0x6800) +#endif +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +#define BKP_BASE (APB1PERIPH_BASE + 0x6C00) +#endif +#define PWR_BASE (APB1PERIPH_BASE + 0x7000) +#if defined(CH32V10x) || defined(CH32V30x) +#define DAC_BASE (APB1PERIPH_BASE + 0x7400) +#endif + +#define AFIO_BASE (APB2PERIPH_BASE + 0x0000) +#define EXTI_BASE (APB2PERIPH_BASE + 0x0400) +#define GPIOA_BASE (APB2PERIPH_BASE + 0x0800) +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) || defined(CH32X03x) +#define GPIOB_BASE (APB2PERIPH_BASE + 0x0C00) +#endif +#define GPIOC_BASE (APB2PERIPH_BASE + 0x1000) +#define GPIOD_BASE (APB2PERIPH_BASE + 0x1400) +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +#define GPIOE_BASE (APB2PERIPH_BASE + 0x1800) +#define GPIOF_BASE (APB2PERIPH_BASE + 0x1C00) +#define GPIOG_BASE (APB2PERIPH_BASE + 0x2000) +#endif +#define ADC1_BASE (APB2PERIPH_BASE + 0x2400) +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +#define ADC2_BASE (APB2PERIPH_BASE + 0x2800) +#endif +#define TIM1_BASE (APB2PERIPH_BASE + 0x2C00) +#define SPI1_BASE (APB2PERIPH_BASE + 0x3000) +#if defined(CH32V10x) || defined(CH32V30x) +#define TIM8_BASE (APB2PERIPH_BASE + 0x3400) +#endif +#define USART1_BASE (APB2PERIPH_BASE + 0x3800) +#if defined(CH32V10x) || defined(CH32V30x) +#define ADC3_BASE (APB2PERIPH_BASE + 0x3C00) +#define TIM15_BASE (APB2PERIPH_BASE + 0x4000) +#define TIM16_BASE (APB2PERIPH_BASE + 0x4400) +#define TIM17_BASE (APB2PERIPH_BASE + 0x4800) +#define TIM9_BASE (APB2PERIPH_BASE + 0x4C00) +#define TIM10_BASE (APB2PERIPH_BASE + 0x5000) +#define TIM11_BASE (APB2PERIPH_BASE + 0x5400) +#endif +#if defined(CH32V30x) +#define SDIO_BASE (APB2PERIPH_BASE + 0x8000) +#endif + +#define DMA1_BASE (AHBPERIPH_BASE + 0x0000) +#define DMA1_Channel1_BASE (AHBPERIPH_BASE + 0x0008) +#define DMA1_Channel2_BASE (AHBPERIPH_BASE + 0x001C) +#define DMA1_Channel3_BASE (AHBPERIPH_BASE + 0x0030) +#define DMA1_Channel4_BASE (AHBPERIPH_BASE + 0x0044) +#define DMA1_Channel5_BASE (AHBPERIPH_BASE + 0x0058) +#define DMA1_Channel6_BASE (AHBPERIPH_BASE + 0x006C) +#define DMA1_Channel7_BASE (AHBPERIPH_BASE + 0x0080) +#if defined(CH32V20x) +#define DMA1_Channel8_BASE (AHBPERIPH_BASE + 0x0094) +#endif +#if defined(CH32V10x) || defined(CH32V30x) +#define DMA2_BASE (AHBPERIPH_BASE + 0x0400) +#define DMA2_Channel1_BASE (AHBPERIPH_BASE + 0x0408) +#define DMA2_Channel2_BASE (AHBPERIPH_BASE + 0x041C) +#define DMA2_Channel3_BASE (AHBPERIPH_BASE + 0x0430) +#define DMA2_Channel4_BASE (AHBPERIPH_BASE + 0x0444) +#define DMA2_Channel5_BASE (AHBPERIPH_BASE + 0x0458) +#if defined(CH32V30x) +#define DMA2_Channel6_BASE (AHBPERIPH_BASE + 0x046C) +#define DMA2_Channel7_BASE (AHBPERIPH_BASE + 0x0480) +#define DMA2_Channel8_BASE (AHBPERIPH_BASE + 0x0490) +#define DMA2_Channel9_BASE (AHBPERIPH_BASE + 0x04A0) +#define DMA2_Channel10_BASE (AHBPERIPH_BASE + 0x04B0) +#define DMA2_Channel11_BASE (AHBPERIPH_BASE + 0x04C0) +#define DMA2_EXTEN_BASE (AHBPERIPH_BASE + 0x04D0) +#endif // defined(CH32V30x) +#endif +#define RCC_BASE (AHBPERIPH_BASE + 0x1000) + +#define FLASH_R_BASE (AHBPERIPH_BASE + 0x2000) /* Flash registers base address */ + +#if defined(CH32V20x) +#define CRC_BASE (AHBPERIPH_BASE + 0x3000) +#define OPA_BASE (AHBPERIPH_BASE + 0x3804) +#define ETH10M_BASE (AHBPERIPH_BASE + 0x8000) + +#define USBFS_BASE ((uint32_t)0x50000000) +#elif defined(CH32X03x) + +#define OPA_BASE (AHBPERIPH_BASE + 0x6000) +#define USBFS_BASE (AHBPERIPH_BASE + 0x3400) +#define USBPD_BASE (AHBPERIPH_BASE + 0x7000) + +#elif defined(CH32V30x) +#define CRC_BASE (AHBPERIPH_BASE + 0x3000) +#define USBHS_BASE (AHBPERIPH_BASE + 0x3400) +#define OPA_BASE (AHBPERIPH_BASE + 0x3804) +#define RNG_BASE (AHBPERIPH_BASE + 0x3C00) + +#define ETH_BASE (AHBPERIPH_BASE + 0x8000) +#define ETH_MAC_BASE (ETH_BASE) +#define ETH_MMC_BASE (ETH_BASE + 0x0100) +#define ETH_PTP_BASE (ETH_BASE + 0x0700) +#define ETH_DMA_BASE (ETH_BASE + 0x1000) + +#define USBFS_BASE ((uint32_t)0x50000000) +#define DVP_BASE ((uint32_t)0x50050000) + +#define FSMC_Bank1_R_BASE (FSMC_R_BASE + 0x0000) +#define FSMC_Bank1E_R_BASE (FSMC_R_BASE + 0x0104) +#define FSMC_Bank2_R_BASE (FSMC_R_BASE + 0x0060) +#elif defined(CH32V10x) +#define CRC_BASE (AHBPERIPH_BASE + 0x3000) +#define DBGMCU_BASE ((uint32_t)0xE000D000) +#endif + +#define OB_BASE ((uint32_t)0x1FFFF800) /* Flash Option Bytes base address */ +#define ESIG_BASE ((uint32_t)0x1FFFF7E0) +#define INFO_BASE ((uint32_t)0x1FFFF704) + +#if defined(CH32V003) || defined(CH32V10x) +#define EXTEN_BASE ((uint32_t)0x40023800) +#elif defined(CH32V20x) || defined(CH32V30x) +#define EXTEN_BASE (AHBPERIPH_BASE + 0x3800) +#endif + +#define PFIC_BASE (CORE_PERIPH_BASE + 0xE000) +#define SysTick_BASE (CORE_PERIPH_BASE + 0xF000) + +#if defined(CH32V20x) +#if defined(CH32V20x_D8) || defined(CH32V20x_D8W) +#define OSC_BASE (AHBPERIPH_BASE + 0x202C) +#endif +#endif + + + +// AFIO CTLR Bits +#define PB6_FILT_EN (1<<27) +#define PB5_FILT_EN (1<<26) +#define PA4_FILT_EN (1<<25) +#define PA3_FILT_EN (1<<24) +#define UDM_BC_CMPO (1<<19) +#define UDP_BC_CMPO (1<<17) +#define UDM_BC_VSRC (1<<17) +#define UDP_BC_VSRC (1<<16) +#define USBPD_IN_HVT (1<<9) +#define USBPD_PHY_V33 (1<<8) +#define USB_IOEN (1<<7) +#define USB_PHY_V33 (1<<6) +#define UDP_PUE_00 (0b00<<2) +#define UDP_PUE_01 (0b01<<2) +#define UDP_PUE_10 (0b10<<2) +#define UDP_PUE_11 (0b11<<2) +#define UDM_PUE_00 (0b00<<0) +#define UDM_PUE_01 (0b01<<0) +#define UDM_PUE_10 (0b10<<0) +#define UDM_PUE_11 (0b11<<0) +#define UDP_PUE_MASK 0x0000000C +#define UDP_PUE_DISABLE 0x00000000 +#define UDP_PUE_35UA 0x00000004 +#define UDP_PUE_10K 0x00000008 +#define UDP_PUE_1K5 0x0000000C +#define UDM_PUE_MASK 0x00000003 +#define UDM_PUE_DISABLE 0x00000000 +#define UDM_PUE_35UA 0x00000001 +#define UDM_PUE_10K 0x00000002 +#define UDM_PUE_1K5 0x00000003 + + +// USB PD Bits +#define IE_TX_END (1<<15) +#define IE_RX_RESET (1<<14) +#define IE_RX_ACT (1<<13) +#define IE_RX_BYTE (1<<12) +#define IE_RX_BIT (1<<11) +#define IE_PD_IO (1<<10) +#define WAKE_POLAR (1<<5) +#define PD_RST_EN (1<<4) +#define PD_DMA_EN (1<<3) +#define CC_SEL (1<<2) +#define PD_ALL_CLR (1<<1) +#define PD_FILT_EN (1<<0) +#define BMC_CLK_CNT_MASK (0xff) + +//R8_CONTROL +#define BMC_BYTE_HI (1<<7) +#define TX_BIT_BACK (1<<6) +#define DATA_FLAG (1<<5) +#define RX_STATE_MASK (0x7<<2) +#define RX_STATE_0 (1<<2) +#define RX_STATE_1 (1<<3) +#define RX_STATE_2 (1<<4) +#define BMC_START (1<<1) +#define PD_TX_EN (1<<0) + +#define TX_SEL4_MASK (3<<6) +#define TX_SEL4_0 (1<<6) +#define TX_SEL4_1 (1<<7) + +#define TX_SEL3_MASK (3<<4) +#define TX_SEL3_0 (1<<4) +#define TX_SEL3_1 (1<<5) + +#define TX_SEL2_MASK (3<<2) +#define TX_SEL2_0 (1<<2) +#define TX_SEL2_1 (1<<3) + +#define TX_SEL1 (1<<0) + +#define BMC_TX_SZ_MASK (0x1ff) + +//R8_STATUS +#define IF_TX_END (1<<7) +#define IF_RX_RESET (1<<6) +#define IF_RX_ACT (1<<5) +#define IF_RX_BYTE (1<<4) +#define IF_RX_BIT (1<<3) +#define IFBUF_ERR (1<<2) +#define BMC_AUX_MASK (3<<0) +#define BMC_AUX_1 (1<<1) +#define BMC_AUX_0 (1<<0) + +// PORT CC1 +#define CC1_CE_MASK (7<<5) +#define CC1_CE_0 (1<<5) +#define CC1_CE_1 (2<<5) +#define CC1_CE_2 (4<<5) + +#define CC1_LVE (1<<4) +#define CC1_PU_MASK (3<<2) +#define CC1_PU_DISABLE (0<<2) +#define CC1_PU_330uA (1<<2) +#define CC1_PU_180uA (2<<2) +#define CC1_PU_80uA (3<<2) +#define PA_CC1_AI (1<<0) + +#define CC2_CE_MASK (7<<5) +#define CC2_CE_0 (1<<5) +#define CC2_CE_1 (2<<5) +#define CC2_CE_2 (4<<5) + +#define CC2_LVE (1<<4) +#define CC2_PU_MASK (3<<2) +#define CC2_PU_DISABLE (0<<2) +#define CC2_PU_330uA (1<<2) +#define CC2_PU_180uA (2<<2) +#define CC2_PU_80uA (3<<2) +#define PA_CC2_AI (1<<0) + + + +/* Peripheral declaration */ +#define TIM2 ((TIM_TypeDef *)TIM2_BASE) +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +#define TIM3 ((TIM_TypeDef *)TIM3_BASE) +#define TIM4 ((TIM_TypeDef *)TIM4_BASE) +#define TIM5 ((TIM_TypeDef *)TIM5_BASE) +#if defined(CH32V30x) +#define TIM6 ((TIM_TypeDef *) TIM6_BASE) +#define TIM7 ((TIM_TypeDef *) TIM7_BASE) +#define UART6 ((USART_TypeDef *) UART6_BASE) +#define UART7 ((USART_TypeDef *) UART7_BASE) +#define UART8 ((USART_TypeDef *) UART8_BASE) +#endif // defined(CH32V30x) +#if defined(CH32V10x) +#define TIM6 ((TIM_TypeDef *)TIM6_BASE) +#define TIM7 ((TIM_TypeDef *)TIM7_BASE) +#define TIM12 ((TIM_TypeDef *)TIM12_BASE) +#define TIM13 ((TIM_TypeDef *)TIM13_BASE) +#define TIM14 ((TIM_TypeDef *)TIM14_BASE) +#endif // defined(CH32V10x) +#define RTC ((RTC_TypeDef *)RTC_BASE) +#endif // defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +#define WWDG ((WWDG_TypeDef *)WWDG_BASE) +#define IWDG ((IWDG_TypeDef *)IWDG_BASE) +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +#define SPI2 ((SPI_TypeDef *)SPI2_BASE) +#if defined(CH32V10x) || defined(CH32V30x) +#define SPI3 ((SPI_TypeDef *) SPI3_BASE) +#endif +#endif // defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) || defined(CH32X03x) +#define USART2 ((USART_TypeDef *)USART2_BASE) +#define USART3 ((USART_TypeDef *)USART3_BASE) +#define UART4 ((USART_TypeDef *)UART4_BASE) +#if defined(CH32V10x) || defined(CH32V30x) +#define UART5 ((USART_TypeDef *) UART5_BASE) +#endif +#endif // defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) || defined(CH32X03x) +#define I2C1 ((I2C_TypeDef *)I2C1_BASE) +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +#define I2C2 ((I2C_TypeDef *)I2C2_BASE) +#endif +#if defined(CH32V20x) || defined(CH32V30x) +#define CAN1 ((CAN_TypeDef *)CAN1_BASE) +#endif +#if defined(CH32V30x) +#define CAN2 ((CAN_TypeDef *) CAN2_BASE) +#endif +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +#define BKP ((BKP_TypeDef *)BKP_BASE) +#endif +#define PWR ((PWR_TypeDef *)PWR_BASE) +#if defined(CH32V10x) || defined(CH32V30x) +#define DAC ((DAC_TypeDef *) DAC_BASE) +#endif + +#define AFIO ((AFIO_TypeDef *)AFIO_BASE) +#define EXTI ((EXTI_TypeDef *)EXTI_BASE) +#define GPIOA ((GPIO_TypeDef *)GPIOA_BASE) +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) || defined(CH32X03x) +#define GPIOB ((GPIO_TypeDef *)GPIOB_BASE) +#endif +#define GPIOC ((GPIO_TypeDef *)GPIOC_BASE) +#define GPIOD ((GPIO_TypeDef *)GPIOD_BASE) +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +#define GPIOE ((GPIO_TypeDef *)GPIOE_BASE) +#define GPIOF ((GPIO_TypeDef *)GPIOF_BASE) +#define GPIOG ((GPIO_TypeDef *)GPIOG_BASE) +#endif +#define ADC1 ((ADC_TypeDef *)ADC1_BASE) +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +#define ADC2 ((ADC_TypeDef *)ADC2_BASE) +#endif +#ifdef CH32X03x +#define TIM3 ((TIM_TypeDef *)TIM3_BASE) +#define TKey ((TKEY_TypeDef *)ADC1_BASE) +#define OPA ((OPACMP_TypeDef *)OPA_BASE) +#define USBFS ((USBFS_TypeDef *)USBFS_BASE) +#define USBPDWORD ((USBPD_TypeDef *)USBPD_BASE) +#define USBPD ((USBPD_DETAILED_TypeDef *)USBPD_BASE) +#define USBDH ((USBDH_TypeDef *)USBFS_BASE) + +#endif +#if defined(CH32V20x) || defined(CH32V30x) +#define TKey1 ((ADC_TypeDef *)ADC1_BASE) +#define TKey2 ((ADC_TypeDef *)ADC2_BASE) +#endif +#define TIM1 ((TIM_TypeDef *)TIM1_BASE) +#define SPI1 ((SPI_TypeDef *)SPI1_BASE) +#if defined(CH32V10x) || defined(CH32V30x) +#define TIM8 ((TIM_TypeDef *) TIM8_BASE) +#endif +#define USART1 ((USART_TypeDef *)USART1_BASE) +#if defined(CH32V10x) || defined(CH32V30x) +#define ADC3 ((ADC_TypeDef *) ADC3_BASE) +#define TIM15 ((TIM_TypeDef *) TIM15_BASE) +#define TIM16 ((TIM_TypeDef *) TIM16_BASE) +#define TIM17 ((TIM_TypeDef *) TIM17_BASE) +#define TIM9 ((TIM_TypeDef *) TIM9_BASE) +#define TIM10 ((TIM_TypeDef *) TIM10_BASE) +#define TIM11 ((TIM_TypeDef *) TIM11_BASE) +#endif // defined(CH32V10x) || defined(CH32V30x) +#if defined(CH32V30x) +#define SDIO ((SDIO_TypeDef *) SDIO_BASE) +#endif + +#define DMA1 ((DMA_TypeDef *)DMA1_BASE) +#define DMA1_Channel1 ((DMA_Channel_TypeDef *)DMA1_Channel1_BASE) +#define DMA1_Channel2 ((DMA_Channel_TypeDef *)DMA1_Channel2_BASE) +#define DMA1_Channel3 ((DMA_Channel_TypeDef *)DMA1_Channel3_BASE) +#define DMA1_Channel4 ((DMA_Channel_TypeDef *)DMA1_Channel4_BASE) +#define DMA1_Channel5 ((DMA_Channel_TypeDef *)DMA1_Channel5_BASE) +#define DMA1_Channel6 ((DMA_Channel_TypeDef *)DMA1_Channel6_BASE) +#define DMA1_Channel7 ((DMA_Channel_TypeDef *)DMA1_Channel7_BASE) +#if defined(CH32V20x) || defined(CH32X03x) +#define DMA1_Channel8 ((DMA_Channel_TypeDef *)DMA1_Channel8_BASE) +#endif +#if defined(CH32V10x) || defined(CH32V30x) +#define DMA2 ((DMA_TypeDef *) DMA2_BASE) +#define DMA2_EXTEN ((DMA_TypeDef *) DMA2_EXTEN_BASE) +#define DMA2_Channel1 ((DMA_Channel_TypeDef *) DMA2_Channel1_BASE) +#define DMA2_Channel2 ((DMA_Channel_TypeDef *) DMA2_Channel2_BASE) +#define DMA2_Channel3 ((DMA_Channel_TypeDef *) DMA2_Channel3_BASE) +#define DMA2_Channel4 ((DMA_Channel_TypeDef *) DMA2_Channel4_BASE) +#define DMA2_Channel5 ((DMA_Channel_TypeDef *) DMA2_Channel5_BASE) +#if defined(CH32V30x) +#define DMA2_Channel6 ((DMA_Channel_TypeDef *) DMA2_Channel6_BASE) +#define DMA2_Channel7 ((DMA_Channel_TypeDef *) DMA2_Channel7_BASE) +#define DMA2_Channel8 ((DMA_Channel_TypeDef *) DMA2_Channel8_BASE) +#define DMA2_Channel9 ((DMA_Channel_TypeDef *) DMA2_Channel9_BASE) +#define DMA2_Channel10 ((DMA_Channel_TypeDef *) DMA2_Channel10_BASE) +#define DMA2_Channel11 ((DMA_Channel_TypeDef *) DMA2_Channel11_BASE) +#endif // defined(CH32V30x) +#endif // defined(CH32V10x) || defined(CH32V30x) +#define RCC ((RCC_TypeDef *)RCC_BASE) +#define FLASH ((FLASH_TypeDef *)FLASH_R_BASE) +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +#define CRC ((CRC_TypeDef *)CRC_BASE) +#endif +#if defined(CH32V20x) || defined(CH32V30x) +#if defined(CH32V30x) +#define USBHSD ((USBHSD_TypeDef *) USBHS_BASE) +#define USBHSH ((USBHSH_TypeDef *) USBHS_BASE) +#endif // defined(CH32V30x) +#define USBOTG_FS ((USBOTG_FS_TypeDef *)USBFS_BASE) +#define USBOTG_H_FS ((USBOTG_FS_HOST_TypeDef *)USBFS_BASE) +#define OPA ((OPA_TypeDef *)OPA_BASE) +#if defined(CH32V20x) +#define ETH10M ((ETH10M_TypeDef *)ETH10M_BASE) +#elif defined(CH32V30x) +#define RNG ((RNG_TypeDef *) RNG_BASE) +#define ETH ((ETH_TypeDef *) ETH_BASE) +#endif +#endif // defined(CH32V20x) || defined(CH32V30x) +#define OB ((OB_TypeDef *)OB_BASE) +#define ESIG ((ESG_TypeDef *)ESIG_BASE) +// Mentioned in ch32v30x_dbgmcu.c, may not work on all processors. +#define INFO ((INFO_TypeDef *)INFO_BASE) +#define EXTEN ((EXTEN_TypeDef *)EXTEN_BASE) +#define EXTEND ((EXTEND_TypeDef *)EXTEN_BASE) // Alias to EXTEN + +#if defined(CH32V20x) +#if defined(CH32V20x_D8) || defined(CH32V20x_D8W) +#define OSC ((OSC_TypeDef *)OSC_BASE) +#endif +#endif + +#if defined(CH32V30x) +#define DVP ((DVP_TypeDef *) DVP_BASE) + +#define FSMC_Bank1 ((FSMC_Bank1_TypeDef *) FSMC_Bank1_R_BASE) +#define FSMC_Bank1E ((FSMC_Bank1E_TypeDef *) FSMC_Bank1E_R_BASE) +#define FSMC_Bank2 ((FSMC_Bank2_TypeDef *) FSMC_Bank2_R_BASE) +#endif + +#if defined(CH32V10x) +#define DBGMCU ((DBGMCU_TypeDef *)DBGMCU_BASE) +#endif + +/******************************************************************************/ +/* Peripheral Registers Bits Definition */ +/******************************************************************************/ + +/******************************************************************************/ +/* Analog to Digital Converter */ +/******************************************************************************/ + +/******************** Bit definition for ADC_STATR register ********************/ +#define ADC_AWD ((uint8_t)0x01) /* Analog watchdog flag */ +#define ADC_EOC ((uint8_t)0x02) /* End of conversion */ +#define ADC_JEOC ((uint8_t)0x04) /* Injected channel end of conversion */ +#define ADC_JSTRT ((uint8_t)0x08) /* Injected channel Start flag */ +#define ADC_STRT ((uint8_t)0x10) /* Regular channel Start flag */ + +/******************* Bit definition for ADC_CTLR1 register ********************/ +#define ADC_AWDCH ((uint32_t)0x0000001F) /* AWDCH[4:0] bits (Analog watchdog channel select bits) */ +#define ADC_AWDCH_0 ((uint32_t)0x00000001) /* Bit 0 */ +#define ADC_AWDCH_1 ((uint32_t)0x00000002) /* Bit 1 */ +#define ADC_AWDCH_2 ((uint32_t)0x00000004) /* Bit 2 */ +#define ADC_AWDCH_3 ((uint32_t)0x00000008) /* Bit 3 */ +#define ADC_AWDCH_4 ((uint32_t)0x00000010) /* Bit 4 */ + +#define ADC_EOCIE ((uint32_t)0x00000020) /* Interrupt enable for EOC */ +#define ADC_AWDIE ((uint32_t)0x00000040) /* Analog Watchdog interrupt enable */ +#define ADC_JEOCIE ((uint32_t)0x00000080) /* Interrupt enable for injected channels */ +#define ADC_SCAN ((uint32_t)0x00000100) /* Scan mode */ +#define ADC_AWDSGL ((uint32_t)0x00000200) /* Enable the watchdog on a single channel in scan mode */ +#define ADC_JAUTO ((uint32_t)0x00000400) /* Automatic injected group conversion */ +#define ADC_DISCEN ((uint32_t)0x00000800) /* Discontinuous mode on regular channels */ +#define ADC_JDISCEN ((uint32_t)0x00001000) /* Discontinuous mode on injected channels */ + +#define ADC_DISCNUM ((uint32_t)0x0000E000) /* DISCNUM[2:0] bits (Discontinuous mode channel count) */ +#define ADC_DISCNUM_0 ((uint32_t)0x00002000) /* Bit 0 */ +#define ADC_DISCNUM_1 ((uint32_t)0x00004000) /* Bit 1 */ +#define ADC_DISCNUM_2 ((uint32_t)0x00008000) /* Bit 2 */ + +#define ADC_DUALMOD ((uint32_t)0x000F0000) /* DUALMOD[3:0] bits (Dual mode selection) */ +#define ADC_DUALMOD_0 ((uint32_t)0x00010000) /* Bit 0 */ +#define ADC_DUALMOD_1 ((uint32_t)0x00020000) /* Bit 1 */ +#define ADC_DUALMOD_2 ((uint32_t)0x00040000) /* Bit 2 */ +#define ADC_DUALMOD_3 ((uint32_t)0x00080000) /* Bit 3 */ + +#define ADC_JAWDEN ((uint32_t)0x00400000) /* Analog watchdog enable on injected channels */ +#define ADC_AWDEN ((uint32_t)0x00800000) /* Analog watchdog enable on regular channels */ + +/******************* Bit definition for ADC_CTLR2 register ********************/ +#define ADC_ADON ((uint32_t)0x00000001) /* A/D Converter ON / OFF */ +#define ADC_CONT ((uint32_t)0x00000002) /* Continuous Conversion */ +#define ADC_CAL ((uint32_t)0x00000004) /* A/D Calibration */ +#define ADC_RSTCAL ((uint32_t)0x00000008) /* Reset Calibration */ +#define ADC_DMA ((uint32_t)0x00000100) /* Direct Memory access mode */ +#define ADC_ALIGN ((uint32_t)0x00000800) /* Data Alignment */ + +#define ADC_JEXTSEL ((uint32_t)0x00007000) /* JEXTSEL[2:0] bits (External event select for injected group) */ +#define ADC_JEXTSEL_0 ((uint32_t)0x00001000) /* Bit 0 */ +#define ADC_JEXTSEL_1 ((uint32_t)0x00002000) /* Bit 1 */ +#define ADC_JEXTSEL_2 ((uint32_t)0x00004000) /* Bit 2 */ + +#define ADC_JEXTTRIG ((uint32_t)0x00008000) /* External Trigger Conversion mode for injected channels */ + +#define ADC_EXTSEL ((uint32_t)0x000E0000) /* EXTSEL[2:0] bits (External Event Select for regular group) */ +#define ADC_EXTSEL_0 ((uint32_t)0x00020000) /* Bit 0 */ +#define ADC_EXTSEL_1 ((uint32_t)0x00040000) /* Bit 1 */ +#define ADC_EXTSEL_2 ((uint32_t)0x00080000) /* Bit 2 */ + +#define ADC_EXTTRIG ((uint32_t)0x00100000) /* External Trigger Conversion mode for regular channels */ +#define ADC_JSWSTART ((uint32_t)0x00200000) /* Start Conversion of injected channels */ +#define ADC_SWSTART ((uint32_t)0x00400000) /* Start Conversion of regular channels */ +#define ADC_TSVREFE ((uint32_t)0x00800000) /* Temperature Sensor and VREFINT Enable */ + +/****************** Bit definition for ADC_SAMPTR1 register *******************/ +#define ADC_SMP10 ((uint32_t)0x00000007) /* SMP10[2:0] bits (Channel 10 Sample time selection) */ +#define ADC_SMP10_0 ((uint32_t)0x00000001) /* Bit 0 */ +#define ADC_SMP10_1 ((uint32_t)0x00000002) /* Bit 1 */ +#define ADC_SMP10_2 ((uint32_t)0x00000004) /* Bit 2 */ + +#define ADC_SMP11 ((uint32_t)0x00000038) /* SMP11[2:0] bits (Channel 11 Sample time selection) */ +#define ADC_SMP11_0 ((uint32_t)0x00000008) /* Bit 0 */ +#define ADC_SMP11_1 ((uint32_t)0x00000010) /* Bit 1 */ +#define ADC_SMP11_2 ((uint32_t)0x00000020) /* Bit 2 */ + +#define ADC_SMP12 ((uint32_t)0x000001C0) /* SMP12[2:0] bits (Channel 12 Sample time selection) */ +#define ADC_SMP12_0 ((uint32_t)0x00000040) /* Bit 0 */ +#define ADC_SMP12_1 ((uint32_t)0x00000080) /* Bit 1 */ +#define ADC_SMP12_2 ((uint32_t)0x00000100) /* Bit 2 */ + +#define ADC_SMP13 ((uint32_t)0x00000E00) /* SMP13[2:0] bits (Channel 13 Sample time selection) */ +#define ADC_SMP13_0 ((uint32_t)0x00000200) /* Bit 0 */ +#define ADC_SMP13_1 ((uint32_t)0x00000400) /* Bit 1 */ +#define ADC_SMP13_2 ((uint32_t)0x00000800) /* Bit 2 */ + +#define ADC_SMP14 ((uint32_t)0x00007000) /* SMP14[2:0] bits (Channel 14 Sample time selection) */ +#define ADC_SMP14_0 ((uint32_t)0x00001000) /* Bit 0 */ +#define ADC_SMP14_1 ((uint32_t)0x00002000) /* Bit 1 */ +#define ADC_SMP14_2 ((uint32_t)0x00004000) /* Bit 2 */ + +#define ADC_SMP15 ((uint32_t)0x00038000) /* SMP15[2:0] bits (Channel 15 Sample time selection) */ +#define ADC_SMP15_0 ((uint32_t)0x00008000) /* Bit 0 */ +#define ADC_SMP15_1 ((uint32_t)0x00010000) /* Bit 1 */ +#define ADC_SMP15_2 ((uint32_t)0x00020000) /* Bit 2 */ + +#define ADC_SMP16 ((uint32_t)0x001C0000) /* SMP16[2:0] bits (Channel 16 Sample time selection) */ +#define ADC_SMP16_0 ((uint32_t)0x00040000) /* Bit 0 */ +#define ADC_SMP16_1 ((uint32_t)0x00080000) /* Bit 1 */ +#define ADC_SMP16_2 ((uint32_t)0x00100000) /* Bit 2 */ + +#define ADC_SMP17 ((uint32_t)0x00E00000) /* SMP17[2:0] bits (Channel 17 Sample time selection) */ +#define ADC_SMP17_0 ((uint32_t)0x00200000) /* Bit 0 */ +#define ADC_SMP17_1 ((uint32_t)0x00400000) /* Bit 1 */ +#define ADC_SMP17_2 ((uint32_t)0x00800000) /* Bit 2 */ + +/****************** Bit definition for ADC_SAMPTR2 register *******************/ +#define ADC_SMP0 ((uint32_t)0x00000007) /* SMP0[2:0] bits (Channel 0 Sample time selection) */ +#define ADC_SMP0_0 ((uint32_t)0x00000001) /* Bit 0 */ +#define ADC_SMP0_1 ((uint32_t)0x00000002) /* Bit 1 */ +#define ADC_SMP0_2 ((uint32_t)0x00000004) /* Bit 2 */ + +#define ADC_SMP1 ((uint32_t)0x00000038) /* SMP1[2:0] bits (Channel 1 Sample time selection) */ +#define ADC_SMP1_0 ((uint32_t)0x00000008) /* Bit 0 */ +#define ADC_SMP1_1 ((uint32_t)0x00000010) /* Bit 1 */ +#define ADC_SMP1_2 ((uint32_t)0x00000020) /* Bit 2 */ + +#define ADC_SMP2 ((uint32_t)0x000001C0) /* SMP2[2:0] bits (Channel 2 Sample time selection) */ +#define ADC_SMP2_0 ((uint32_t)0x00000040) /* Bit 0 */ +#define ADC_SMP2_1 ((uint32_t)0x00000080) /* Bit 1 */ +#define ADC_SMP2_2 ((uint32_t)0x00000100) /* Bit 2 */ + +#define ADC_SMP3 ((uint32_t)0x00000E00) /* SMP3[2:0] bits (Channel 3 Sample time selection) */ +#define ADC_SMP3_0 ((uint32_t)0x00000200) /* Bit 0 */ +#define ADC_SMP3_1 ((uint32_t)0x00000400) /* Bit 1 */ +#define ADC_SMP3_2 ((uint32_t)0x00000800) /* Bit 2 */ + +#define ADC_SMP4 ((uint32_t)0x00007000) /* SMP4[2:0] bits (Channel 4 Sample time selection) */ +#define ADC_SMP4_0 ((uint32_t)0x00001000) /* Bit 0 */ +#define ADC_SMP4_1 ((uint32_t)0x00002000) /* Bit 1 */ +#define ADC_SMP4_2 ((uint32_t)0x00004000) /* Bit 2 */ + +#define ADC_SMP5 ((uint32_t)0x00038000) /* SMP5[2:0] bits (Channel 5 Sample time selection) */ +#define ADC_SMP5_0 ((uint32_t)0x00008000) /* Bit 0 */ +#define ADC_SMP5_1 ((uint32_t)0x00010000) /* Bit 1 */ +#define ADC_SMP5_2 ((uint32_t)0x00020000) /* Bit 2 */ + +#define ADC_SMP6 ((uint32_t)0x001C0000) /* SMP6[2:0] bits (Channel 6 Sample time selection) */ +#define ADC_SMP6_0 ((uint32_t)0x00040000) /* Bit 0 */ +#define ADC_SMP6_1 ((uint32_t)0x00080000) /* Bit 1 */ +#define ADC_SMP6_2 ((uint32_t)0x00100000) /* Bit 2 */ + +#define ADC_SMP7 ((uint32_t)0x00E00000) /* SMP7[2:0] bits (Channel 7 Sample time selection) */ +#define ADC_SMP7_0 ((uint32_t)0x00200000) /* Bit 0 */ +#define ADC_SMP7_1 ((uint32_t)0x00400000) /* Bit 1 */ +#define ADC_SMP7_2 ((uint32_t)0x00800000) /* Bit 2 */ + +#define ADC_SMP8 ((uint32_t)0x07000000) /* SMP8[2:0] bits (Channel 8 Sample time selection) */ +#define ADC_SMP8_0 ((uint32_t)0x01000000) /* Bit 0 */ +#define ADC_SMP8_1 ((uint32_t)0x02000000) /* Bit 1 */ +#define ADC_SMP8_2 ((uint32_t)0x04000000) /* Bit 2 */ + +#define ADC_SMP9 ((uint32_t)0x38000000) /* SMP9[2:0] bits (Channel 9 Sample time selection) */ +#define ADC_SMP9_0 ((uint32_t)0x08000000) /* Bit 0 */ +#define ADC_SMP9_1 ((uint32_t)0x10000000) /* Bit 1 */ +#define ADC_SMP9_2 ((uint32_t)0x20000000) /* Bit 2 */ + +/****************** Bit definition for ADC_IOFR1 register *******************/ +#define ADC_JOFFSET1 ((uint16_t)0x0FFF) /* Data offset for injected channel 1 */ + +/****************** Bit definition for ADC_IOFR2 register *******************/ +#define ADC_JOFFSET2 ((uint16_t)0x0FFF) /* Data offset for injected channel 2 */ + +/****************** Bit definition for ADC_IOFR3 register *******************/ +#define ADC_JOFFSET3 ((uint16_t)0x0FFF) /* Data offset for injected channel 3 */ + +/****************** Bit definition for ADC_IOFR4 register *******************/ +#define ADC_JOFFSET4 ((uint16_t)0x0FFF) /* Data offset for injected channel 4 */ + +/******************* Bit definition for ADC_WDHTR register ********************/ +#define ADC_HT ((uint16_t)0x0FFF) /* Analog watchdog high threshold */ + +/******************* Bit definition for ADC_WDLTR register ********************/ +#define ADC_LT ((uint16_t)0x0FFF) /* Analog watchdog low threshold */ + +/******************* Bit definition for ADC_RSQR1 register *******************/ +#define ADC_SQ13 ((uint32_t)0x0000001F) /* SQ13[4:0] bits (13th conversion in regular sequence) */ +#define ADC_SQ13_0 ((uint32_t)0x00000001) /* Bit 0 */ +#define ADC_SQ13_1 ((uint32_t)0x00000002) /* Bit 1 */ +#define ADC_SQ13_2 ((uint32_t)0x00000004) /* Bit 2 */ +#define ADC_SQ13_3 ((uint32_t)0x00000008) /* Bit 3 */ +#define ADC_SQ13_4 ((uint32_t)0x00000010) /* Bit 4 */ + +#define ADC_SQ14 ((uint32_t)0x000003E0) /* SQ14[4:0] bits (14th conversion in regular sequence) */ +#define ADC_SQ14_0 ((uint32_t)0x00000020) /* Bit 0 */ +#define ADC_SQ14_1 ((uint32_t)0x00000040) /* Bit 1 */ +#define ADC_SQ14_2 ((uint32_t)0x00000080) /* Bit 2 */ +#define ADC_SQ14_3 ((uint32_t)0x00000100) /* Bit 3 */ +#define ADC_SQ14_4 ((uint32_t)0x00000200) /* Bit 4 */ + +#define ADC_SQ15 ((uint32_t)0x00007C00) /* SQ15[4:0] bits (15th conversion in regular sequence) */ +#define ADC_SQ15_0 ((uint32_t)0x00000400) /* Bit 0 */ +#define ADC_SQ15_1 ((uint32_t)0x00000800) /* Bit 1 */ +#define ADC_SQ15_2 ((uint32_t)0x00001000) /* Bit 2 */ +#define ADC_SQ15_3 ((uint32_t)0x00002000) /* Bit 3 */ +#define ADC_SQ15_4 ((uint32_t)0x00004000) /* Bit 4 */ + +#define ADC_SQ16 ((uint32_t)0x000F8000) /* SQ16[4:0] bits (16th conversion in regular sequence) */ +#define ADC_SQ16_0 ((uint32_t)0x00008000) /* Bit 0 */ +#define ADC_SQ16_1 ((uint32_t)0x00010000) /* Bit 1 */ +#define ADC_SQ16_2 ((uint32_t)0x00020000) /* Bit 2 */ +#define ADC_SQ16_3 ((uint32_t)0x00040000) /* Bit 3 */ +#define ADC_SQ16_4 ((uint32_t)0x00080000) /* Bit 4 */ + +#define ADC_L ((uint32_t)0x00F00000) /* L[3:0] bits (Regular channel sequence length) */ +#define ADC_L_0 ((uint32_t)0x00100000) /* Bit 0 */ +#define ADC_L_1 ((uint32_t)0x00200000) /* Bit 1 */ +#define ADC_L_2 ((uint32_t)0x00400000) /* Bit 2 */ +#define ADC_L_3 ((uint32_t)0x00800000) /* Bit 3 */ + +/******************* Bit definition for ADC_RSQR2 register *******************/ +#define ADC_SQ7 ((uint32_t)0x0000001F) /* SQ7[4:0] bits (7th conversion in regular sequence) */ +#define ADC_SQ7_0 ((uint32_t)0x00000001) /* Bit 0 */ +#define ADC_SQ7_1 ((uint32_t)0x00000002) /* Bit 1 */ +#define ADC_SQ7_2 ((uint32_t)0x00000004) /* Bit 2 */ +#define ADC_SQ7_3 ((uint32_t)0x00000008) /* Bit 3 */ +#define ADC_SQ7_4 ((uint32_t)0x00000010) /* Bit 4 */ + +#define ADC_SQ8 ((uint32_t)0x000003E0) /* SQ8[4:0] bits (8th conversion in regular sequence) */ +#define ADC_SQ8_0 ((uint32_t)0x00000020) /* Bit 0 */ +#define ADC_SQ8_1 ((uint32_t)0x00000040) /* Bit 1 */ +#define ADC_SQ8_2 ((uint32_t)0x00000080) /* Bit 2 */ +#define ADC_SQ8_3 ((uint32_t)0x00000100) /* Bit 3 */ +#define ADC_SQ8_4 ((uint32_t)0x00000200) /* Bit 4 */ + +#define ADC_SQ9 ((uint32_t)0x00007C00) /* SQ9[4:0] bits (9th conversion in regular sequence) */ +#define ADC_SQ9_0 ((uint32_t)0x00000400) /* Bit 0 */ +#define ADC_SQ9_1 ((uint32_t)0x00000800) /* Bit 1 */ +#define ADC_SQ9_2 ((uint32_t)0x00001000) /* Bit 2 */ +#define ADC_SQ9_3 ((uint32_t)0x00002000) /* Bit 3 */ +#define ADC_SQ9_4 ((uint32_t)0x00004000) /* Bit 4 */ + +#define ADC_SQ10 ((uint32_t)0x000F8000) /* SQ10[4:0] bits (10th conversion in regular sequence) */ +#define ADC_SQ10_0 ((uint32_t)0x00008000) /* Bit 0 */ +#define ADC_SQ10_1 ((uint32_t)0x00010000) /* Bit 1 */ +#define ADC_SQ10_2 ((uint32_t)0x00020000) /* Bit 2 */ +#define ADC_SQ10_3 ((uint32_t)0x00040000) /* Bit 3 */ +#define ADC_SQ10_4 ((uint32_t)0x00080000) /* Bit 4 */ + +#define ADC_SQ11 ((uint32_t)0x01F00000) /* SQ11[4:0] bits (11th conversion in regular sequence) */ +#define ADC_SQ11_0 ((uint32_t)0x00100000) /* Bit 0 */ +#define ADC_SQ11_1 ((uint32_t)0x00200000) /* Bit 1 */ +#define ADC_SQ11_2 ((uint32_t)0x00400000) /* Bit 2 */ +#define ADC_SQ11_3 ((uint32_t)0x00800000) /* Bit 3 */ +#define ADC_SQ11_4 ((uint32_t)0x01000000) /* Bit 4 */ + +#define ADC_SQ12 ((uint32_t)0x3E000000) /* SQ12[4:0] bits (12th conversion in regular sequence) */ +#define ADC_SQ12_0 ((uint32_t)0x02000000) /* Bit 0 */ +#define ADC_SQ12_1 ((uint32_t)0x04000000) /* Bit 1 */ +#define ADC_SQ12_2 ((uint32_t)0x08000000) /* Bit 2 */ +#define ADC_SQ12_3 ((uint32_t)0x10000000) /* Bit 3 */ +#define ADC_SQ12_4 ((uint32_t)0x20000000) /* Bit 4 */ + +/******************* Bit definition for ADC_RSQR3 register *******************/ +#define ADC_SQ1 ((uint32_t)0x0000001F) /* SQ1[4:0] bits (1st conversion in regular sequence) */ +#define ADC_SQ1_0 ((uint32_t)0x00000001) /* Bit 0 */ +#define ADC_SQ1_1 ((uint32_t)0x00000002) /* Bit 1 */ +#define ADC_SQ1_2 ((uint32_t)0x00000004) /* Bit 2 */ +#define ADC_SQ1_3 ((uint32_t)0x00000008) /* Bit 3 */ +#define ADC_SQ1_4 ((uint32_t)0x00000010) /* Bit 4 */ + +#define ADC_SQ2 ((uint32_t)0x000003E0) /* SQ2[4:0] bits (2nd conversion in regular sequence) */ +#define ADC_SQ2_0 ((uint32_t)0x00000020) /* Bit 0 */ +#define ADC_SQ2_1 ((uint32_t)0x00000040) /* Bit 1 */ +#define ADC_SQ2_2 ((uint32_t)0x00000080) /* Bit 2 */ +#define ADC_SQ2_3 ((uint32_t)0x00000100) /* Bit 3 */ +#define ADC_SQ2_4 ((uint32_t)0x00000200) /* Bit 4 */ + +#define ADC_SQ3 ((uint32_t)0x00007C00) /* SQ3[4:0] bits (3rd conversion in regular sequence) */ +#define ADC_SQ3_0 ((uint32_t)0x00000400) /* Bit 0 */ +#define ADC_SQ3_1 ((uint32_t)0x00000800) /* Bit 1 */ +#define ADC_SQ3_2 ((uint32_t)0x00001000) /* Bit 2 */ +#define ADC_SQ3_3 ((uint32_t)0x00002000) /* Bit 3 */ +#define ADC_SQ3_4 ((uint32_t)0x00004000) /* Bit 4 */ + +#define ADC_SQ4 ((uint32_t)0x000F8000) /* SQ4[4:0] bits (4th conversion in regular sequence) */ +#define ADC_SQ4_0 ((uint32_t)0x00008000) /* Bit 0 */ +#define ADC_SQ4_1 ((uint32_t)0x00010000) /* Bit 1 */ +#define ADC_SQ4_2 ((uint32_t)0x00020000) /* Bit 2 */ +#define ADC_SQ4_3 ((uint32_t)0x00040000) /* Bit 3 */ +#define ADC_SQ4_4 ((uint32_t)0x00080000) /* Bit 4 */ + +#define ADC_SQ5 ((uint32_t)0x01F00000) /* SQ5[4:0] bits (5th conversion in regular sequence) */ +#define ADC_SQ5_0 ((uint32_t)0x00100000) /* Bit 0 */ +#define ADC_SQ5_1 ((uint32_t)0x00200000) /* Bit 1 */ +#define ADC_SQ5_2 ((uint32_t)0x00400000) /* Bit 2 */ +#define ADC_SQ5_3 ((uint32_t)0x00800000) /* Bit 3 */ +#define ADC_SQ5_4 ((uint32_t)0x01000000) /* Bit 4 */ + +#define ADC_SQ6 ((uint32_t)0x3E000000) /* SQ6[4:0] bits (6th conversion in regular sequence) */ +#define ADC_SQ6_0 ((uint32_t)0x02000000) /* Bit 0 */ +#define ADC_SQ6_1 ((uint32_t)0x04000000) /* Bit 1 */ +#define ADC_SQ6_2 ((uint32_t)0x08000000) /* Bit 2 */ +#define ADC_SQ6_3 ((uint32_t)0x10000000) /* Bit 3 */ +#define ADC_SQ6_4 ((uint32_t)0x20000000) /* Bit 4 */ + +/******************* Bit definition for ADC_ISQR register *******************/ +#define ADC_JSQ1 ((uint32_t)0x0000001F) /* JSQ1[4:0] bits (1st conversion in injected sequence) */ +#define ADC_JSQ1_0 ((uint32_t)0x00000001) /* Bit 0 */ +#define ADC_JSQ1_1 ((uint32_t)0x00000002) /* Bit 1 */ +#define ADC_JSQ1_2 ((uint32_t)0x00000004) /* Bit 2 */ +#define ADC_JSQ1_3 ((uint32_t)0x00000008) /* Bit 3 */ +#define ADC_JSQ1_4 ((uint32_t)0x00000010) /* Bit 4 */ + +#define ADC_JSQ2 ((uint32_t)0x000003E0) /* JSQ2[4:0] bits (2nd conversion in injected sequence) */ +#define ADC_JSQ2_0 ((uint32_t)0x00000020) /* Bit 0 */ +#define ADC_JSQ2_1 ((uint32_t)0x00000040) /* Bit 1 */ +#define ADC_JSQ2_2 ((uint32_t)0x00000080) /* Bit 2 */ +#define ADC_JSQ2_3 ((uint32_t)0x00000100) /* Bit 3 */ +#define ADC_JSQ2_4 ((uint32_t)0x00000200) /* Bit 4 */ + +#define ADC_JSQ3 ((uint32_t)0x00007C00) /* JSQ3[4:0] bits (3rd conversion in injected sequence) */ +#define ADC_JSQ3_0 ((uint32_t)0x00000400) /* Bit 0 */ +#define ADC_JSQ3_1 ((uint32_t)0x00000800) /* Bit 1 */ +#define ADC_JSQ3_2 ((uint32_t)0x00001000) /* Bit 2 */ +#define ADC_JSQ3_3 ((uint32_t)0x00002000) /* Bit 3 */ +#define ADC_JSQ3_4 ((uint32_t)0x00004000) /* Bit 4 */ + +#define ADC_JSQ4 ((uint32_t)0x000F8000) /* JSQ4[4:0] bits (4th conversion in injected sequence) */ +#define ADC_JSQ4_0 ((uint32_t)0x00008000) /* Bit 0 */ +#define ADC_JSQ4_1 ((uint32_t)0x00010000) /* Bit 1 */ +#define ADC_JSQ4_2 ((uint32_t)0x00020000) /* Bit 2 */ +#define ADC_JSQ4_3 ((uint32_t)0x00040000) /* Bit 3 */ +#define ADC_JSQ4_4 ((uint32_t)0x00080000) /* Bit 4 */ + +#define ADC_JL ((uint32_t)0x00300000) /* JL[1:0] bits (Injected Sequence length) */ +#define ADC_JL_0 ((uint32_t)0x00100000) /* Bit 0 */ +#define ADC_JL_1 ((uint32_t)0x00200000) /* Bit 1 */ + +/******************* Bit definition for ADC_IDATAR1 register *******************/ +#define ADC_IDATAR1_JDATA ((uint16_t)0xFFFF) /* Injected data */ + +/******************* Bit definition for ADC_IDATAR2 register *******************/ +#define ADC_IDATAR2_JDATA ((uint16_t)0xFFFF) /* Injected data */ + +/******************* Bit definition for ADC_IDATAR3 register *******************/ +#define ADC_IDATAR3_JDATA ((uint16_t)0xFFFF) /* Injected data */ + +/******************* Bit definition for ADC_IDATAR4 register *******************/ +#define ADC_IDATAR4_JDATA ((uint16_t)0xFFFF) /* Injected data */ + +/******************** Bit definition for ADC_RDATAR register ********************/ +#define ADC_RDATAR_DATA ((uint32_t)0x0000FFFF) /* Regular data */ +#define ADC_RDATAR_ADC2DATA ((uint32_t)0xFFFF0000) /* ADC2 data */ + +#if defined(CH32V20x) || defined(CH32V30x) +/******************************************************************************/ +/* Backup registers */ +/******************************************************************************/ + +/******************* Bit definition for BKP_DATAR1 register ********************/ +#define BKP_DATAR1_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR2 register ********************/ +#define BKP_DATAR2_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR3 register ********************/ +#define BKP_DATAR3_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR4 register ********************/ +#define BKP_DATAR4_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR5 register ********************/ +#define BKP_DATAR5_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR6 register ********************/ +#define BKP_DATAR6_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR7 register ********************/ +#define BKP_DATAR7_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR8 register ********************/ +#define BKP_DATAR8_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR9 register ********************/ +#define BKP_DATAR9_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR10 register *******************/ +#define BKP_DATAR10_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR11 register *******************/ +#define BKP_DATAR11_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR12 register *******************/ +#define BKP_DATAR12_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR13 register *******************/ +#define BKP_DATAR13_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR14 register *******************/ +#define BKP_DATAR14_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR15 register *******************/ +#define BKP_DATAR15_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR16 register *******************/ +#define BKP_DATAR16_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR17 register *******************/ +#define BKP_DATAR17_D ((uint16_t)0xFFFF) /* Backup data */ + +/****************** Bit definition for BKP_DATAR18 register ********************/ +#define BKP_DATAR18_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR19 register *******************/ +#define BKP_DATAR19_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR20 register *******************/ +#define BKP_DATAR20_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR21 register *******************/ +#define BKP_DATAR21_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR22 register *******************/ +#define BKP_DATAR22_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR23 register *******************/ +#define BKP_DATAR23_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR24 register *******************/ +#define BKP_DATAR24_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR25 register *******************/ +#define BKP_DATAR25_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR26 register *******************/ +#define BKP_DATAR26_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR27 register *******************/ +#define BKP_DATAR27_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR28 register *******************/ +#define BKP_DATAR28_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR29 register *******************/ +#define BKP_DATAR29_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR30 register *******************/ +#define BKP_DATAR30_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR31 register *******************/ +#define BKP_DATAR31_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR32 register *******************/ +#define BKP_DATAR32_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR33 register *******************/ +#define BKP_DATAR33_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR34 register *******************/ +#define BKP_DATAR34_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR35 register *******************/ +#define BKP_DATAR35_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR36 register *******************/ +#define BKP_DATAR36_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR37 register *******************/ +#define BKP_DATAR37_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR38 register *******************/ +#define BKP_DATAR38_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR39 register *******************/ +#define BKP_DATAR39_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR40 register *******************/ +#define BKP_DATAR40_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR41 register *******************/ +#define BKP_DATAR41_D ((uint16_t)0xFFFF) /* Backup data */ + +/******************* Bit definition for BKP_DATAR42 register *******************/ +#define BKP_DATAR42_D ((uint16_t)0xFFFF) /* Backup data */ + +/****************** Bit definition for BKP_OCTLR register *******************/ +#define BKP_CAL ((uint16_t)0x007F) /* Calibration value */ +#define BKP_CCO ((uint16_t)0x0080) /* Calibration Clock Output */ +#define BKP_ASOE ((uint16_t)0x0100) /* Alarm or Second Output Enable */ +#define BKP_ASOS ((uint16_t)0x0200) /* Alarm or Second Output Selection */ + +/******************** Bit definition for BKP_TPCTLR register ********************/ +#define BKP_TPE ((uint8_t)0x01) /* TAMPER pin enable */ +#define BKP_TPAL ((uint8_t)0x02) /* TAMPER pin active level */ + +/******************* Bit definition for BKP_TPCSR register ********************/ +#define BKP_CTE ((uint16_t)0x0001) /* Clear Tamper event */ +#define BKP_CTI ((uint16_t)0x0002) /* Clear Tamper Interrupt */ +#define BKP_TPIE ((uint16_t)0x0004) /* TAMPER Pin interrupt enable */ +#define BKP_TEF ((uint16_t)0x0100) /* Tamper Event Flag */ +#define BKP_TIF ((uint16_t)0x0200) /* Tamper Interrupt Flag */ + +/******************************************************************************/ +/* Controller Area Network */ +/******************************************************************************/ + +/******************* Bit definition for CAN_CTLR register ********************/ +#define CAN_CTLR_INRQ ((uint16_t)0x0001) /* Initialization Request */ +#define CAN_CTLR_SLEEP ((uint16_t)0x0002) /* Sleep Mode Request */ +#define CAN_CTLR_TXFP ((uint16_t)0x0004) /* Transmit FIFO Priority */ +#define CAN_CTLR_RFLM ((uint16_t)0x0008) /* Receive FIFO Locked Mode */ +#define CAN_CTLR_NART ((uint16_t)0x0010) /* No Automatic Retransmission */ +#define CAN_CTLR_AWUM ((uint16_t)0x0020) /* Automatic Wakeup Mode */ +#define CAN_CTLR_ABOM ((uint16_t)0x0040) /* Automatic Bus-Off Management */ +#define CAN_CTLR_TTCM ((uint16_t)0x0080) /* Time Triggered Communication Mode */ +#define CAN_CTLR_RESET ((uint16_t)0x8000) /* CAN software master reset */ + +/******************* Bit definition for CAN_STATR register ********************/ +#define CAN_STATR_INAK ((uint16_t)0x0001) /* Initialization Acknowledge */ +#define CAN_STATR_SLAK ((uint16_t)0x0002) /* Sleep Acknowledge */ +#define CAN_STATR_ERRI ((uint16_t)0x0004) /* Error Interrupt */ +#define CAN_STATR_WKUI ((uint16_t)0x0008) /* Wakeup Interrupt */ +#define CAN_STATR_SLAKI ((uint16_t)0x0010) /* Sleep Acknowledge Interrupt */ +#define CAN_STATR_TXM ((uint16_t)0x0100) /* Transmit Mode */ +#define CAN_STATR_RXM ((uint16_t)0x0200) /* Receive Mode */ +#define CAN_STATR_SAMP ((uint16_t)0x0400) /* Last Sample Point */ +#define CAN_STATR_RX ((uint16_t)0x0800) /* CAN Rx Signal */ + +/******************* Bit definition for CAN_TSTATR register ********************/ +#define CAN_TSTATR_RQCP0 ((uint32_t)0x00000001) /* Request Completed Mailbox0 */ +#define CAN_TSTATR_TXOK0 ((uint32_t)0x00000002) /* Transmission OK of Mailbox0 */ +#define CAN_TSTATR_ALST0 ((uint32_t)0x00000004) /* Arbitration Lost for Mailbox0 */ +#define CAN_TSTATR_TERR0 ((uint32_t)0x00000008) /* Transmission Error of Mailbox0 */ +#define CAN_TSTATR_ABRQ0 ((uint32_t)0x00000080) /* Abort Request for Mailbox0 */ +#define CAN_TSTATR_RQCP1 ((uint32_t)0x00000100) /* Request Completed Mailbox1 */ +#define CAN_TSTATR_TXOK1 ((uint32_t)0x00000200) /* Transmission OK of Mailbox1 */ +#define CAN_TSTATR_ALST1 ((uint32_t)0x00000400) /* Arbitration Lost for Mailbox1 */ +#define CAN_TSTATR_TERR1 ((uint32_t)0x00000800) /* Transmission Error of Mailbox1 */ +#define CAN_TSTATR_ABRQ1 ((uint32_t)0x00008000) /* Abort Request for Mailbox 1 */ +#define CAN_TSTATR_RQCP2 ((uint32_t)0x00010000) /* Request Completed Mailbox2 */ +#define CAN_TSTATR_TXOK2 ((uint32_t)0x00020000) /* Transmission OK of Mailbox 2 */ +#define CAN_TSTATR_ALST2 ((uint32_t)0x00040000) /* Arbitration Lost for mailbox 2 */ +#define CAN_TSTATR_TERR2 ((uint32_t)0x00080000) /* Transmission Error of Mailbox 2 */ +#define CAN_TSTATR_ABRQ2 ((uint32_t)0x00800000) /* Abort Request for Mailbox 2 */ +#define CAN_TSTATR_CODE ((uint32_t)0x03000000) /* Mailbox Code */ + +#define CAN_TSTATR_TME ((uint32_t)0x1C000000) /* TME[2:0] bits */ +#define CAN_TSTATR_TME0 ((uint32_t)0x04000000) /* Transmit Mailbox 0 Empty */ +#define CAN_TSTATR_TME1 ((uint32_t)0x08000000) /* Transmit Mailbox 1 Empty */ +#define CAN_TSTATR_TME2 ((uint32_t)0x10000000) /* Transmit Mailbox 2 Empty */ + +#define CAN_TSTATR_LOW ((uint32_t)0xE0000000) /* LOW[2:0] bits */ +#define CAN_TSTATR_LOW0 ((uint32_t)0x20000000) /* Lowest Priority Flag for Mailbox 0 */ +#define CAN_TSTATR_LOW1 ((uint32_t)0x40000000) /* Lowest Priority Flag for Mailbox 1 */ +#define CAN_TSTATR_LOW2 ((uint32_t)0x80000000) /* Lowest Priority Flag for Mailbox 2 */ + +/******************* Bit definition for CAN_RFIFO0 register *******************/ +#define CAN_RFIFO0_FMP0 ((uint8_t)0x03) /* FIFO 0 Message Pending */ +#define CAN_RFIFO0_FULL0 ((uint8_t)0x08) /* FIFO 0 Full */ +#define CAN_RFIFO0_FOVR0 ((uint8_t)0x10) /* FIFO 0 Overrun */ +#define CAN_RFIFO0_RFOM0 ((uint8_t)0x20) /* Release FIFO 0 Output Mailbox */ + +/******************* Bit definition for CAN_RFIFO1 register *******************/ +#define CAN_RFIFO1_FMP1 ((uint8_t)0x03) /* FIFO 1 Message Pending */ +#define CAN_RFIFO1_FULL1 ((uint8_t)0x08) /* FIFO 1 Full */ +#define CAN_RFIFO1_FOVR1 ((uint8_t)0x10) /* FIFO 1 Overrun */ +#define CAN_RFIFO1_RFOM1 ((uint8_t)0x20) /* Release FIFO 1 Output Mailbox */ + +/******************** Bit definition for CAN_INTENR register *******************/ +#define CAN_INTENR_TMEIE ((uint32_t)0x00000001) /* Transmit Mailbox Empty Interrupt Enable */ +#define CAN_INTENR_FMPIE0 ((uint32_t)0x00000002) /* FIFO Message Pending Interrupt Enable */ +#define CAN_INTENR_FFIE0 ((uint32_t)0x00000004) /* FIFO Full Interrupt Enable */ +#define CAN_INTENR_FOVIE0 ((uint32_t)0x00000008) /* FIFO Overrun Interrupt Enable */ +#define CAN_INTENR_FMPIE1 ((uint32_t)0x00000010) /* FIFO Message Pending Interrupt Enable */ +#define CAN_INTENR_FFIE1 ((uint32_t)0x00000020) /* FIFO Full Interrupt Enable */ +#define CAN_INTENR_FOVIE1 ((uint32_t)0x00000040) /* FIFO Overrun Interrupt Enable */ +#define CAN_INTENR_EWGIE ((uint32_t)0x00000100) /* Error Warning Interrupt Enable */ +#define CAN_INTENR_EPVIE ((uint32_t)0x00000200) /* Error Passive Interrupt Enable */ +#define CAN_INTENR_BOFIE ((uint32_t)0x00000400) /* Bus-Off Interrupt Enable */ +#define CAN_INTENR_LECIE ((uint32_t)0x00000800) /* Last Error Code Interrupt Enable */ +#define CAN_INTENR_ERRIE ((uint32_t)0x00008000) /* Error Interrupt Enable */ +#define CAN_INTENR_WKUIE ((uint32_t)0x00010000) /* Wakeup Interrupt Enable */ +#define CAN_INTENR_SLKIE ((uint32_t)0x00020000) /* Sleep Interrupt Enable */ + +/******************** Bit definition for CAN_ERRSR register *******************/ +#define CAN_ERRSR_EWGF ((uint32_t)0x00000001) /* Error Warning Flag */ +#define CAN_ERRSR_EPVF ((uint32_t)0x00000002) /* Error Passive Flag */ +#define CAN_ERRSR_BOFF ((uint32_t)0x00000004) /* Bus-Off Flag */ + +#define CAN_ERRSR_LEC ((uint32_t)0x00000070) /* LEC[2:0] bits (Last Error Code) */ +#define CAN_ERRSR_LEC_0 ((uint32_t)0x00000010) /* Bit 0 */ +#define CAN_ERRSR_LEC_1 ((uint32_t)0x00000020) /* Bit 1 */ +#define CAN_ERRSR_LEC_2 ((uint32_t)0x00000040) /* Bit 2 */ + +#define CAN_ERRSR_TEC ((uint32_t)0x00FF0000) /* Least significant byte of the 9-bit Transmit Error Counter */ +#define CAN_ERRSR_REC ((uint32_t)0xFF000000) /* Receive Error Counter */ + +/******************* Bit definition for CAN_BTIMR register ********************/ +#define CAN_BTIMR_BRP ((uint32_t)0x000003FF) /* Baud Rate Prescaler */ +#define CAN_BTIMR_TS1 ((uint32_t)0x000F0000) /* Time Segment 1 */ +#define CAN_BTIMR_TS2 ((uint32_t)0x00700000) /* Time Segment 2 */ +#define CAN_BTIMR_SJW ((uint32_t)0x03000000) /* Resynchronization Jump Width */ +#define CAN_BTIMR_LBKM ((uint32_t)0x40000000) /* Loop Back Mode (Debug) */ +#define CAN_BTIMR_SILM ((uint32_t)0x80000000) /* Silent Mode */ + +/****************** Bit definition for CAN_TXMI0R register ********************/ +#define CAN_TXMI0R_TXRQ ((uint32_t)0x00000001) /* Transmit Mailbox Request */ +#define CAN_TXMI0R_RTR ((uint32_t)0x00000002) /* Remote Transmission Request */ +#define CAN_TXMI0R_IDE ((uint32_t)0x00000004) /* Identifier Extension */ +#define CAN_TXMI0R_EXID ((uint32_t)0x001FFFF8) /* Extended Identifier */ +#define CAN_TXMI0R_STID ((uint32_t)0xFFE00000) /* Standard Identifier or Extended Identifier */ + +/****************** Bit definition for CAN_TXMDT0R register *******************/ +#define CAN_TXMDT0R_DLC ((uint32_t)0x0000000F) /* Data Length Code */ +#define CAN_TXMDT0R_TGT ((uint32_t)0x00000100) /* Transmit Global Time */ +#define CAN_TXMDT0R_TIME ((uint32_t)0xFFFF0000) /* Message Time Stamp */ + +/****************** Bit definition for CAN_TXMDL0R register *******************/ +#define CAN_TXMDL0R_DATA0 ((uint32_t)0x000000FF) /* Data byte 0 */ +#define CAN_TXMDL0R_DATA1 ((uint32_t)0x0000FF00) /* Data byte 1 */ +#define CAN_TXMDL0R_DATA2 ((uint32_t)0x00FF0000) /* Data byte 2 */ +#define CAN_TXMDL0R_DATA3 ((uint32_t)0xFF000000) /* Data byte 3 */ + +/****************** Bit definition for CAN_TXMDH0R register *******************/ +#define CAN_TXMDH0R_DATA4 ((uint32_t)0x000000FF) /* Data byte 4 */ +#define CAN_TXMDH0R_DATA5 ((uint32_t)0x0000FF00) /* Data byte 5 */ +#define CAN_TXMDH0R_DATA6 ((uint32_t)0x00FF0000) /* Data byte 6 */ +#define CAN_TXMDH0R_DATA7 ((uint32_t)0xFF000000) /* Data byte 7 */ + +/******************* Bit definition for CAN_TXMI1R register *******************/ +#define CAN_TXMI1R_TXRQ ((uint32_t)0x00000001) /* Transmit Mailbox Request */ +#define CAN_TXMI1R_RTR ((uint32_t)0x00000002) /* Remote Transmission Request */ +#define CAN_TXMI1R_IDE ((uint32_t)0x00000004) /* Identifier Extension */ +#define CAN_TXMI1R_EXID ((uint32_t)0x001FFFF8) /* Extended Identifier */ +#define CAN_TXMI1R_STID ((uint32_t)0xFFE00000) /* Standard Identifier or Extended Identifier */ + +/******************* Bit definition for CAN_TXMDT1R register ******************/ +#define CAN_TXMDT1R_DLC ((uint32_t)0x0000000F) /* Data Length Code */ +#define CAN_TXMDT1R_TGT ((uint32_t)0x00000100) /* Transmit Global Time */ +#define CAN_TXMDT1R_TIME ((uint32_t)0xFFFF0000) /* Message Time Stamp */ + +/******************* Bit definition for CAN_TXMDL1R register ******************/ +#define CAN_TXMDL1R_DATA0 ((uint32_t)0x000000FF) /* Data byte 0 */ +#define CAN_TXMDL1R_DATA1 ((uint32_t)0x0000FF00) /* Data byte 1 */ +#define CAN_TXMDL1R_DATA2 ((uint32_t)0x00FF0000) /* Data byte 2 */ +#define CAN_TXMDL1R_DATA3 ((uint32_t)0xFF000000) /* Data byte 3 */ + +/******************* Bit definition for CAN_TXMDH1R register ******************/ +#define CAN_TXMDH1R_DATA4 ((uint32_t)0x000000FF) /* Data byte 4 */ +#define CAN_TXMDH1R_DATA5 ((uint32_t)0x0000FF00) /* Data byte 5 */ +#define CAN_TXMDH1R_DATA6 ((uint32_t)0x00FF0000) /* Data byte 6 */ +#define CAN_TXMDH1R_DATA7 ((uint32_t)0xFF000000) /* Data byte 7 */ + +/******************* Bit definition for CAN_TXMI2R register *******************/ +#define CAN_TXMI2R_TXRQ ((uint32_t)0x00000001) /* Transmit Mailbox Request */ +#define CAN_TXMI2R_RTR ((uint32_t)0x00000002) /* Remote Transmission Request */ +#define CAN_TXMI2R_IDE ((uint32_t)0x00000004) /* Identifier Extension */ +#define CAN_TXMI2R_EXID ((uint32_t)0x001FFFF8) /* Extended identifier */ +#define CAN_TXMI2R_STID ((uint32_t)0xFFE00000) /* Standard Identifier or Extended Identifier */ + +/******************* Bit definition for CAN_TXMDT2R register ******************/ +#define CAN_TXMDT2R_DLC ((uint32_t)0x0000000F) /* Data Length Code */ +#define CAN_TXMDT2R_TGT ((uint32_t)0x00000100) /* Transmit Global Time */ +#define CAN_TXMDT2R_TIME ((uint32_t)0xFFFF0000) /* Message Time Stamp */ + +/******************* Bit definition for CAN_TXMDL2R register ******************/ +#define CAN_TXMDL2R_DATA0 ((uint32_t)0x000000FF) /* Data byte 0 */ +#define CAN_TXMDL2R_DATA1 ((uint32_t)0x0000FF00) /* Data byte 1 */ +#define CAN_TXMDL2R_DATA2 ((uint32_t)0x00FF0000) /* Data byte 2 */ +#define CAN_TXMDL2R_DATA3 ((uint32_t)0xFF000000) /* Data byte 3 */ + +/******************* Bit definition for CAN_TXMDH2R register ******************/ +#define CAN_TXMDH2R_DATA4 ((uint32_t)0x000000FF) /* Data byte 4 */ +#define CAN_TXMDH2R_DATA5 ((uint32_t)0x0000FF00) /* Data byte 5 */ +#define CAN_TXMDH2R_DATA6 ((uint32_t)0x00FF0000) /* Data byte 6 */ +#define CAN_TXMDH2R_DATA7 ((uint32_t)0xFF000000) /* Data byte 7 */ + +/******************* Bit definition for CAN_RXMI0R register *******************/ +#define CAN_RXMI0R_RTR ((uint32_t)0x00000002) /* Remote Transmission Request */ +#define CAN_RXMI0R_IDE ((uint32_t)0x00000004) /* Identifier Extension */ +#define CAN_RXMI0R_EXID ((uint32_t)0x001FFFF8) /* Extended Identifier */ +#define CAN_RXMI0R_STID ((uint32_t)0xFFE00000) /* Standard Identifier or Extended Identifier */ + +/******************* Bit definition for CAN_RXMDT0R register ******************/ +#define CAN_RXMDT0R_DLC ((uint32_t)0x0000000F) /* Data Length Code */ +#define CAN_RXMDT0R_FMI ((uint32_t)0x0000FF00) /* Filter Match Index */ +#define CAN_RXMDT0R_TIME ((uint32_t)0xFFFF0000) /* Message Time Stamp */ + +/******************* Bit definition for CAN_RXMDL0R register ******************/ +#define CAN_RXMDL0R_DATA0 ((uint32_t)0x000000FF) /* Data byte 0 */ +#define CAN_RXMDL0R_DATA1 ((uint32_t)0x0000FF00) /* Data byte 1 */ +#define CAN_RXMDL0R_DATA2 ((uint32_t)0x00FF0000) /* Data byte 2 */ +#define CAN_RXMDL0R_DATA3 ((uint32_t)0xFF000000) /* Data byte 3 */ + +/******************* Bit definition for CAN_RXMDH0R register ******************/ +#define CAN_RXMDH0R_DATA4 ((uint32_t)0x000000FF) /* Data byte 4 */ +#define CAN_RXMDH0R_DATA5 ((uint32_t)0x0000FF00) /* Data byte 5 */ +#define CAN_RXMDH0R_DATA6 ((uint32_t)0x00FF0000) /* Data byte 6 */ +#define CAN_RXMDH0R_DATA7 ((uint32_t)0xFF000000) /* Data byte 7 */ + +/******************* Bit definition for CAN_RXMI1R register *******************/ +#define CAN_RXMI1R_RTR ((uint32_t)0x00000002) /* Remote Transmission Request */ +#define CAN_RXMI1R_IDE ((uint32_t)0x00000004) /* Identifier Extension */ +#define CAN_RXMI1R_EXID ((uint32_t)0x001FFFF8) /* Extended identifier */ +#define CAN_RXMI1R_STID ((uint32_t)0xFFE00000) /* Standard Identifier or Extended Identifier */ + +/******************* Bit definition for CAN_RXMDT1R register ******************/ +#define CAN_RXMDT1R_DLC ((uint32_t)0x0000000F) /* Data Length Code */ +#define CAN_RXMDT1R_FMI ((uint32_t)0x0000FF00) /* Filter Match Index */ +#define CAN_RXMDT1R_TIME ((uint32_t)0xFFFF0000) /* Message Time Stamp */ + +/******************* Bit definition for CAN_RXMDL1R register ******************/ +#define CAN_RXMDL1R_DATA0 ((uint32_t)0x000000FF) /* Data byte 0 */ +#define CAN_RXMDL1R_DATA1 ((uint32_t)0x0000FF00) /* Data byte 1 */ +#define CAN_RXMDL1R_DATA2 ((uint32_t)0x00FF0000) /* Data byte 2 */ +#define CAN_RXMDL1R_DATA3 ((uint32_t)0xFF000000) /* Data byte 3 */ + +/******************* Bit definition for CAN_RXMDH1R register ******************/ +#define CAN_RXMDH1R_DATA4 ((uint32_t)0x000000FF) /* Data byte 4 */ +#define CAN_RXMDH1R_DATA5 ((uint32_t)0x0000FF00) /* Data byte 5 */ +#define CAN_RXMDH1R_DATA6 ((uint32_t)0x00FF0000) /* Data byte 6 */ +#define CAN_RXMDH1R_DATA7 ((uint32_t)0xFF000000) /* Data byte 7 */ + +/******************* Bit definition for CAN_FCTLR register ********************/ +#define CAN_FCTLR_FINIT ((uint8_t)0x01) /* Filter Init Mode */ + +/******************* Bit definition for CAN_FMCFGR register *******************/ +#define CAN_FMCFGR_FBM ((uint16_t)0x3FFF) /* Filter Mode */ +#define CAN_FMCFGR_FBM0 ((uint16_t)0x0001) /* Filter Init Mode bit 0 */ +#define CAN_FMCFGR_FBM1 ((uint16_t)0x0002) /* Filter Init Mode bit 1 */ +#define CAN_FMCFGR_FBM2 ((uint16_t)0x0004) /* Filter Init Mode bit 2 */ +#define CAN_FMCFGR_FBM3 ((uint16_t)0x0008) /* Filter Init Mode bit 3 */ +#define CAN_FMCFGR_FBM4 ((uint16_t)0x0010) /* Filter Init Mode bit 4 */ +#define CAN_FMCFGR_FBM5 ((uint16_t)0x0020) /* Filter Init Mode bit 5 */ +#define CAN_FMCFGR_FBM6 ((uint16_t)0x0040) /* Filter Init Mode bit 6 */ +#define CAN_FMCFGR_FBM7 ((uint16_t)0x0080) /* Filter Init Mode bit 7 */ +#define CAN_FMCFGR_FBM8 ((uint16_t)0x0100) /* Filter Init Mode bit 8 */ +#define CAN_FMCFGR_FBM9 ((uint16_t)0x0200) /* Filter Init Mode bit 9 */ +#define CAN_FMCFGR_FBM10 ((uint16_t)0x0400) /* Filter Init Mode bit 10 */ +#define CAN_FMCFGR_FBM11 ((uint16_t)0x0800) /* Filter Init Mode bit 11 */ +#define CAN_FMCFGR_FBM12 ((uint16_t)0x1000) /* Filter Init Mode bit 12 */ +#define CAN_FMCFGR_FBM13 ((uint16_t)0x2000) /* Filter Init Mode bit 13 */ + +/******************* Bit definition for CAN_FSCFGR register *******************/ +#define CAN_FSCFGR_FSC ((uint16_t)0x3FFF) /* Filter Scale Configuration */ +#define CAN_FSCFGR_FSC0 ((uint16_t)0x0001) /* Filter Scale Configuration bit 0 */ +#define CAN_FSCFGR_FSC1 ((uint16_t)0x0002) /* Filter Scale Configuration bit 1 */ +#define CAN_FSCFGR_FSC2 ((uint16_t)0x0004) /* Filter Scale Configuration bit 2 */ +#define CAN_FSCFGR_FSC3 ((uint16_t)0x0008) /* Filter Scale Configuration bit 3 */ +#define CAN_FSCFGR_FSC4 ((uint16_t)0x0010) /* Filter Scale Configuration bit 4 */ +#define CAN_FSCFGR_FSC5 ((uint16_t)0x0020) /* Filter Scale Configuration bit 5 */ +#define CAN_FSCFGR_FSC6 ((uint16_t)0x0040) /* Filter Scale Configuration bit 6 */ +#define CAN_FSCFGR_FSC7 ((uint16_t)0x0080) /* Filter Scale Configuration bit 7 */ +#define CAN_FSCFGR_FSC8 ((uint16_t)0x0100) /* Filter Scale Configuration bit 8 */ +#define CAN_FSCFGR_FSC9 ((uint16_t)0x0200) /* Filter Scale Configuration bit 9 */ +#define CAN_FSCFGR_FSC10 ((uint16_t)0x0400) /* Filter Scale Configuration bit 10 */ +#define CAN_FSCFGR_FSC11 ((uint16_t)0x0800) /* Filter Scale Configuration bit 11 */ +#define CAN_FSCFGR_FSC12 ((uint16_t)0x1000) /* Filter Scale Configuration bit 12 */ +#define CAN_FSCFGR_FSC13 ((uint16_t)0x2000) /* Filter Scale Configuration bit 13 */ + +/****************** Bit definition for CAN_FAFIFOR register *******************/ +#define CAN_FAFIFOR_FFA ((uint16_t)0x3FFF) /* Filter FIFO Assignment */ +#define CAN_FAFIFOR_FFA0 ((uint16_t)0x0001) /* Filter FIFO Assignment for Filter 0 */ +#define CAN_FAFIFOR_FFA1 ((uint16_t)0x0002) /* Filter FIFO Assignment for Filter 1 */ +#define CAN_FAFIFOR_FFA2 ((uint16_t)0x0004) /* Filter FIFO Assignment for Filter 2 */ +#define CAN_FAFIFOR_FFA3 ((uint16_t)0x0008) /* Filter FIFO Assignment for Filter 3 */ +#define CAN_FAFIFOR_FFA4 ((uint16_t)0x0010) /* Filter FIFO Assignment for Filter 4 */ +#define CAN_FAFIFOR_FFA5 ((uint16_t)0x0020) /* Filter FIFO Assignment for Filter 5 */ +#define CAN_FAFIFOR_FFA6 ((uint16_t)0x0040) /* Filter FIFO Assignment for Filter 6 */ +#define CAN_FAFIFOR_FFA7 ((uint16_t)0x0080) /* Filter FIFO Assignment for Filter 7 */ +#define CAN_FAFIFOR_FFA8 ((uint16_t)0x0100) /* Filter FIFO Assignment for Filter 8 */ +#define CAN_FAFIFOR_FFA9 ((uint16_t)0x0200) /* Filter FIFO Assignment for Filter 9 */ +#define CAN_FAFIFOR_FFA10 ((uint16_t)0x0400) /* Filter FIFO Assignment for Filter 10 */ +#define CAN_FAFIFOR_FFA11 ((uint16_t)0x0800) /* Filter FIFO Assignment for Filter 11 */ +#define CAN_FAFIFOR_FFA12 ((uint16_t)0x1000) /* Filter FIFO Assignment for Filter 12 */ +#define CAN_FAFIFOR_FFA13 ((uint16_t)0x2000) /* Filter FIFO Assignment for Filter 13 */ + +/******************* Bit definition for CAN_FWR register *******************/ +#define CAN_FWR_FACT ((uint16_t)0x3FFF) /* Filter Active */ +#define CAN_FWR_FACT0 ((uint16_t)0x0001) /* Filter 0 Active */ +#define CAN_FWR_FACT1 ((uint16_t)0x0002) /* Filter 1 Active */ +#define CAN_FWR_FACT2 ((uint16_t)0x0004) /* Filter 2 Active */ +#define CAN_FWR_FACT3 ((uint16_t)0x0008) /* Filter 3 Active */ +#define CAN_FWR_FACT4 ((uint16_t)0x0010) /* Filter 4 Active */ +#define CAN_FWR_FACT5 ((uint16_t)0x0020) /* Filter 5 Active */ +#define CAN_FWR_FACT6 ((uint16_t)0x0040) /* Filter 6 Active */ +#define CAN_FWR_FACT7 ((uint16_t)0x0080) /* Filter 7 Active */ +#define CAN_FWR_FACT8 ((uint16_t)0x0100) /* Filter 8 Active */ +#define CAN_FWR_FACT9 ((uint16_t)0x0200) /* Filter 9 Active */ +#define CAN_FWR_FACT10 ((uint16_t)0x0400) /* Filter 10 Active */ +#define CAN_FWR_FACT11 ((uint16_t)0x0800) /* Filter 11 Active */ +#define CAN_FWR_FACT12 ((uint16_t)0x1000) /* Filter 12 Active */ +#define CAN_FWR_FACT13 ((uint16_t)0x2000) /* Filter 13 Active */ + +/******************* Bit definition for CAN_F0R1 register *******************/ +#define CAN_F0R1_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F0R1_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F0R1_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F0R1_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F0R1_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F0R1_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F0R1_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F0R1_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F0R1_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F0R1_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F0R1_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F0R1_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F0R1_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F0R1_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F0R1_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F0R1_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F0R1_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F0R1_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F0R1_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F0R1_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F0R1_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F0R1_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F0R1_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F0R1_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F0R1_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F0R1_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F0R1_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F0R1_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F0R1_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F0R1_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F0R1_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F0R1_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F1R1 register *******************/ +#define CAN_F1R1_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F1R1_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F1R1_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F1R1_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F1R1_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F1R1_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F1R1_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F1R1_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F1R1_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F1R1_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F1R1_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F1R1_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F1R1_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F1R1_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F1R1_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F1R1_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F1R1_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F1R1_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F1R1_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F1R1_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F1R1_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F1R1_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F1R1_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F1R1_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F1R1_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F1R1_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F1R1_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F1R1_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F1R1_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F1R1_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F1R1_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F1R1_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F2R1 register *******************/ +#define CAN_F2R1_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F2R1_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F2R1_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F2R1_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F2R1_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F2R1_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F2R1_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F2R1_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F2R1_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F2R1_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F2R1_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F2R1_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F2R1_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F2R1_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F2R1_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F2R1_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F2R1_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F2R1_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F2R1_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F2R1_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F2R1_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F2R1_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F2R1_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F2R1_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F2R1_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F2R1_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F2R1_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F2R1_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F2R1_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F2R1_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F2R1_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F2R1_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F3R1 register *******************/ +#define CAN_F3R1_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F3R1_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F3R1_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F3R1_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F3R1_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F3R1_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F3R1_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F3R1_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F3R1_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F3R1_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F3R1_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F3R1_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F3R1_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F3R1_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F3R1_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F3R1_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F3R1_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F3R1_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F3R1_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F3R1_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F3R1_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F3R1_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F3R1_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F3R1_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F3R1_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F3R1_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F3R1_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F3R1_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F3R1_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F3R1_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F3R1_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F3R1_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F4R1 register *******************/ +#define CAN_F4R1_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F4R1_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F4R1_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F4R1_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F4R1_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F4R1_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F4R1_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F4R1_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F4R1_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F4R1_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F4R1_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F4R1_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F4R1_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F4R1_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F4R1_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F4R1_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F4R1_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F4R1_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F4R1_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F4R1_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F4R1_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F4R1_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F4R1_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F4R1_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F4R1_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F4R1_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F4R1_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F4R1_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F4R1_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F4R1_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F4R1_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F4R1_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F5R1 register *******************/ +#define CAN_F5R1_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F5R1_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F5R1_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F5R1_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F5R1_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F5R1_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F5R1_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F5R1_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F5R1_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F5R1_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F5R1_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F5R1_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F5R1_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F5R1_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F5R1_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F5R1_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F5R1_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F5R1_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F5R1_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F5R1_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F5R1_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F5R1_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F5R1_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F5R1_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F5R1_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F5R1_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F5R1_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F5R1_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F5R1_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F5R1_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F5R1_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F5R1_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F6R1 register *******************/ +#define CAN_F6R1_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F6R1_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F6R1_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F6R1_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F6R1_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F6R1_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F6R1_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F6R1_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F6R1_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F6R1_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F6R1_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F6R1_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F6R1_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F6R1_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F6R1_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F6R1_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F6R1_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F6R1_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F6R1_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F6R1_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F6R1_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F6R1_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F6R1_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F6R1_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F6R1_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F6R1_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F6R1_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F6R1_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F6R1_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F6R1_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F6R1_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F6R1_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F7R1 register *******************/ +#define CAN_F7R1_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F7R1_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F7R1_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F7R1_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F7R1_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F7R1_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F7R1_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F7R1_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F7R1_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F7R1_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F7R1_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F7R1_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F7R1_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F7R1_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F7R1_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F7R1_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F7R1_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F7R1_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F7R1_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F7R1_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F7R1_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F7R1_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F7R1_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F7R1_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F7R1_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F7R1_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F7R1_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F7R1_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F7R1_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F7R1_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F7R1_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F7R1_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F8R1 register *******************/ +#define CAN_F8R1_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F8R1_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F8R1_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F8R1_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F8R1_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F8R1_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F8R1_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F8R1_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F8R1_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F8R1_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F8R1_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F8R1_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F8R1_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F8R1_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F8R1_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F8R1_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F8R1_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F8R1_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F8R1_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F8R1_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F8R1_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F8R1_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F8R1_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F8R1_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F8R1_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F8R1_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F8R1_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F8R1_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F8R1_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F8R1_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F8R1_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F8R1_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F9R1 register *******************/ +#define CAN_F9R1_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F9R1_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F9R1_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F9R1_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F9R1_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F9R1_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F9R1_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F9R1_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F9R1_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F9R1_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F9R1_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F9R1_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F9R1_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F9R1_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F9R1_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F9R1_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F9R1_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F9R1_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F9R1_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F9R1_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F9R1_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F9R1_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F9R1_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F9R1_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F9R1_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F9R1_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F9R1_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F9R1_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F9R1_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F9R1_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F9R1_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F9R1_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F10R1 register ******************/ +#define CAN_F10R1_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F10R1_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F10R1_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F10R1_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F10R1_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F10R1_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F10R1_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F10R1_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F10R1_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F10R1_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F10R1_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F10R1_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F10R1_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F10R1_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F10R1_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F10R1_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F10R1_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F10R1_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F10R1_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F10R1_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F10R1_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F10R1_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F10R1_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F10R1_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F10R1_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F10R1_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F10R1_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F10R1_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F10R1_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F10R1_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F10R1_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F10R1_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F11R1 register ******************/ +#define CAN_F11R1_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F11R1_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F11R1_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F11R1_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F11R1_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F11R1_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F11R1_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F11R1_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F11R1_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F11R1_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F11R1_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F11R1_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F11R1_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F11R1_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F11R1_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F11R1_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F11R1_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F11R1_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F11R1_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F11R1_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F11R1_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F11R1_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F11R1_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F11R1_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F11R1_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F11R1_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F11R1_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F11R1_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F11R1_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F11R1_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F11R1_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F11R1_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F12R1 register ******************/ +#define CAN_F12R1_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F12R1_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F12R1_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F12R1_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F12R1_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F12R1_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F12R1_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F12R1_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F12R1_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F12R1_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F12R1_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F12R1_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F12R1_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F12R1_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F12R1_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F12R1_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F12R1_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F12R1_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F12R1_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F12R1_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F12R1_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F12R1_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F12R1_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F12R1_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F12R1_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F12R1_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F12R1_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F12R1_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F12R1_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F12R1_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F12R1_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F12R1_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F13R1 register ******************/ +#define CAN_F13R1_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F13R1_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F13R1_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F13R1_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F13R1_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F13R1_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F13R1_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F13R1_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F13R1_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F13R1_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F13R1_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F13R1_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F13R1_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F13R1_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F13R1_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F13R1_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F13R1_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F13R1_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F13R1_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F13R1_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F13R1_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F13R1_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F13R1_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F13R1_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F13R1_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F13R1_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F13R1_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F13R1_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F13R1_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F13R1_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F13R1_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F13R1_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F0R2 register *******************/ +#define CAN_F0R2_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F0R2_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F0R2_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F0R2_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F0R2_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F0R2_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F0R2_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F0R2_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F0R2_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F0R2_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F0R2_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F0R2_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F0R2_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F0R2_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F0R2_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F0R2_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F0R2_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F0R2_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F0R2_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F0R2_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F0R2_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F0R2_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F0R2_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F0R2_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F0R2_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F0R2_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F0R2_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F0R2_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F0R2_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F0R2_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F0R2_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F0R2_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F1R2 register *******************/ +#define CAN_F1R2_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F1R2_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F1R2_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F1R2_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F1R2_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F1R2_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F1R2_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F1R2_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F1R2_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F1R2_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F1R2_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F1R2_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F1R2_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F1R2_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F1R2_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F1R2_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F1R2_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F1R2_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F1R2_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F1R2_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F1R2_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F1R2_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F1R2_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F1R2_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F1R2_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F1R2_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F1R2_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F1R2_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F1R2_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F1R2_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F1R2_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F1R2_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F2R2 register *******************/ +#define CAN_F2R2_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F2R2_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F2R2_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F2R2_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F2R2_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F2R2_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F2R2_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F2R2_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F2R2_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F2R2_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F2R2_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F2R2_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F2R2_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F2R2_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F2R2_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F2R2_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F2R2_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F2R2_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F2R2_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F2R2_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F2R2_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F2R2_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F2R2_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F2R2_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F2R2_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F2R2_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F2R2_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F2R2_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F2R2_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F2R2_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F2R2_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F2R2_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F3R2 register *******************/ +#define CAN_F3R2_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F3R2_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F3R2_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F3R2_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F3R2_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F3R2_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F3R2_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F3R2_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F3R2_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F3R2_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F3R2_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F3R2_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F3R2_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F3R2_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F3R2_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F3R2_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F3R2_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F3R2_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F3R2_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F3R2_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F3R2_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F3R2_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F3R2_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F3R2_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F3R2_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F3R2_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F3R2_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F3R2_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F3R2_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F3R2_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F3R2_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F3R2_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F4R2 register *******************/ +#define CAN_F4R2_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F4R2_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F4R2_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F4R2_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F4R2_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F4R2_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F4R2_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F4R2_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F4R2_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F4R2_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F4R2_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F4R2_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F4R2_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F4R2_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F4R2_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F4R2_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F4R2_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F4R2_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F4R2_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F4R2_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F4R2_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F4R2_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F4R2_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F4R2_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F4R2_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F4R2_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F4R2_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F4R2_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F4R2_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F4R2_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F4R2_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F4R2_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F5R2 register *******************/ +#define CAN_F5R2_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F5R2_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F5R2_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F5R2_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F5R2_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F5R2_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F5R2_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F5R2_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F5R2_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F5R2_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F5R2_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F5R2_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F5R2_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F5R2_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F5R2_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F5R2_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F5R2_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F5R2_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F5R2_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F5R2_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F5R2_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F5R2_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F5R2_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F5R2_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F5R2_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F5R2_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F5R2_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F5R2_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F5R2_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F5R2_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F5R2_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F5R2_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F6R2 register *******************/ +#define CAN_F6R2_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F6R2_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F6R2_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F6R2_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F6R2_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F6R2_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F6R2_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F6R2_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F6R2_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F6R2_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F6R2_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F6R2_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F6R2_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F6R2_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F6R2_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F6R2_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F6R2_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F6R2_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F6R2_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F6R2_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F6R2_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F6R2_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F6R2_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F6R2_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F6R2_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F6R2_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F6R2_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F6R2_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F6R2_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F6R2_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F6R2_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F6R2_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F7R2 register *******************/ +#define CAN_F7R2_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F7R2_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F7R2_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F7R2_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F7R2_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F7R2_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F7R2_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F7R2_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F7R2_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F7R2_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F7R2_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F7R2_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F7R2_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F7R2_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F7R2_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F7R2_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F7R2_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F7R2_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F7R2_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F7R2_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F7R2_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F7R2_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F7R2_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F7R2_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F7R2_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F7R2_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F7R2_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F7R2_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F7R2_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F7R2_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F7R2_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F7R2_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F8R2 register *******************/ +#define CAN_F8R2_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F8R2_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F8R2_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F8R2_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F8R2_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F8R2_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F8R2_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F8R2_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F8R2_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F8R2_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F8R2_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F8R2_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F8R2_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F8R2_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F8R2_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F8R2_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F8R2_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F8R2_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F8R2_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F8R2_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F8R2_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F8R2_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F8R2_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F8R2_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F8R2_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F8R2_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F8R2_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F8R2_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F8R2_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F8R2_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F8R2_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F8R2_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F9R2 register *******************/ +#define CAN_F9R2_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F9R2_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F9R2_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F9R2_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F9R2_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F9R2_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F9R2_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F9R2_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F9R2_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F9R2_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F9R2_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F9R2_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F9R2_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F9R2_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F9R2_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F9R2_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F9R2_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F9R2_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F9R2_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F9R2_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F9R2_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F9R2_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F9R2_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F9R2_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F9R2_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F9R2_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F9R2_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F9R2_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F9R2_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F9R2_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F9R2_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F9R2_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F10R2 register ******************/ +#define CAN_F10R2_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F10R2_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F10R2_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F10R2_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F10R2_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F10R2_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F10R2_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F10R2_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F10R2_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F10R2_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F10R2_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F10R2_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F10R2_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F10R2_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F10R2_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F10R2_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F10R2_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F10R2_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F10R2_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F10R2_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F10R2_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F10R2_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F10R2_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F10R2_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F10R2_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F10R2_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F10R2_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F10R2_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F10R2_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F10R2_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F10R2_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F10R2_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F11R2 register ******************/ +#define CAN_F11R2_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F11R2_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F11R2_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F11R2_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F11R2_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F11R2_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F11R2_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F11R2_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F11R2_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F11R2_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F11R2_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F11R2_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F11R2_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F11R2_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F11R2_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F11R2_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F11R2_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F11R2_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F11R2_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F11R2_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F11R2_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F11R2_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F11R2_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F11R2_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F11R2_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F11R2_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F11R2_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F11R2_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F11R2_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F11R2_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F11R2_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F11R2_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F12R2 register ******************/ +#define CAN_F12R2_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F12R2_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F12R2_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F12R2_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F12R2_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F12R2_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F12R2_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F12R2_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F12R2_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F12R2_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F12R2_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F12R2_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F12R2_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F12R2_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F12R2_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F12R2_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F12R2_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F12R2_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F12R2_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F12R2_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F12R2_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F12R2_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F12R2_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F12R2_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F12R2_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F12R2_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F12R2_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F12R2_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F12R2_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F12R2_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F12R2_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F12R2_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************* Bit definition for CAN_F13R2 register ******************/ +#define CAN_F13R2_FB0 ((uint32_t)0x00000001) /* Filter bit 0 */ +#define CAN_F13R2_FB1 ((uint32_t)0x00000002) /* Filter bit 1 */ +#define CAN_F13R2_FB2 ((uint32_t)0x00000004) /* Filter bit 2 */ +#define CAN_F13R2_FB3 ((uint32_t)0x00000008) /* Filter bit 3 */ +#define CAN_F13R2_FB4 ((uint32_t)0x00000010) /* Filter bit 4 */ +#define CAN_F13R2_FB5 ((uint32_t)0x00000020) /* Filter bit 5 */ +#define CAN_F13R2_FB6 ((uint32_t)0x00000040) /* Filter bit 6 */ +#define CAN_F13R2_FB7 ((uint32_t)0x00000080) /* Filter bit 7 */ +#define CAN_F13R2_FB8 ((uint32_t)0x00000100) /* Filter bit 8 */ +#define CAN_F13R2_FB9 ((uint32_t)0x00000200) /* Filter bit 9 */ +#define CAN_F13R2_FB10 ((uint32_t)0x00000400) /* Filter bit 10 */ +#define CAN_F13R2_FB11 ((uint32_t)0x00000800) /* Filter bit 11 */ +#define CAN_F13R2_FB12 ((uint32_t)0x00001000) /* Filter bit 12 */ +#define CAN_F13R2_FB13 ((uint32_t)0x00002000) /* Filter bit 13 */ +#define CAN_F13R2_FB14 ((uint32_t)0x00004000) /* Filter bit 14 */ +#define CAN_F13R2_FB15 ((uint32_t)0x00008000) /* Filter bit 15 */ +#define CAN_F13R2_FB16 ((uint32_t)0x00010000) /* Filter bit 16 */ +#define CAN_F13R2_FB17 ((uint32_t)0x00020000) /* Filter bit 17 */ +#define CAN_F13R2_FB18 ((uint32_t)0x00040000) /* Filter bit 18 */ +#define CAN_F13R2_FB19 ((uint32_t)0x00080000) /* Filter bit 19 */ +#define CAN_F13R2_FB20 ((uint32_t)0x00100000) /* Filter bit 20 */ +#define CAN_F13R2_FB21 ((uint32_t)0x00200000) /* Filter bit 21 */ +#define CAN_F13R2_FB22 ((uint32_t)0x00400000) /* Filter bit 22 */ +#define CAN_F13R2_FB23 ((uint32_t)0x00800000) /* Filter bit 23 */ +#define CAN_F13R2_FB24 ((uint32_t)0x01000000) /* Filter bit 24 */ +#define CAN_F13R2_FB25 ((uint32_t)0x02000000) /* Filter bit 25 */ +#define CAN_F13R2_FB26 ((uint32_t)0x04000000) /* Filter bit 26 */ +#define CAN_F13R2_FB27 ((uint32_t)0x08000000) /* Filter bit 27 */ +#define CAN_F13R2_FB28 ((uint32_t)0x10000000) /* Filter bit 28 */ +#define CAN_F13R2_FB29 ((uint32_t)0x20000000) /* Filter bit 29 */ +#define CAN_F13R2_FB30 ((uint32_t)0x40000000) /* Filter bit 30 */ +#define CAN_F13R2_FB31 ((uint32_t)0x80000000) /* Filter bit 31 */ + +/******************************************************************************/ +/* CRC Calculation Unit */ +/******************************************************************************/ + +/******************* Bit definition for CRC_DATAR register *********************/ +#define CRC_DATAR_DR ((uint32_t)0xFFFFFFFF) /* Data register bits */ + +/******************* Bit definition for CRC_IDATAR register ********************/ +#define CRC_IDR_IDATAR ((uint8_t)0xFF) /* General-purpose 8-bit data register bits */ + +/******************** Bit definition for CRC_CTLR register ********************/ +#define CRC_CTLR_RESET ((uint8_t)0x01) /* RESET bit */ +#endif + +#if defined(CH32V30x) +/******************************************************************************/ +/* Digital to Analog Converter */ +/******************************************************************************/ + +/******************** Bit definition for DAC_CTLR register ********************/ +#define DAC_EN1 ((uint32_t)0x00000001) /* DAC channel1 enable */ +#define DAC_BOFF1 ((uint32_t)0x00000002) /* DAC channel1 output buffer disable */ +#define DAC_TEN1 ((uint32_t)0x00000004) /* DAC channel1 Trigger enable */ + +#define DAC_TSEL1 ((uint32_t)0x00000038) /* TSEL1[2:0] (DAC channel1 Trigger selection) */ +#define DAC_TSEL1_0 ((uint32_t)0x00000008) /* Bit 0 */ +#define DAC_TSEL1_1 ((uint32_t)0x00000010) /* Bit 1 */ +#define DAC_TSEL1_2 ((uint32_t)0x00000020) /* Bit 2 */ + +#define DAC_WAVE1 ((uint32_t)0x000000C0) /* WAVE1[1:0] (DAC channel1 noise/triangle wave generation enable) */ +#define DAC_WAVE1_0 ((uint32_t)0x00000040) /* Bit 0 */ +#define DAC_WAVE1_1 ((uint32_t)0x00000080) /* Bit 1 */ + +#define DAC_MAMP1 ((uint32_t)0x00000F00) /* MAMP1[3:0] (DAC channel1 Mask/Amplitude selector) */ +#define DAC_MAMP1_0 ((uint32_t)0x00000100) /* Bit 0 */ +#define DAC_MAMP1_1 ((uint32_t)0x00000200) /* Bit 1 */ +#define DAC_MAMP1_2 ((uint32_t)0x00000400) /* Bit 2 */ +#define DAC_MAMP1_3 ((uint32_t)0x00000800) /* Bit 3 */ + +#define DAC_DMAEN1 ((uint32_t)0x00001000) /* DAC channel1 DMA enable */ +#define DAC_EN2 ((uint32_t)0x00010000) /* DAC channel2 enable */ +#define DAC_BOFF2 ((uint32_t)0x00020000) /* DAC channel2 output buffer disable */ +#define DAC_TEN2 ((uint32_t)0x00040000) /* DAC channel2 Trigger enable */ + +#define DAC_TSEL2 ((uint32_t)0x00380000) /* TSEL2[2:0] (DAC channel2 Trigger selection) */ +#define DAC_TSEL2_0 ((uint32_t)0x00080000) /* Bit 0 */ +#define DAC_TSEL2_1 ((uint32_t)0x00100000) /* Bit 1 */ +#define DAC_TSEL2_2 ((uint32_t)0x00200000) /* Bit 2 */ + +#define DAC_WAVE2 ((uint32_t)0x00C00000) /* WAVE2[1:0] (DAC channel2 noise/triangle wave generation enable) */ +#define DAC_WAVE2_0 ((uint32_t)0x00400000) /* Bit 0 */ +#define DAC_WAVE2_1 ((uint32_t)0x00800000) /* Bit 1 */ + +#define DAC_MAMP2 ((uint32_t)0x0F000000) /* MAMP2[3:0] (DAC channel2 Mask/Amplitude selector) */ +#define DAC_MAMP2_0 ((uint32_t)0x01000000) /* Bit 0 */ +#define DAC_MAMP2_1 ((uint32_t)0x02000000) /* Bit 1 */ +#define DAC_MAMP2_2 ((uint32_t)0x04000000) /* Bit 2 */ +#define DAC_MAMP2_3 ((uint32_t)0x08000000) /* Bit 3 */ + +#define DAC_DMAEN2 ((uint32_t)0x10000000) /* DAC channel2 DMA enabled */ + +/***************** Bit definition for DAC_SWTR register ******************/ +#define DAC_SWTRIG1 ((uint8_t)0x01) /* DAC channel1 software trigger */ +#define DAC_SWTRIG2 ((uint8_t)0x02) /* DAC channel2 software trigger */ + +/***************** Bit definition for DAC_R12BDHR1 register ******************/ +#define DAC_DHR12R1 ((uint16_t)0x0FFF) /* DAC channel1 12-bit Right aligned data */ + +/***************** Bit definition for DAC_L12BDHR1 register ******************/ +#define DAC_DHR12L1 ((uint16_t)0xFFF0) /* DAC channel1 12-bit Left aligned data */ + +/****************** Bit definition for DAC_R8BDHR1 register ******************/ +#define DAC_DHR8R1 ((uint8_t)0xFF) /* DAC channel1 8-bit Right aligned data */ + +/***************** Bit definition for DAC_R12BDHR2 register ******************/ +#define DAC_DHR12R2 ((uint16_t)0x0FFF) /* DAC channel2 12-bit Right aligned data */ + +/***************** Bit definition for DAC_L12BDHR2 register ******************/ +#define DAC_DHR12L2 ((uint16_t)0xFFF0) /* DAC channel2 12-bit Left aligned data */ + +/****************** Bit definition for DAC_R8BDHR2 register ******************/ +#define DAC_DHR8R2 ((uint8_t)0xFF) /* DAC channel2 8-bit Right aligned data */ + +/***************** Bit definition for DAC_RD12BDHR register ******************/ +#define DAC_RD12BDHR_DACC1DHR ((uint32_t)0x00000FFF) /* DAC channel1 12-bit Right aligned data */ +#define DAC_RD12BDHR_DACC2DHR ((uint32_t)0x0FFF0000) /* DAC channel2 12-bit Right aligned data */ + +/***************** Bit definition for DAC_LD12BDHR register ******************/ +#define DAC_LD12BDHR_DACC1DHR ((uint32_t)0x0000FFF0) /* DAC channel1 12-bit Left aligned data */ +#define DAC_LD12BDHR_DACC2DHR ((uint32_t)0xFFF00000) /* DAC channel2 12-bit Left aligned data */ + +/****************** Bit definition for DAC_RD8BDHR register ******************/ +#define DAC_RD8BDHR_DACC1DHR ((uint16_t)0x00FF) /* DAC channel1 8-bit Right aligned data */ +#define DAC_RD8BDHR_DACC2DHR ((uint16_t)0xFF00) /* DAC channel2 8-bit Right aligned data */ + +/******************* Bit definition for DAC_DOR1 register *******************/ +#define DAC_DACC1DOR ((uint16_t)0x0FFF) /* DAC channel1 data output */ + +/******************* Bit definition for DAC_DOR2 register *******************/ +#define DAC_DACC2DOR ((uint16_t)0x0FFF) /* DAC channel2 data output */ +#endif + +/******************************************************************************/ +/* DMA Controller */ +/******************************************************************************/ + +/******************* Bit definition for DMA_INTFR register ********************/ +#define DMA_GIF1 ((uint32_t)0x00000001) /* Channel 1 Global interrupt flag */ +#define DMA_TCIF1 ((uint32_t)0x00000002) /* Channel 1 Transfer Complete flag */ +#define DMA_HTIF1 ((uint32_t)0x00000004) /* Channel 1 Half Transfer flag */ +#define DMA_TEIF1 ((uint32_t)0x00000008) /* Channel 1 Transfer Error flag */ +#define DMA_GIF2 ((uint32_t)0x00000010) /* Channel 2 Global interrupt flag */ +#define DMA_TCIF2 ((uint32_t)0x00000020) /* Channel 2 Transfer Complete flag */ +#define DMA_HTIF2 ((uint32_t)0x00000040) /* Channel 2 Half Transfer flag */ +#define DMA_TEIF2 ((uint32_t)0x00000080) /* Channel 2 Transfer Error flag */ +#define DMA_GIF3 ((uint32_t)0x00000100) /* Channel 3 Global interrupt flag */ +#define DMA_TCIF3 ((uint32_t)0x00000200) /* Channel 3 Transfer Complete flag */ +#define DMA_HTIF3 ((uint32_t)0x00000400) /* Channel 3 Half Transfer flag */ +#define DMA_TEIF3 ((uint32_t)0x00000800) /* Channel 3 Transfer Error flag */ +#define DMA_GIF4 ((uint32_t)0x00001000) /* Channel 4 Global interrupt flag */ +#define DMA_TCIF4 ((uint32_t)0x00002000) /* Channel 4 Transfer Complete flag */ +#define DMA_HTIF4 ((uint32_t)0x00004000) /* Channel 4 Half Transfer flag */ +#define DMA_TEIF4 ((uint32_t)0x00008000) /* Channel 4 Transfer Error flag */ +#define DMA_GIF5 ((uint32_t)0x00010000) /* Channel 5 Global interrupt flag */ +#define DMA_TCIF5 ((uint32_t)0x00020000) /* Channel 5 Transfer Complete flag */ +#define DMA_HTIF5 ((uint32_t)0x00040000) /* Channel 5 Half Transfer flag */ +#define DMA_TEIF5 ((uint32_t)0x00080000) /* Channel 5 Transfer Error flag */ +#define DMA_GIF6 ((uint32_t)0x00100000) /* Channel 6 Global interrupt flag */ +#define DMA_TCIF6 ((uint32_t)0x00200000) /* Channel 6 Transfer Complete flag */ +#define DMA_HTIF6 ((uint32_t)0x00400000) /* Channel 6 Half Transfer flag */ +#define DMA_TEIF6 ((uint32_t)0x00800000) /* Channel 6 Transfer Error flag */ +#define DMA_GIF7 ((uint32_t)0x01000000) /* Channel 7 Global interrupt flag */ +#define DMA_TCIF7 ((uint32_t)0x02000000) /* Channel 7 Transfer Complete flag */ +#define DMA_HTIF7 ((uint32_t)0x04000000) /* Channel 7 Half Transfer flag */ +#define DMA_TEIF7 ((uint32_t)0x08000000) /* Channel 7 Transfer Error flag */ + +#if defined(CH32V20x) || defined(CH32V30x) +#define DMA_GIF8 ((uint32_t)0x00000001) /* Channel 8 Global interrupt flag */ +#define DMA_TCIF8 ((uint32_t)0x00000002) /* Channel 8 Transfer Complete flag */ +#define DMA_HTIF8 ((uint32_t)0x00000004) /* Channel 8 Half Transfer flag */ +#define DMA_TEIF8 ((uint32_t)0x00000008) /* Channel 8 Transfer Error flag */ +#define DMA_GIF9 ((uint32_t)0x00000010) /* Channel 9 Global interrupt flag */ +#define DMA_TCIF9 ((uint32_t)0x00000020) /* Channel 9 Transfer Complete flag */ +#define DMA_HTIF9 ((uint32_t)0x00000040) /* Channel 9 Half Transfer flag */ +#define DMA_TEIF9 ((uint32_t)0x00000080) /* Channel 9 Transfer Error flag */ +#define DMA_GIF10 ((uint32_t)0x00000100) /* Channel 10 Global interrupt flag */ +#define DMA_TCIF10 ((uint32_t)0x00000200) /* Channel 10 Transfer Complete flag */ +#define DMA_HTIF10 ((uint32_t)0x00000400) /* Channel 10 Half Transfer flag */ +#define DMA_TEIF10 ((uint32_t)0x00000800) /* Channel 10 Transfer Error flag */ +#define DMA_GIF11 ((uint32_t)0x00001000) /* Channel 11 Global interrupt flag */ +#define DMA_TCIF11 ((uint32_t)0x00002000) /* Channel 11 Transfer Complete flag */ +#define DMA_HTIF11 ((uint32_t)0x00004000) /* Channel 11 Half Transfer flag */ +#define DMA_TEIF11 ((uint32_t)0x00008000) /* Channel 11 Transfer Error flag */ +#endif + +/******************* Bit definition for DMA_INTFCR register *******************/ +#define DMA_CGIF1 ((uint32_t)0x00000001) /* Channel 1 Global interrupt clear */ +#define DMA_CTCIF1 ((uint32_t)0x00000002) /* Channel 1 Transfer Complete clear */ +#define DMA_CHTIF1 ((uint32_t)0x00000004) /* Channel 1 Half Transfer clear */ +#define DMA_CTEIF1 ((uint32_t)0x00000008) /* Channel 1 Transfer Error clear */ +#define DMA_CGIF2 ((uint32_t)0x00000010) /* Channel 2 Global interrupt clear */ +#define DMA_CTCIF2 ((uint32_t)0x00000020) /* Channel 2 Transfer Complete clear */ +#define DMA_CHTIF2 ((uint32_t)0x00000040) /* Channel 2 Half Transfer clear */ +#define DMA_CTEIF2 ((uint32_t)0x00000080) /* Channel 2 Transfer Error clear */ +#define DMA_CGIF3 ((uint32_t)0x00000100) /* Channel 3 Global interrupt clear */ +#define DMA_CTCIF3 ((uint32_t)0x00000200) /* Channel 3 Transfer Complete clear */ +#define DMA_CHTIF3 ((uint32_t)0x00000400) /* Channel 3 Half Transfer clear */ +#define DMA_CTEIF3 ((uint32_t)0x00000800) /* Channel 3 Transfer Error clear */ +#define DMA_CGIF4 ((uint32_t)0x00001000) /* Channel 4 Global interrupt clear */ +#define DMA_CTCIF4 ((uint32_t)0x00002000) /* Channel 4 Transfer Complete clear */ +#define DMA_CHTIF4 ((uint32_t)0x00004000) /* Channel 4 Half Transfer clear */ +#define DMA_CTEIF4 ((uint32_t)0x00008000) /* Channel 4 Transfer Error clear */ +#define DMA_CGIF5 ((uint32_t)0x00010000) /* Channel 5 Global interrupt clear */ +#define DMA_CTCIF5 ((uint32_t)0x00020000) /* Channel 5 Transfer Complete clear */ +#define DMA_CHTIF5 ((uint32_t)0x00040000) /* Channel 5 Half Transfer clear */ +#define DMA_CTEIF5 ((uint32_t)0x00080000) /* Channel 5 Transfer Error clear */ +#define DMA_CGIF6 ((uint32_t)0x00100000) /* Channel 6 Global interrupt clear */ +#define DMA_CTCIF6 ((uint32_t)0x00200000) /* Channel 6 Transfer Complete clear */ +#define DMA_CHTIF6 ((uint32_t)0x00400000) /* Channel 6 Half Transfer clear */ +#define DMA_CTEIF6 ((uint32_t)0x00800000) /* Channel 6 Transfer Error clear */ +#define DMA_CGIF7 ((uint32_t)0x01000000) /* Channel 7 Global interrupt clear */ +#define DMA_CTCIF7 ((uint32_t)0x02000000) /* Channel 7 Transfer Complete clear */ +#define DMA_CHTIF7 ((uint32_t)0x04000000) /* Channel 7 Half Transfer clear */ +#define DMA_CTEIF7 ((uint32_t)0x08000000) /* Channel 7 Transfer Error clear */ + +/******************* Bit definition for DMA_CFGR1 register *******************/ +#define DMA_CFGR1_EN ((uint16_t)0x0001) /* Channel enable*/ +#define DMA_CFGR1_TCIE ((uint16_t)0x0002) /* Transfer complete interrupt enable */ +#define DMA_CFGR1_HTIE ((uint16_t)0x0004) /* Half Transfer interrupt enable */ +#define DMA_CFGR1_TEIE ((uint16_t)0x0008) /* Transfer error interrupt enable */ +#define DMA_CFGR1_DIR ((uint16_t)0x0010) /* Data transfer direction (Setting = Memory -> Peripheral) */ +#define DMA_CFGR1_CIRC ((uint16_t)0x0020) /* Circular mode */ +#define DMA_CFGR1_PINC ((uint16_t)0x0040) /* Peripheral increment mode */ +#define DMA_CFGR1_MINC ((uint16_t)0x0080) /* Memory increment mode */ + +#define DMA_CFGR1_PSIZE ((uint16_t)0x0300) /* PSIZE[1:0] bits (Peripheral size) */ +#define DMA_CFGR1_PSIZE_0 ((uint16_t)0x0100) /* Bit 0 */ +#define DMA_CFGR1_PSIZE_1 ((uint16_t)0x0200) /* Bit 1 */ + +#define DMA_CFGR1_MSIZE ((uint16_t)0x0C00) /* MSIZE[1:0] bits (Memory size) */ +#define DMA_CFGR1_MSIZE_0 ((uint16_t)0x0400) /* Bit 0 */ +#define DMA_CFGR1_MSIZE_1 ((uint16_t)0x0800) /* Bit 1 */ + +#define DMA_CFGR1_PL ((uint16_t)0x3000) /* PL[1:0] bits(Channel Priority level) */ +#define DMA_CFGR1_PL_0 ((uint16_t)0x1000) /* Bit 0 */ +#define DMA_CFGR1_PL_1 ((uint16_t)0x2000) /* Bit 1 */ + +#define DMA_CFGR1_MEM2MEM ((uint16_t)0x4000) /* Memory to memory mode */ + +/******************* Bit definition for DMA_CFGR2 register *******************/ +#define DMA_CFGR2_EN ((uint16_t)0x0001) /* Channel enable */ +#define DMA_CFGR2_TCIE ((uint16_t)0x0002) /* Transfer complete interrupt enable */ +#define DMA_CFGR2_HTIE ((uint16_t)0x0004) /* Half Transfer interrupt enable */ +#define DMA_CFGR2_TEIE ((uint16_t)0x0008) /* Transfer error interrupt enable */ +#define DMA_CFGR2_DIR ((uint16_t)0x0010) /* Data transfer direction */ +#define DMA_CFGR2_CIRC ((uint16_t)0x0020) /* Circular mode */ +#define DMA_CFGR2_PINC ((uint16_t)0x0040) /* Peripheral increment mode */ +#define DMA_CFGR2_MINC ((uint16_t)0x0080) /* Memory increment mode */ + +#define DMA_CFGR2_PSIZE ((uint16_t)0x0300) /* PSIZE[1:0] bits (Peripheral size) */ +#define DMA_CFGR2_PSIZE_0 ((uint16_t)0x0100) /* Bit 0 */ +#define DMA_CFGR2_PSIZE_1 ((uint16_t)0x0200) /* Bit 1 */ + +#define DMA_CFGR2_MSIZE ((uint16_t)0x0C00) /* MSIZE[1:0] bits (Memory size) */ +#define DMA_CFGR2_MSIZE_0 ((uint16_t)0x0400) /* Bit 0 */ +#define DMA_CFGR2_MSIZE_1 ((uint16_t)0x0800) /* Bit 1 */ + +#define DMA_CFGR2_PL ((uint16_t)0x3000) /* PL[1:0] bits (Channel Priority level) */ +#define DMA_CFGR2_PL_0 ((uint16_t)0x1000) /* Bit 0 */ +#define DMA_CFGR2_PL_1 ((uint16_t)0x2000) /* Bit 1 */ + +#define DMA_CFGR2_MEM2MEM ((uint16_t)0x4000) /* Memory to memory mode */ + +/******************* Bit definition for DMA_CFGR3 register *******************/ +#define DMA_CFGR3_EN ((uint16_t)0x0001) /* Channel enable */ +#define DMA_CFGR3_TCIE ((uint16_t)0x0002) /* Transfer complete interrupt enable */ +#define DMA_CFGR3_HTIE ((uint16_t)0x0004) /* Half Transfer interrupt enable */ +#define DMA_CFGR3_TEIE ((uint16_t)0x0008) /* Transfer error interrupt enable */ +#define DMA_CFGR3_DIR ((uint16_t)0x0010) /* Data transfer direction */ +#define DMA_CFGR3_CIRC ((uint16_t)0x0020) /* Circular mode */ +#define DMA_CFGR3_PINC ((uint16_t)0x0040) /* Peripheral increment mode */ +#define DMA_CFGR3_MINC ((uint16_t)0x0080) /* Memory increment mode */ + +#define DMA_CFGR3_PSIZE ((uint16_t)0x0300) /* PSIZE[1:0] bits (Peripheral size) */ +#define DMA_CFGR3_PSIZE_0 ((uint16_t)0x0100) /* Bit 0 */ +#define DMA_CFGR3_PSIZE_1 ((uint16_t)0x0200) /* Bit 1 */ + +#define DMA_CFGR3_MSIZE ((uint16_t)0x0C00) /* MSIZE[1:0] bits (Memory size) */ +#define DMA_CFGR3_MSIZE_0 ((uint16_t)0x0400) /* Bit 0 */ +#define DMA_CFGR3_MSIZE_1 ((uint16_t)0x0800) /* Bit 1 */ + +#define DMA_CFGR3_PL ((uint16_t)0x3000) /* PL[1:0] bits (Channel Priority level) */ +#define DMA_CFGR3_PL_0 ((uint16_t)0x1000) /* Bit 0 */ +#define DMA_CFGR3_PL_1 ((uint16_t)0x2000) /* Bit 1 */ + +#define DMA_CFGR3_MEM2MEM ((uint16_t)0x4000) /* Memory to memory mode */ + +/******************* Bit definition for DMA_CFGR4 register *******************/ +#define DMA_CFGR4_EN ((uint16_t)0x0001) /* Channel enable */ +#define DMA_CFGR4_TCIE ((uint16_t)0x0002) /* Transfer complete interrupt enable */ +#define DMA_CFGR4_HTIE ((uint16_t)0x0004) /* Half Transfer interrupt enable */ +#define DMA_CFGR4_TEIE ((uint16_t)0x0008) /* Transfer error interrupt enable */ +#define DMA_CFGR4_DIR ((uint16_t)0x0010) /* Data transfer direction */ +#define DMA_CFGR4_CIRC ((uint16_t)0x0020) /* Circular mode */ +#define DMA_CFGR4_PINC ((uint16_t)0x0040) /* Peripheral increment mode */ +#define DMA_CFGR4_MINC ((uint16_t)0x0080) /* Memory increment mode */ + +#define DMA_CFGR4_PSIZE ((uint16_t)0x0300) /* PSIZE[1:0] bits (Peripheral size) */ +#define DMA_CFGR4_PSIZE_0 ((uint16_t)0x0100) /* Bit 0 */ +#define DMA_CFGR4_PSIZE_1 ((uint16_t)0x0200) /* Bit 1 */ + +#define DMA_CFGR4_MSIZE ((uint16_t)0x0C00) /* MSIZE[1:0] bits (Memory size) */ +#define DMA_CFGR4_MSIZE_0 ((uint16_t)0x0400) /* Bit 0 */ +#define DMA_CFGR4_MSIZE_1 ((uint16_t)0x0800) /* Bit 1 */ + +#define DMA_CFGR4_PL ((uint16_t)0x3000) /* PL[1:0] bits (Channel Priority level) */ +#define DMA_CFGR4_PL_0 ((uint16_t)0x1000) /* Bit 0 */ +#define DMA_CFGR4_PL_1 ((uint16_t)0x2000) /* Bit 1 */ + +#define DMA_CFGR4_MEM2MEM ((uint16_t)0x4000) /* Memory to memory mode */ + +/****************** Bit definition for DMA_CFGR5 register *******************/ +#define DMA_CFGR5_EN ((uint16_t)0x0001) /* Channel enable */ +#define DMA_CFGR5_TCIE ((uint16_t)0x0002) /* Transfer complete interrupt enable */ +#define DMA_CFGR5_HTIE ((uint16_t)0x0004) /* Half Transfer interrupt enable */ +#define DMA_CFGR5_TEIE ((uint16_t)0x0008) /* Transfer error interrupt enable */ +#define DMA_CFGR5_DIR ((uint16_t)0x0010) /* Data transfer direction */ +#define DMA_CFGR5_CIRC ((uint16_t)0x0020) /* Circular mode */ +#define DMA_CFGR5_PINC ((uint16_t)0x0040) /* Peripheral increment mode */ +#define DMA_CFGR5_MINC ((uint16_t)0x0080) /* Memory increment mode */ + +#define DMA_CFGR5_PSIZE ((uint16_t)0x0300) /* PSIZE[1:0] bits (Peripheral size) */ +#define DMA_CFGR5_PSIZE_0 ((uint16_t)0x0100) /* Bit 0 */ +#define DMA_CFGR5_PSIZE_1 ((uint16_t)0x0200) /* Bit 1 */ + +#define DMA_CFGR5_MSIZE ((uint16_t)0x0C00) /* MSIZE[1:0] bits (Memory size) */ +#define DMA_CFGR5_MSIZE_0 ((uint16_t)0x0400) /* Bit 0 */ +#define DMA_CFGR5_MSIZE_1 ((uint16_t)0x0800) /* Bit 1 */ + +#define DMA_CFGR5_PL ((uint16_t)0x3000) /* PL[1:0] bits (Channel Priority level) */ +#define DMA_CFGR5_PL_0 ((uint16_t)0x1000) /* Bit 0 */ +#define DMA_CFGR5_PL_1 ((uint16_t)0x2000) /* Bit 1 */ + +#define DMA_CFGR5_MEM2MEM ((uint16_t)0x4000) /* Memory to memory mode enable */ + +/******************* Bit definition for DMA_CFGR6 register *******************/ +#define DMA_CFGR6_EN ((uint16_t)0x0001) /* Channel enable */ +#define DMA_CFGR6_TCIE ((uint16_t)0x0002) /* Transfer complete interrupt enable */ +#define DMA_CFGR6_HTIE ((uint16_t)0x0004) /* Half Transfer interrupt enable */ +#define DMA_CFGR6_TEIE ((uint16_t)0x0008) /* Transfer error interrupt enable */ +#define DMA_CFGR6_DIR ((uint16_t)0x0010) /* Data transfer direction */ +#define DMA_CFGR6_CIRC ((uint16_t)0x0020) /* Circular mode */ +#define DMA_CFGR6_PINC ((uint16_t)0x0040) /* Peripheral increment mode */ +#define DMA_CFGR6_MINC ((uint16_t)0x0080) /* Memory increment mode */ + +#define DMA_CFGR6_PSIZE ((uint16_t)0x0300) /* PSIZE[1:0] bits (Peripheral size) */ +#define DMA_CFGR6_PSIZE_0 ((uint16_t)0x0100) /* Bit 0 */ +#define DMA_CFGR6_PSIZE_1 ((uint16_t)0x0200) /* Bit 1 */ + +#define DMA_CFGR6_MSIZE ((uint16_t)0x0C00) /* MSIZE[1:0] bits (Memory size) */ +#define DMA_CFGR6_MSIZE_0 ((uint16_t)0x0400) /* Bit 0 */ +#define DMA_CFGR6_MSIZE_1 ((uint16_t)0x0800) /* Bit 1 */ + +#define DMA_CFGR6_PL ((uint16_t)0x3000) /* PL[1:0] bits (Channel Priority level) */ +#define DMA_CFGR6_PL_0 ((uint16_t)0x1000) /* Bit 0 */ +#define DMA_CFGR6_PL_1 ((uint16_t)0x2000) /* Bit 1 */ + +#define DMA_CFGR6_MEM2MEM ((uint16_t)0x4000) /* Memory to memory mode */ + +/******************* Bit definition for DMA_CFGR7 register *******************/ +#define DMA_CFGR7_EN ((uint16_t)0x0001) /* Channel enable */ +#define DMA_CFGR7_TCIE ((uint16_t)0x0002) /* Transfer complete interrupt enable */ +#define DMA_CFGR7_HTIE ((uint16_t)0x0004) /* Half Transfer interrupt enable */ +#define DMA_CFGR7_TEIE ((uint16_t)0x0008) /* Transfer error interrupt enable */ +#define DMA_CFGR7_DIR ((uint16_t)0x0010) /* Data transfer direction */ +#define DMA_CFGR7_CIRC ((uint16_t)0x0020) /* Circular mode */ +#define DMA_CFGR7_PINC ((uint16_t)0x0040) /* Peripheral increment mode */ +#define DMA_CFGR7_MINC ((uint16_t)0x0080) /* Memory increment mode */ + +#define DMA_CFGR7_PSIZE ((uint16_t)0x0300) /* PSIZE[1:0] bits (Peripheral size) */ +#define DMA_CFGR7_PSIZE_0 ((uint16_t)0x0100) /* Bit 0 */ +#define DMA_CFGR7_PSIZE_1 ((uint16_t)0x0200) /* Bit 1 */ + +#define DMA_CFGR7_MSIZE ((uint16_t)0x0C00) /* MSIZE[1:0] bits (Memory size) */ +#define DMA_CFGR7_MSIZE_0 ((uint16_t)0x0400) /* Bit 0 */ +#define DMA_CFGR7_MSIZE_1 ((uint16_t)0x0800) /* Bit 1 */ + +#define DMA_CFGR7_PL ((uint16_t)0x3000) /* PL[1:0] bits (Channel Priority level) */ +#define DMA_CFGR7_PL_0 ((uint16_t)0x1000) /* Bit 0 */ +#define DMA_CFGR7_PL_1 ((uint16_t)0x2000) /* Bit 1 */ + +#define DMA_CFGR7_MEM2MEM ((uint16_t)0x4000) /* Memory to memory mode enable */ + +/****************** Bit definition for DMA_CNTR1 register ******************/ +#define DMA_CNTR1_NDT ((uint16_t)0xFFFF) /* Number of data to Transfer */ + +/****************** Bit definition for DMA_CNTR2 register ******************/ +#define DMA_CNTR2_NDT ((uint16_t)0xFFFF) /* Number of data to Transfer */ + +/****************** Bit definition for DMA_CNTR3 register ******************/ +#define DMA_CNTR3_NDT ((uint16_t)0xFFFF) /* Number of data to Transfer */ + +/****************** Bit definition for DMA_CNTR4 register ******************/ +#define DMA_CNTR4_NDT ((uint16_t)0xFFFF) /* Number of data to Transfer */ + +/****************** Bit definition for DMA_CNTR5 register ******************/ +#define DMA_CNTR5_NDT ((uint16_t)0xFFFF) /* Number of data to Transfer */ + +/****************** Bit definition for DMA_CNTR6 register ******************/ +#define DMA_CNTR6_NDT ((uint16_t)0xFFFF) /* Number of data to Transfer */ + +/****************** Bit definition for DMA_CNTR7 register ******************/ +#define DMA_CNTR7_NDT ((uint16_t)0xFFFF) /* Number of data to Transfer */ + +/****************** Bit definition for DMA_PADDR1 register *******************/ +#define DMA_PADDR1_PA ((uint32_t)0xFFFFFFFF) /* Peripheral Address */ + +/****************** Bit definition for DMA_PADDR2 register *******************/ +#define DMA_PADDR2_PA ((uint32_t)0xFFFFFFFF) /* Peripheral Address */ + +/****************** Bit definition for DMA_PADDR3 register *******************/ +#define DMA_PADDR3_PA ((uint32_t)0xFFFFFFFF) /* Peripheral Address */ + +/****************** Bit definition for DMA_PADDR4 register *******************/ +#define DMA_PADDR4_PA ((uint32_t)0xFFFFFFFF) /* Peripheral Address */ + +/****************** Bit definition for DMA_PADDR5 register *******************/ +#define DMA_PADDR5_PA ((uint32_t)0xFFFFFFFF) /* Peripheral Address */ + +/****************** Bit definition for DMA_PADDR6 register *******************/ +#define DMA_PADDR6_PA ((uint32_t)0xFFFFFFFF) /* Peripheral Address */ + +/****************** Bit definition for DMA_PADDR7 register *******************/ +#define DMA_PADDR7_PA ((uint32_t)0xFFFFFFFF) /* Peripheral Address */ + +/****************** Bit definition for DMA_MADDR1 register *******************/ +#define DMA_MADDR1_MA ((uint32_t)0xFFFFFFFF) /* Memory Address */ + +/****************** Bit definition for DMA_MADDR2 register *******************/ +#define DMA_MADDR2_MA ((uint32_t)0xFFFFFFFF) /* Memory Address */ + +/****************** Bit definition for DMA_MADDR3 register *******************/ +#define DMA_MADDR3_MA ((uint32_t)0xFFFFFFFF) /* Memory Address */ + +/****************** Bit definition for DMA_MADDR4 register *******************/ +#define DMA_MADDR4_MA ((uint32_t)0xFFFFFFFF) /* Memory Address */ + +/****************** Bit definition for DMA_MADDR5 register *******************/ +#define DMA_MADDR5_MA ((uint32_t)0xFFFFFFFF) /* Memory Address */ + +/****************** Bit definition for DMA_MADDR6 register *******************/ +#define DMA_MADDR6_MA ((uint32_t)0xFFFFFFFF) /* Memory Address */ + +/****************** Bit definition for DMA_MADDR7 register *******************/ +#define DMA_MADDR7_MA ((uint32_t)0xFFFFFFFF) /* Memory Address */ + +/******************************************************************************/ +/* External Interrupt/Event Controller */ +/******************************************************************************/ + +/******************* Bit definition for EXTI_INTENR register *******************/ +#define EXTI_INTENR_MR0 ((uint32_t)0x00000001) /* Interrupt Mask on line 0 */ +#define EXTI_INTENR_MR1 ((uint32_t)0x00000002) /* Interrupt Mask on line 1 */ +#define EXTI_INTENR_MR2 ((uint32_t)0x00000004) /* Interrupt Mask on line 2 */ +#define EXTI_INTENR_MR3 ((uint32_t)0x00000008) /* Interrupt Mask on line 3 */ +#define EXTI_INTENR_MR4 ((uint32_t)0x00000010) /* Interrupt Mask on line 4 */ +#define EXTI_INTENR_MR5 ((uint32_t)0x00000020) /* Interrupt Mask on line 5 */ +#define EXTI_INTENR_MR6 ((uint32_t)0x00000040) /* Interrupt Mask on line 6 */ +#define EXTI_INTENR_MR7 ((uint32_t)0x00000080) /* Interrupt Mask on line 7 */ +#define EXTI_INTENR_MR8 ((uint32_t)0x00000100) /* Interrupt Mask on line 8 */ +#define EXTI_INTENR_MR9 ((uint32_t)0x00000200) /* Interrupt Mask on line 9 */ +#if defined(CH32V20x) || defined(CH32V30x) +#define EXTI_INTENR_MR10 ((uint32_t)0x00000400) /* Interrupt Mask on line 10 */ +#define EXTI_INTENR_MR11 ((uint32_t)0x00000800) /* Interrupt Mask on line 11 */ +#define EXTI_INTENR_MR12 ((uint32_t)0x00001000) /* Interrupt Mask on line 12 */ +#define EXTI_INTENR_MR13 ((uint32_t)0x00002000) /* Interrupt Mask on line 13 */ +#define EXTI_INTENR_MR14 ((uint32_t)0x00004000) /* Interrupt Mask on line 14 */ +#define EXTI_INTENR_MR15 ((uint32_t)0x00008000) /* Interrupt Mask on line 15 */ +#define EXTI_INTENR_MR16 ((uint32_t)0x00010000) /* Interrupt Mask on line 16 */ +#define EXTI_INTENR_MR17 ((uint32_t)0x00020000) /* Interrupt Mask on line 17 */ +#define EXTI_INTENR_MR18 ((uint32_t)0x00040000) /* Interrupt Mask on line 18 */ +#define EXTI_INTENR_MR19 ((uint32_t)0x00080000) /* Interrupt Mask on line 19 */ +#endif + +/******************* Bit definition for EXTI_EVENR register *******************/ +#define EXTI_EVENR_MR0 ((uint32_t)0x00000001) /* Event Mask on line 0 */ +#define EXTI_EVENR_MR1 ((uint32_t)0x00000002) /* Event Mask on line 1 */ +#define EXTI_EVENR_MR2 ((uint32_t)0x00000004) /* Event Mask on line 2 */ +#define EXTI_EVENR_MR3 ((uint32_t)0x00000008) /* Event Mask on line 3 */ +#define EXTI_EVENR_MR4 ((uint32_t)0x00000010) /* Event Mask on line 4 */ +#define EXTI_EVENR_MR5 ((uint32_t)0x00000020) /* Event Mask on line 5 */ +#define EXTI_EVENR_MR6 ((uint32_t)0x00000040) /* Event Mask on line 6 */ +#define EXTI_EVENR_MR7 ((uint32_t)0x00000080) /* Event Mask on line 7 */ +#define EXTI_EVENR_MR8 ((uint32_t)0x00000100) /* Event Mask on line 8 */ +#define EXTI_EVENR_MR9 ((uint32_t)0x00000200) /* Event Mask on line 9 */ +#if defined(CH32V20x) || defined(CH32V30x) +#define EXTI_EVENR_MR10 ((uint32_t)0x00000400) /* Event Mask on line 10 */ +#define EXTI_EVENR_MR11 ((uint32_t)0x00000800) /* Event Mask on line 11 */ +#define EXTI_EVENR_MR12 ((uint32_t)0x00001000) /* Event Mask on line 12 */ +#define EXTI_EVENR_MR13 ((uint32_t)0x00002000) /* Event Mask on line 13 */ +#define EXTI_EVENR_MR14 ((uint32_t)0x00004000) /* Event Mask on line 14 */ +#define EXTI_EVENR_MR15 ((uint32_t)0x00008000) /* Event Mask on line 15 */ +#define EXTI_EVENR_MR16 ((uint32_t)0x00010000) /* Event Mask on line 16 */ +#define EXTI_EVENR_MR17 ((uint32_t)0x00020000) /* Event Mask on line 17 */ +#define EXTI_EVENR_MR18 ((uint32_t)0x00040000) /* Event Mask on line 18 */ +#define EXTI_EVENR_MR19 ((uint32_t)0x00080000) /* Event Mask on line 19 */ +#endif + +/****************** Bit definition for EXTI_RTENR register *******************/ +#define EXTI_RTENR_TR0 ((uint32_t)0x00000001) /* Rising trigger event configuration bit of line 0 */ +#define EXTI_RTENR_TR1 ((uint32_t)0x00000002) /* Rising trigger event configuration bit of line 1 */ +#define EXTI_RTENR_TR2 ((uint32_t)0x00000004) /* Rising trigger event configuration bit of line 2 */ +#define EXTI_RTENR_TR3 ((uint32_t)0x00000008) /* Rising trigger event configuration bit of line 3 */ +#define EXTI_RTENR_TR4 ((uint32_t)0x00000010) /* Rising trigger event configuration bit of line 4 */ +#define EXTI_RTENR_TR5 ((uint32_t)0x00000020) /* Rising trigger event configuration bit of line 5 */ +#define EXTI_RTENR_TR6 ((uint32_t)0x00000040) /* Rising trigger event configuration bit of line 6 */ +#define EXTI_RTENR_TR7 ((uint32_t)0x00000080) /* Rising trigger event configuration bit of line 7 */ +#define EXTI_RTENR_TR8 ((uint32_t)0x00000100) /* Rising trigger event configuration bit of line 8 */ +#define EXTI_RTENR_TR9 ((uint32_t)0x00000200) /* Rising trigger event configuration bit of line 9 */ +#if defined(CH32V20x) || defined(CH32V30x) +#define EXTI_RTENR_TR10 ((uint32_t)0x00000400) /* Rising trigger event configuration bit of line 10 */ +#define EXTI_RTENR_TR11 ((uint32_t)0x00000800) /* Rising trigger event configuration bit of line 11 */ +#define EXTI_RTENR_TR12 ((uint32_t)0x00001000) /* Rising trigger event configuration bit of line 12 */ +#define EXTI_RTENR_TR13 ((uint32_t)0x00002000) /* Rising trigger event configuration bit of line 13 */ +#define EXTI_RTENR_TR14 ((uint32_t)0x00004000) /* Rising trigger event configuration bit of line 14 */ +#define EXTI_RTENR_TR15 ((uint32_t)0x00008000) /* Rising trigger event configuration bit of line 15 */ +#define EXTI_RTENR_TR16 ((uint32_t)0x00010000) /* Rising trigger event configuration bit of line 16 */ +#define EXTI_RTENR_TR17 ((uint32_t)0x00020000) /* Rising trigger event configuration bit of line 17 */ +#define EXTI_RTENR_TR18 ((uint32_t)0x00040000) /* Rising trigger event configuration bit of line 18 */ +#define EXTI_RTENR_TR19 ((uint32_t)0x00080000) /* Rising trigger event configuration bit of line 19 */ +#endif + +/****************** Bit definition for EXTI_FTENR register *******************/ +#define EXTI_FTENR_TR0 ((uint32_t)0x00000001) /* Falling trigger event configuration bit of line 0 */ +#define EXTI_FTENR_TR1 ((uint32_t)0x00000002) /* Falling trigger event configuration bit of line 1 */ +#define EXTI_FTENR_TR2 ((uint32_t)0x00000004) /* Falling trigger event configuration bit of line 2 */ +#define EXTI_FTENR_TR3 ((uint32_t)0x00000008) /* Falling trigger event configuration bit of line 3 */ +#define EXTI_FTENR_TR4 ((uint32_t)0x00000010) /* Falling trigger event configuration bit of line 4 */ +#define EXTI_FTENR_TR5 ((uint32_t)0x00000020) /* Falling trigger event configuration bit of line 5 */ +#define EXTI_FTENR_TR6 ((uint32_t)0x00000040) /* Falling trigger event configuration bit of line 6 */ +#define EXTI_FTENR_TR7 ((uint32_t)0x00000080) /* Falling trigger event configuration bit of line 7 */ +#define EXTI_FTENR_TR8 ((uint32_t)0x00000100) /* Falling trigger event configuration bit of line 8 */ +#define EXTI_FTENR_TR9 ((uint32_t)0x00000200) /* Falling trigger event configuration bit of line 9 */ +#if defined(CH32V20x) || defined(CH32V30x) +#define EXTI_FTENR_TR10 ((uint32_t)0x00000400) /* Falling trigger event configuration bit of line 10 */ +#define EXTI_FTENR_TR11 ((uint32_t)0x00000800) /* Falling trigger event configuration bit of line 11 */ +#define EXTI_FTENR_TR12 ((uint32_t)0x00001000) /* Falling trigger event configuration bit of line 12 */ +#define EXTI_FTENR_TR13 ((uint32_t)0x00002000) /* Falling trigger event configuration bit of line 13 */ +#define EXTI_FTENR_TR14 ((uint32_t)0x00004000) /* Falling trigger event configuration bit of line 14 */ +#define EXTI_FTENR_TR15 ((uint32_t)0x00008000) /* Falling trigger event configuration bit of line 15 */ +#define EXTI_FTENR_TR16 ((uint32_t)0x00010000) /* Falling trigger event configuration bit of line 16 */ +#define EXTI_FTENR_TR17 ((uint32_t)0x00020000) /* Falling trigger event configuration bit of line 17 */ +#define EXTI_FTENR_TR18 ((uint32_t)0x00040000) /* Falling trigger event configuration bit of line 18 */ +#define EXTI_FTENR_TR19 ((uint32_t)0x00080000) /* Falling trigger event configuration bit of line 19 */ +#endif + +/****************** Bit definition for EXTI_SWIEVR register ******************/ +#define EXTI_SWIEVR_SWIEVR0 ((uint32_t)0x00000001) /* Software Interrupt on line 0 */ +#define EXTI_SWIEVR_SWIEVR1 ((uint32_t)0x00000002) /* Software Interrupt on line 1 */ +#define EXTI_SWIEVR_SWIEVR2 ((uint32_t)0x00000004) /* Software Interrupt on line 2 */ +#define EXTI_SWIEVR_SWIEVR3 ((uint32_t)0x00000008) /* Software Interrupt on line 3 */ +#define EXTI_SWIEVR_SWIEVR4 ((uint32_t)0x00000010) /* Software Interrupt on line 4 */ +#define EXTI_SWIEVR_SWIEVR5 ((uint32_t)0x00000020) /* Software Interrupt on line 5 */ +#define EXTI_SWIEVR_SWIEVR6 ((uint32_t)0x00000040) /* Software Interrupt on line 6 */ +#define EXTI_SWIEVR_SWIEVR7 ((uint32_t)0x00000080) /* Software Interrupt on line 7 */ +#define EXTI_SWIEVR_SWIEVR8 ((uint32_t)0x00000100) /* Software Interrupt on line 8 */ +#define EXTI_SWIEVR_SWIEVR9 ((uint32_t)0x00000200) /* Software Interrupt on line 9 */ +#if defined(CH32V20x) || defined(CH32V30x) +#define EXTI_SWIEVR_SWIEVR10 ((uint32_t)0x00000400) /* Software Interrupt on line 10 */ +#define EXTI_SWIEVR_SWIEVR11 ((uint32_t)0x00000800) /* Software Interrupt on line 11 */ +#define EXTI_SWIEVR_SWIEVR12 ((uint32_t)0x00001000) /* Software Interrupt on line 12 */ +#define EXTI_SWIEVR_SWIEVR13 ((uint32_t)0x00002000) /* Software Interrupt on line 13 */ +#define EXTI_SWIEVR_SWIEVR14 ((uint32_t)0x00004000) /* Software Interrupt on line 14 */ +#define EXTI_SWIEVR_SWIEVR15 ((uint32_t)0x00008000) /* Software Interrupt on line 15 */ +#define EXTI_SWIEVR_SWIEVR16 ((uint32_t)0x00010000) /* Software Interrupt on line 16 */ +#define EXTI_SWIEVR_SWIEVR17 ((uint32_t)0x00020000) /* Software Interrupt on line 17 */ +#define EXTI_SWIEVR_SWIEVR18 ((uint32_t)0x00040000) /* Software Interrupt on line 18 */ +#define EXTI_SWIEVR_SWIEVR19 ((uint32_t)0x00080000) /* Software Interrupt on line 19 */ +#endif + +/******************* Bit definition for EXTI_INTFR register ********************/ +#define EXTI_INTF_INTF0 ((uint32_t)0x00000001) /* Pending bit for line 0 */ +#define EXTI_INTF_INTF1 ((uint32_t)0x00000002) /* Pending bit for line 1 */ +#define EXTI_INTF_INTF2 ((uint32_t)0x00000004) /* Pending bit for line 2 */ +#define EXTI_INTF_INTF3 ((uint32_t)0x00000008) /* Pending bit for line 3 */ +#define EXTI_INTF_INTF4 ((uint32_t)0x00000010) /* Pending bit for line 4 */ +#define EXTI_INTF_INTF5 ((uint32_t)0x00000020) /* Pending bit for line 5 */ +#define EXTI_INTF_INTF6 ((uint32_t)0x00000040) /* Pending bit for line 6 */ +#define EXTI_INTF_INTF7 ((uint32_t)0x00000080) /* Pending bit for line 7 */ +#define EXTI_INTF_INTF8 ((uint32_t)0x00000100) /* Pending bit for line 8 */ +#define EXTI_INTF_INTF9 ((uint32_t)0x00000200) /* Pending bit for line 9 */ +#if defined(CH32V20x) || defined(CH32V30x) +#define EXTI_INTF_INTF10 ((uint32_t)0x00000400) /* Pending bit for line 10 */ +#define EXTI_INTF_INTF11 ((uint32_t)0x00000800) /* Pending bit for line 11 */ +#define EXTI_INTF_INTF12 ((uint32_t)0x00001000) /* Pending bit for line 12 */ +#define EXTI_INTF_INTF13 ((uint32_t)0x00002000) /* Pending bit for line 13 */ +#define EXTI_INTF_INTF14 ((uint32_t)0x00004000) /* Pending bit for line 14 */ +#define EXTI_INTF_INTF15 ((uint32_t)0x00008000) /* Pending bit for line 15 */ +#define EXTI_INTF_INTF16 ((uint32_t)0x00010000) /* Pending bit for line 16 */ +#define EXTI_INTF_INTF17 ((uint32_t)0x00020000) /* Pending bit for line 17 */ +#define EXTI_INTF_INTF18 ((uint32_t)0x00040000) /* Pending bit for line 18 */ +#define EXTI_INTF_INTF19 ((uint32_t)0x00080000) /* Pending bit for line 19 */ +#endif + +/******************************************************************************/ +/* FLASH and Option Bytes Registers */ +/******************************************************************************/ + +#if defined(CH32V003) || defined(CH32V10x) || defined(CH32X03x) +/******************* Bit definition for FLASH_ACTLR register ******************/ +#define FLASH_ACTLR_LATENCY ((uint8_t)0x03) /* LATENCY[2:0] bits (Latency) */ +#define FLASH_ACTLR_LATENCY_0 ((uint8_t)0x00) /* Bit 0 */ +#define FLASH_ACTLR_LATENCY_1 ((uint8_t)0x01) /* Bit 0 */ +#define FLASH_ACTLR_LATENCY_2 ((uint8_t)0x02) /* Bit 1 */ +#endif + +#if defined(CH32V10x) +#define FLASH_ACTLR_HLFCYA ((uint8_t)0x08) /* Flash Half Cycle Access Enable */ +#define FLASH_ACTLR_PRFTBE ((uint8_t)0x10) /* Prefetch Buffer Enable */ +#define FLASH_ACTLR_PRFTBS ((uint8_t)0x20) /* Prefetch Buffer Status */ +#endif + +/****************** Bit definition for FLASH_KEYR register ******************/ +#define FLASH_KEYR_FKEYR ((uint32_t)0xFFFFFFFF) /* FPEC Key */ + +/***************** Bit definition for FLASH_OBKEYR register ****************/ +#define FLASH_OBKEYR_OBKEYR ((uint32_t)0xFFFFFFFF) /* Option Byte Key */ + +/****************** Bit definition for FLASH_STATR register *******************/ +#define FLASH_STATR_BSY ((uint8_t)0x01) /* Busy */ +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +#define FLASH_STATR_PGERR ((uint8_t)0x04) /* Programming Error */ +#endif +#define FLASH_STATR_WRPRTERR ((uint8_t)0x10) /* Write Protection Error */ +#define FLASH_STATR_EOP ((uint8_t)0x20) /* End of operation */ + +/******************* Bit definition for FLASH_CTLR register *******************/ +#define FLASH_CTLR_PG (0x0001) /* Programming */ +#define FLASH_CTLR_PER (0x0002) /* Page Erase 1KByte*/ +#define FLASH_CTLR_MER (0x0004) /* Mass Erase */ +#define FLASH_CTLR_OPTPG (0x0010) /* Option Byte Programming */ +#define FLASH_CTLR_OPTER (0x0020) /* Option Byte Erase */ +#define FLASH_CTLR_STRT (0x0040) /* Start */ +#define FLASH_CTLR_LOCK (0x0080) /* Lock */ +#define FLASH_CTLR_OPTWRE (0x0200) /* Option Bytes Write Enable */ +#define FLASH_CTLR_ERRIE (0x0400) /* Error Interrupt Enable */ +#define FLASH_CTLR_EOPIE (0x1000) /* End of operation interrupt enable */ +#if defined(CH32V20x) || defined(CH32V30x) +#define FLASH_CTLR_FAST_LOCK (0x00008000) /* Fast Lock */ +#endif +#define FLASH_CTLR_PAGE_PG (0x00010000) /* Page Programming 64Byte */ +#define FLASH_CTLR_PAGE_ER (0x00020000) /* Page Erase 64Byte */ +#ifdef CH32V003 +#define FLASH_CTLR_BUF_LOAD (0x00040000) /* Buffer Load */ +#define FLASH_CTLR_BUF_RST (0x00080000) /* Buffer Reset */ +#elif defined(CH32V20x) || defined(CH32V30x) +#define FLASH_CTLR_PAGE_BER32 (0x00040000) /* Block Erase 32K */ +#define FLASH_CTLR_PAGE_BER64 (0x00080000) /* Block Erase 64K */ +#define FLASH_CTLR_PG_STRT (0x00200000) /* Page Programming Start */ +#endif + +/******************* Bit definition for FLASH_ADDR register *******************/ +#define FLASH_ADDR_FAR ((uint32_t)0xFFFFFFFF) /* Flash Address */ + +/****************** Bit definition for FLASH_OBR register *******************/ +#define FLASH_OBR_OPTERR ((uint16_t)0x0001) /* Option Byte Error */ +#define FLASH_OBR_RDPRT ((uint16_t)0x0002) /* Read protection */ + +#define FLASH_OBR_USER ((uint16_t)0x03FC) /* User Option Bytes */ +#define FLASH_OBR_WDG_SW ((uint16_t)0x0004) /* WDG_SW */ +#define FLASH_OBR_nRST_STOP ((uint16_t)0x0008) /* nRST_STOP */ +#define FLASH_OBR_nRST_STDBY ((uint16_t)0x0010) /* nRST_STDBY */ +#define FLASH_OBR_RST_MODE ((uint16_t)0x0060) /* RST_MODE */ + +/****************** Bit definition for FLASH_WPR register ******************/ +#define FLASH_WPR_WRP ((uint32_t)0xFFFFFFFF) /* Write Protect */ + +/****************** Bit definition for FLASH_RDPR register *******************/ +#define FLASH_RDPR_RDPR ((uint32_t)0x000000FF) /* Read protection option byte */ +#define FLASH_RDPR_nRDPR ((uint32_t)0x0000FF00) /* Read protection complemented option byte */ + +/****************** Bit definition for FLASH_USER register ******************/ +#define FLASH_USER_USER ((uint32_t)0x00FF0000) /* User option byte */ +#define FLASH_USER_nUSER ((uint32_t)0xFF000000) /* User complemented option byte */ + +/****************** Bit definition for FLASH_Data0 register *****************/ +#define FLASH_Data0_Data0 ((uint32_t)0x000000FF) /* User data storage option byte */ +#define FLASH_Data0_nData0 ((uint32_t)0x0000FF00) /* User data storage complemented option byte */ + +/****************** Bit definition for FLASH_Data1 register *****************/ +#define FLASH_Data1_Data1 ((uint32_t)0x00FF0000) /* User data storage option byte */ +#define FLASH_Data1_nData1 ((uint32_t)0xFF000000) /* User data storage complemented option byte */ + +/****************** Bit definition for FLASH_WRPR0 register ******************/ +#define FLASH_WRPR0_WRPR0 ((uint32_t)0x000000FF) /* Flash memory write protection option bytes */ +#define FLASH_WRPR0_nWRPR0 ((uint32_t)0x0000FF00) /* Flash memory write protection complemented option bytes */ + +/****************** Bit definition for FLASH_WRPR1 register ******************/ +#define FLASH_WRPR1_WRPR1 ((uint32_t)0x00FF0000) /* Flash memory write protection option bytes */ +#define FLASH_WRPR1_nWRPR1 ((uint32_t)0xFF000000) /* Flash memory write protection complemented option bytes */ + +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +/****************** Bit definition for FLASH_WRPR2 register ******************/ +#define FLASH_WRPR2_WRPR2 ((uint32_t)0x000000FF) /* Flash memory write protection option bytes */ +#define FLASH_WRPR2_nWRPR2 ((uint32_t)0x0000FF00) /* Flash memory write protection complemented option bytes */ + +/****************** Bit definition for FLASH_WRPR3 register ******************/ +#define FLASH_WRPR3_WRPR3 ((uint32_t)0x00FF0000) /* Flash memory write protection option bytes */ +#define FLASH_WRPR3_nWRPR3 ((uint32_t)0xFF000000) /* Flash memory write protection complemented option bytes */ +#endif + +/******************************************************************************/ +/* General Purpose and Alternate Function I/O */ +/******************************************************************************/ + +/******************* Bit definition for GPIO_CFGLR register *******************/ +#define GPIO_CFGLR_MODE ((uint32_t)0x33333333) /* Port x mode bits */ + +#define GPIO_CFGLR_MODE0 ((uint32_t)0x00000003) /* MODE0[1:0] bits (Port x mode bits, pin 0) */ +#define GPIO_CFGLR_MODE0_0 ((uint32_t)0x00000001) /* Bit 0 */ +#define GPIO_CFGLR_MODE0_1 ((uint32_t)0x00000002) /* Bit 1 */ + +#define GPIO_CFGLR_MODE1 ((uint32_t)0x00000030) /* MODE1[1:0] bits (Port x mode bits, pin 1) */ +#define GPIO_CFGLR_MODE1_0 ((uint32_t)0x00000010) /* Bit 0 */ +#define GPIO_CFGLR_MODE1_1 ((uint32_t)0x00000020) /* Bit 1 */ + +#define GPIO_CFGLR_MODE2 ((uint32_t)0x00000300) /* MODE2[1:0] bits (Port x mode bits, pin 2) */ +#define GPIO_CFGLR_MODE2_0 ((uint32_t)0x00000100) /* Bit 0 */ +#define GPIO_CFGLR_MODE2_1 ((uint32_t)0x00000200) /* Bit 1 */ + +#define GPIO_CFGLR_MODE3 ((uint32_t)0x00003000) /* MODE3[1:0] bits (Port x mode bits, pin 3) */ +#define GPIO_CFGLR_MODE3_0 ((uint32_t)0x00001000) /* Bit 0 */ +#define GPIO_CFGLR_MODE3_1 ((uint32_t)0x00002000) /* Bit 1 */ + +#define GPIO_CFGLR_MODE4 ((uint32_t)0x00030000) /* MODE4[1:0] bits (Port x mode bits, pin 4) */ +#define GPIO_CFGLR_MODE4_0 ((uint32_t)0x00010000) /* Bit 0 */ +#define GPIO_CFGLR_MODE4_1 ((uint32_t)0x00020000) /* Bit 1 */ + +#define GPIO_CFGLR_MODE5 ((uint32_t)0x00300000) /* MODE5[1:0] bits (Port x mode bits, pin 5) */ +#define GPIO_CFGLR_MODE5_0 ((uint32_t)0x00100000) /* Bit 0 */ +#define GPIO_CFGLR_MODE5_1 ((uint32_t)0x00200000) /* Bit 1 */ + +#define GPIO_CFGLR_MODE6 ((uint32_t)0x03000000) /* MODE6[1:0] bits (Port x mode bits, pin 6) */ +#define GPIO_CFGLR_MODE6_0 ((uint32_t)0x01000000) /* Bit 0 */ +#define GPIO_CFGLR_MODE6_1 ((uint32_t)0x02000000) /* Bit 1 */ + +#define GPIO_CFGLR_MODE7 ((uint32_t)0x30000000) /* MODE7[1:0] bits (Port x mode bits, pin 7) */ +#define GPIO_CFGLR_MODE7_0 ((uint32_t)0x10000000) /* Bit 0 */ +#define GPIO_CFGLR_MODE7_1 ((uint32_t)0x20000000) /* Bit 1 */ + +#define GPIO_CFGLR_CNF ((uint32_t)0xCCCCCCCC) /* Port x configuration bits */ + +#define GPIO_CFGLR_CNF0 ((uint32_t)0x0000000C) /* CNF0[1:0] bits (Port x configuration bits, pin 0) */ +#define GPIO_CFGLR_CNF0_0 ((uint32_t)0x00000004) /* Bit 0 */ +#define GPIO_CFGLR_CNF0_1 ((uint32_t)0x00000008) /* Bit 1 */ + +#define GPIO_CFGLR_CNF1 ((uint32_t)0x000000C0) /* CNF1[1:0] bits (Port x configuration bits, pin 1) */ +#define GPIO_CFGLR_CNF1_0 ((uint32_t)0x00000040) /* Bit 0 */ +#define GPIO_CFGLR_CNF1_1 ((uint32_t)0x00000080) /* Bit 1 */ + +#define GPIO_CFGLR_CNF2 ((uint32_t)0x00000C00) /* CNF2[1:0] bits (Port x configuration bits, pin 2) */ +#define GPIO_CFGLR_CNF2_0 ((uint32_t)0x00000400) /* Bit 0 */ +#define GPIO_CFGLR_CNF2_1 ((uint32_t)0x00000800) /* Bit 1 */ + +#define GPIO_CFGLR_CNF3 ((uint32_t)0x0000C000) /* CNF3[1:0] bits (Port x configuration bits, pin 3) */ +#define GPIO_CFGLR_CNF3_0 ((uint32_t)0x00004000) /* Bit 0 */ +#define GPIO_CFGLR_CNF3_1 ((uint32_t)0x00008000) /* Bit 1 */ + +#define GPIO_CFGLR_CNF4 ((uint32_t)0x000C0000) /* CNF4[1:0] bits (Port x configuration bits, pin 4) */ +#define GPIO_CFGLR_CNF4_0 ((uint32_t)0x00040000) /* Bit 0 */ +#define GPIO_CFGLR_CNF4_1 ((uint32_t)0x00080000) /* Bit 1 */ + +#define GPIO_CFGLR_CNF5 ((uint32_t)0x00C00000) /* CNF5[1:0] bits (Port x configuration bits, pin 5) */ +#define GPIO_CFGLR_CNF5_0 ((uint32_t)0x00400000) /* Bit 0 */ +#define GPIO_CFGLR_CNF5_1 ((uint32_t)0x00800000) /* Bit 1 */ + +#define GPIO_CFGLR_CNF6 ((uint32_t)0x0C000000) /* CNF6[1:0] bits (Port x configuration bits, pin 6) */ +#define GPIO_CFGLR_CNF6_0 ((uint32_t)0x04000000) /* Bit 0 */ +#define GPIO_CFGLR_CNF6_1 ((uint32_t)0x08000000) /* Bit 1 */ + +#define GPIO_CFGLR_CNF7 ((uint32_t)0xC0000000) /* CNF7[1:0] bits (Port x configuration bits, pin 7) */ +#define GPIO_CFGLR_CNF7_0 ((uint32_t)0x40000000) /* Bit 0 */ +#define GPIO_CFGLR_CNF7_1 ((uint32_t)0x80000000) /* Bit 1 */ + +/******************* Bit definition for GPIO_CFGHR register *******************/ +#define GPIO_CFGHR_MODE ((uint32_t)0x33333333) /* Port x mode bits */ + +#define GPIO_CFGHR_MODE8 ((uint32_t)0x00000003) /* MODE8[1:0] bits (Port x mode bits, pin 8) */ +#define GPIO_CFGHR_MODE8_0 ((uint32_t)0x00000001) /* Bit 0 */ +#define GPIO_CFGHR_MODE8_1 ((uint32_t)0x00000002) /* Bit 1 */ + +#define GPIO_CFGHR_MODE9 ((uint32_t)0x00000030) /* MODE9[1:0] bits (Port x mode bits, pin 9) */ +#define GPIO_CFGHR_MODE9_0 ((uint32_t)0x00000010) /* Bit 0 */ +#define GPIO_CFGHR_MODE9_1 ((uint32_t)0x00000020) /* Bit 1 */ + +#define GPIO_CFGHR_MODE10 ((uint32_t)0x00000300) /* MODE10[1:0] bits (Port x mode bits, pin 10) */ +#define GPIO_CFGHR_MODE10_0 ((uint32_t)0x00000100) /* Bit 0 */ +#define GPIO_CFGHR_MODE10_1 ((uint32_t)0x00000200) /* Bit 1 */ + +#define GPIO_CFGHR_MODE11 ((uint32_t)0x00003000) /* MODE11[1:0] bits (Port x mode bits, pin 11) */ +#define GPIO_CFGHR_MODE11_0 ((uint32_t)0x00001000) /* Bit 0 */ +#define GPIO_CFGHR_MODE11_1 ((uint32_t)0x00002000) /* Bit 1 */ + +#define GPIO_CFGHR_MODE12 ((uint32_t)0x00030000) /* MODE12[1:0] bits (Port x mode bits, pin 12) */ +#define GPIO_CFGHR_MODE12_0 ((uint32_t)0x00010000) /* Bit 0 */ +#define GPIO_CFGHR_MODE12_1 ((uint32_t)0x00020000) /* Bit 1 */ + +#define GPIO_CFGHR_MODE13 ((uint32_t)0x00300000) /* MODE13[1:0] bits (Port x mode bits, pin 13) */ +#define GPIO_CFGHR_MODE13_0 ((uint32_t)0x00100000) /* Bit 0 */ +#define GPIO_CFGHR_MODE13_1 ((uint32_t)0x00200000) /* Bit 1 */ + +#define GPIO_CFGHR_MODE14 ((uint32_t)0x03000000) /* MODE14[1:0] bits (Port x mode bits, pin 14) */ +#define GPIO_CFGHR_MODE14_0 ((uint32_t)0x01000000) /* Bit 0 */ +#define GPIO_CFGHR_MODE14_1 ((uint32_t)0x02000000) /* Bit 1 */ + +#define GPIO_CFGHR_MODE15 ((uint32_t)0x30000000) /* MODE15[1:0] bits (Port x mode bits, pin 15) */ +#define GPIO_CFGHR_MODE15_0 ((uint32_t)0x10000000) /* Bit 0 */ +#define GPIO_CFGHR_MODE15_1 ((uint32_t)0x20000000) /* Bit 1 */ + +#define GPIO_CFGHR_CNF ((uint32_t)0xCCCCCCCC) /* Port x configuration bits */ + +#define GPIO_CFGHR_CNF8 ((uint32_t)0x0000000C) /* CNF8[1:0] bits (Port x configuration bits, pin 8) */ +#define GPIO_CFGHR_CNF8_0 ((uint32_t)0x00000004) /* Bit 0 */ +#define GPIO_CFGHR_CNF8_1 ((uint32_t)0x00000008) /* Bit 1 */ + +#define GPIO_CFGHR_CNF9 ((uint32_t)0x000000C0) /* CNF9[1:0] bits (Port x configuration bits, pin 9) */ +#define GPIO_CFGHR_CNF9_0 ((uint32_t)0x00000040) /* Bit 0 */ +#define GPIO_CFGHR_CNF9_1 ((uint32_t)0x00000080) /* Bit 1 */ + +#define GPIO_CFGHR_CNF10 ((uint32_t)0x00000C00) /* CNF10[1:0] bits (Port x configuration bits, pin 10) */ +#define GPIO_CFGHR_CNF10_0 ((uint32_t)0x00000400) /* Bit 0 */ +#define GPIO_CFGHR_CNF10_1 ((uint32_t)0x00000800) /* Bit 1 */ + +#define GPIO_CFGHR_CNF11 ((uint32_t)0x0000C000) /* CNF11[1:0] bits (Port x configuration bits, pin 11) */ +#define GPIO_CFGHR_CNF11_0 ((uint32_t)0x00004000) /* Bit 0 */ +#define GPIO_CFGHR_CNF11_1 ((uint32_t)0x00008000) /* Bit 1 */ + +#define GPIO_CFGHR_CNF12 ((uint32_t)0x000C0000) /* CNF12[1:0] bits (Port x configuration bits, pin 12) */ +#define GPIO_CFGHR_CNF12_0 ((uint32_t)0x00040000) /* Bit 0 */ +#define GPIO_CFGHR_CNF12_1 ((uint32_t)0x00080000) /* Bit 1 */ + +#define GPIO_CFGHR_CNF13 ((uint32_t)0x00C00000) /* CNF13[1:0] bits (Port x configuration bits, pin 13) */ +#define GPIO_CFGHR_CNF13_0 ((uint32_t)0x00400000) /* Bit 0 */ +#define GPIO_CFGHR_CNF13_1 ((uint32_t)0x00800000) /* Bit 1 */ + +#define GPIO_CFGHR_CNF14 ((uint32_t)0x0C000000) /* CNF14[1:0] bits (Port x configuration bits, pin 14) */ +#define GPIO_CFGHR_CNF14_0 ((uint32_t)0x04000000) /* Bit 0 */ +#define GPIO_CFGHR_CNF14_1 ((uint32_t)0x08000000) /* Bit 1 */ + +#define GPIO_CFGHR_CNF15 ((uint32_t)0xC0000000) /* CNF15[1:0] bits (Port x configuration bits, pin 15) */ +#define GPIO_CFGHR_CNF15_0 ((uint32_t)0x40000000) /* Bit 0 */ +#define GPIO_CFGHR_CNF15_1 ((uint32_t)0x80000000) /* Bit 1 */ + +/******************* Bit definition for GPIO_INDR register *******************/ +#define GPIO_INDR_IDR0 ((uint16_t)0x0001) /* Port input data, bit 0 */ +#define GPIO_INDR_IDR1 ((uint16_t)0x0002) /* Port input data, bit 1 */ +#define GPIO_INDR_IDR2 ((uint16_t)0x0004) /* Port input data, bit 2 */ +#define GPIO_INDR_IDR3 ((uint16_t)0x0008) /* Port input data, bit 3 */ +#define GPIO_INDR_IDR4 ((uint16_t)0x0010) /* Port input data, bit 4 */ +#define GPIO_INDR_IDR5 ((uint16_t)0x0020) /* Port input data, bit 5 */ +#define GPIO_INDR_IDR6 ((uint16_t)0x0040) /* Port input data, bit 6 */ +#define GPIO_INDR_IDR7 ((uint16_t)0x0080) /* Port input data, bit 7 */ +#define GPIO_INDR_IDR8 ((uint16_t)0x0100) /* Port input data, bit 8 */ +#define GPIO_INDR_IDR9 ((uint16_t)0x0200) /* Port input data, bit 9 */ +#define GPIO_INDR_IDR10 ((uint16_t)0x0400) /* Port input data, bit 10 */ +#define GPIO_INDR_IDR11 ((uint16_t)0x0800) /* Port input data, bit 11 */ +#define GPIO_INDR_IDR12 ((uint16_t)0x1000) /* Port input data, bit 12 */ +#define GPIO_INDR_IDR13 ((uint16_t)0x2000) /* Port input data, bit 13 */ +#define GPIO_INDR_IDR14 ((uint16_t)0x4000) /* Port input data, bit 14 */ +#define GPIO_INDR_IDR15 ((uint16_t)0x8000) /* Port input data, bit 15 */ + +/******************* Bit definition for GPIO_OUTDR register *******************/ +#define GPIO_OUTDR_ODR0 ((uint16_t)0x0001) /* Port output data, bit 0 */ +#define GPIO_OUTDR_ODR1 ((uint16_t)0x0002) /* Port output data, bit 1 */ +#define GPIO_OUTDR_ODR2 ((uint16_t)0x0004) /* Port output data, bit 2 */ +#define GPIO_OUTDR_ODR3 ((uint16_t)0x0008) /* Port output data, bit 3 */ +#define GPIO_OUTDR_ODR4 ((uint16_t)0x0010) /* Port output data, bit 4 */ +#define GPIO_OUTDR_ODR5 ((uint16_t)0x0020) /* Port output data, bit 5 */ +#define GPIO_OUTDR_ODR6 ((uint16_t)0x0040) /* Port output data, bit 6 */ +#define GPIO_OUTDR_ODR7 ((uint16_t)0x0080) /* Port output data, bit 7 */ +#define GPIO_OUTDR_ODR8 ((uint16_t)0x0100) /* Port output data, bit 8 */ +#define GPIO_OUTDR_ODR9 ((uint16_t)0x0200) /* Port output data, bit 9 */ +#define GPIO_OUTDR_ODR10 ((uint16_t)0x0400) /* Port output data, bit 10 */ +#define GPIO_OUTDR_ODR11 ((uint16_t)0x0800) /* Port output data, bit 11 */ +#define GPIO_OUTDR_ODR12 ((uint16_t)0x1000) /* Port output data, bit 12 */ +#define GPIO_OUTDR_ODR13 ((uint16_t)0x2000) /* Port output data, bit 13 */ +#define GPIO_OUTDR_ODR14 ((uint16_t)0x4000) /* Port output data, bit 14 */ +#define GPIO_OUTDR_ODR15 ((uint16_t)0x8000) /* Port output data, bit 15 */ + +/****************** Bit definition for GPIO_BSHR register *******************/ +#define GPIO_BSHR_BS0 ((uint32_t)0x00000001) /* Port x Set bit 0 */ +#define GPIO_BSHR_BS1 ((uint32_t)0x00000002) /* Port x Set bit 1 */ +#define GPIO_BSHR_BS2 ((uint32_t)0x00000004) /* Port x Set bit 2 */ +#define GPIO_BSHR_BS3 ((uint32_t)0x00000008) /* Port x Set bit 3 */ +#define GPIO_BSHR_BS4 ((uint32_t)0x00000010) /* Port x Set bit 4 */ +#define GPIO_BSHR_BS5 ((uint32_t)0x00000020) /* Port x Set bit 5 */ +#define GPIO_BSHR_BS6 ((uint32_t)0x00000040) /* Port x Set bit 6 */ +#define GPIO_BSHR_BS7 ((uint32_t)0x00000080) /* Port x Set bit 7 */ +#define GPIO_BSHR_BS8 ((uint32_t)0x00000100) /* Port x Set bit 8 */ +#define GPIO_BSHR_BS9 ((uint32_t)0x00000200) /* Port x Set bit 9 */ +#define GPIO_BSHR_BS10 ((uint32_t)0x00000400) /* Port x Set bit 10 */ +#define GPIO_BSHR_BS11 ((uint32_t)0x00000800) /* Port x Set bit 11 */ +#define GPIO_BSHR_BS12 ((uint32_t)0x00001000) /* Port x Set bit 12 */ +#define GPIO_BSHR_BS13 ((uint32_t)0x00002000) /* Port x Set bit 13 */ +#define GPIO_BSHR_BS14 ((uint32_t)0x00004000) /* Port x Set bit 14 */ +#define GPIO_BSHR_BS15 ((uint32_t)0x00008000) /* Port x Set bit 15 */ + +#define GPIO_BSHR_BR0 ((uint32_t)0x00010000) /* Port x Reset bit 0 */ +#define GPIO_BSHR_BR1 ((uint32_t)0x00020000) /* Port x Reset bit 1 */ +#define GPIO_BSHR_BR2 ((uint32_t)0x00040000) /* Port x Reset bit 2 */ +#define GPIO_BSHR_BR3 ((uint32_t)0x00080000) /* Port x Reset bit 3 */ +#define GPIO_BSHR_BR4 ((uint32_t)0x00100000) /* Port x Reset bit 4 */ +#define GPIO_BSHR_BR5 ((uint32_t)0x00200000) /* Port x Reset bit 5 */ +#define GPIO_BSHR_BR6 ((uint32_t)0x00400000) /* Port x Reset bit 6 */ +#define GPIO_BSHR_BR7 ((uint32_t)0x00800000) /* Port x Reset bit 7 */ +#define GPIO_BSHR_BR8 ((uint32_t)0x01000000) /* Port x Reset bit 8 */ +#define GPIO_BSHR_BR9 ((uint32_t)0x02000000) /* Port x Reset bit 9 */ +#define GPIO_BSHR_BR10 ((uint32_t)0x04000000) /* Port x Reset bit 10 */ +#define GPIO_BSHR_BR11 ((uint32_t)0x08000000) /* Port x Reset bit 11 */ +#define GPIO_BSHR_BR12 ((uint32_t)0x10000000) /* Port x Reset bit 12 */ +#define GPIO_BSHR_BR13 ((uint32_t)0x20000000) /* Port x Reset bit 13 */ +#define GPIO_BSHR_BR14 ((uint32_t)0x40000000) /* Port x Reset bit 14 */ +#define GPIO_BSHR_BR15 ((uint32_t)0x80000000) /* Port x Reset bit 15 */ + +/******************* Bit definition for GPIO_BCR register *******************/ +#define GPIO_BCR_BR0 ((uint16_t)0x0001) /* Port x Reset bit 0 */ +#define GPIO_BCR_BR1 ((uint16_t)0x0002) /* Port x Reset bit 1 */ +#define GPIO_BCR_BR2 ((uint16_t)0x0004) /* Port x Reset bit 2 */ +#define GPIO_BCR_BR3 ((uint16_t)0x0008) /* Port x Reset bit 3 */ +#define GPIO_BCR_BR4 ((uint16_t)0x0010) /* Port x Reset bit 4 */ +#define GPIO_BCR_BR5 ((uint16_t)0x0020) /* Port x Reset bit 5 */ +#define GPIO_BCR_BR6 ((uint16_t)0x0040) /* Port x Reset bit 6 */ +#define GPIO_BCR_BR7 ((uint16_t)0x0080) /* Port x Reset bit 7 */ +#define GPIO_BCR_BR8 ((uint16_t)0x0100) /* Port x Reset bit 8 */ +#define GPIO_BCR_BR9 ((uint16_t)0x0200) /* Port x Reset bit 9 */ +#define GPIO_BCR_BR10 ((uint16_t)0x0400) /* Port x Reset bit 10 */ +#define GPIO_BCR_BR11 ((uint16_t)0x0800) /* Port x Reset bit 11 */ +#define GPIO_BCR_BR12 ((uint16_t)0x1000) /* Port x Reset bit 12 */ +#define GPIO_BCR_BR13 ((uint16_t)0x2000) /* Port x Reset bit 13 */ +#define GPIO_BCR_BR14 ((uint16_t)0x4000) /* Port x Reset bit 14 */ +#define GPIO_BCR_BR15 ((uint16_t)0x8000) /* Port x Reset bit 15 */ + +/****************** Bit definition for GPIO_LCKR register *******************/ +#define GPIO_LCK0 ((uint32_t)0x00000001) /* Port x Lock bit 0 */ +#define GPIO_LCK1 ((uint32_t)0x00000002) /* Port x Lock bit 1 */ +#define GPIO_LCK2 ((uint32_t)0x00000004) /* Port x Lock bit 2 */ +#define GPIO_LCK3 ((uint32_t)0x00000008) /* Port x Lock bit 3 */ +#define GPIO_LCK4 ((uint32_t)0x00000010) /* Port x Lock bit 4 */ +#define GPIO_LCK5 ((uint32_t)0x00000020) /* Port x Lock bit 5 */ +#define GPIO_LCK6 ((uint32_t)0x00000040) /* Port x Lock bit 6 */ +#define GPIO_LCK7 ((uint32_t)0x00000080) /* Port x Lock bit 7 */ +#define GPIO_LCK8 ((uint32_t)0x00000100) /* Port x Lock bit 8 */ +#define GPIO_LCK9 ((uint32_t)0x00000200) /* Port x Lock bit 9 */ +#define GPIO_LCK10 ((uint32_t)0x00000400) /* Port x Lock bit 10 */ +#define GPIO_LCK11 ((uint32_t)0x00000800) /* Port x Lock bit 11 */ +#define GPIO_LCK12 ((uint32_t)0x00001000) /* Port x Lock bit 12 */ +#define GPIO_LCK13 ((uint32_t)0x00002000) /* Port x Lock bit 13 */ +#define GPIO_LCK14 ((uint32_t)0x00004000) /* Port x Lock bit 14 */ +#define GPIO_LCK15 ((uint32_t)0x00008000) /* Port x Lock bit 15 */ +#define GPIO_LCKK ((uint32_t)0x00010000) /* Lock key */ + +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +/****************** Bit definition for AFIO_ECR register *******************/ +#define AFIO_ECR_PIN ((uint8_t)0x0F) /* PIN[3:0] bits (Pin selection) */ +#define AFIO_ECR_PIN_0 ((uint8_t)0x01) /* Bit 0 */ +#define AFIO_ECR_PIN_1 ((uint8_t)0x02) /* Bit 1 */ +#define AFIO_ECR_PIN_2 ((uint8_t)0x04) /* Bit 2 */ +#define AFIO_ECR_PIN_3 ((uint8_t)0x08) /* Bit 3 */ + +#define AFIO_ECR_PIN_PX0 ((uint8_t)0x00) /* Pin 0 selected */ +#define AFIO_ECR_PIN_PX1 ((uint8_t)0x01) /* Pin 1 selected */ +#define AFIO_ECR_PIN_PX2 ((uint8_t)0x02) /* Pin 2 selected */ +#define AFIO_ECR_PIN_PX3 ((uint8_t)0x03) /* Pin 3 selected */ +#define AFIO_ECR_PIN_PX4 ((uint8_t)0x04) /* Pin 4 selected */ +#define AFIO_ECR_PIN_PX5 ((uint8_t)0x05) /* Pin 5 selected */ +#define AFIO_ECR_PIN_PX6 ((uint8_t)0x06) /* Pin 6 selected */ +#define AFIO_ECR_PIN_PX7 ((uint8_t)0x07) /* Pin 7 selected */ +#define AFIO_ECR_PIN_PX8 ((uint8_t)0x08) /* Pin 8 selected */ +#define AFIO_ECR_PIN_PX9 ((uint8_t)0x09) /* Pin 9 selected */ +#define AFIO_ECR_PIN_PX10 ((uint8_t)0x0A) /* Pin 10 selected */ +#define AFIO_ECR_PIN_PX11 ((uint8_t)0x0B) /* Pin 11 selected */ +#define AFIO_ECR_PIN_PX12 ((uint8_t)0x0C) /* Pin 12 selected */ +#define AFIO_ECR_PIN_PX13 ((uint8_t)0x0D) /* Pin 13 selected */ +#define AFIO_ECR_PIN_PX14 ((uint8_t)0x0E) /* Pin 14 selected */ +#define AFIO_ECR_PIN_PX15 ((uint8_t)0x0F) /* Pin 15 selected */ + +#define AFIO_ECR_PORT ((uint8_t)0x70) /* PORT[2:0] bits (Port selection) */ +#define AFIO_ECR_PORT_0 ((uint8_t)0x10) /* Bit 0 */ +#define AFIO_ECR_PORT_1 ((uint8_t)0x20) /* Bit 1 */ +#define AFIO_ECR_PORT_2 ((uint8_t)0x40) /* Bit 2 */ + +#define AFIO_ECR_PORT_PA ((uint8_t)0x00) /* Port A selected */ +#define AFIO_ECR_PORT_PB ((uint8_t)0x10) /* Port B selected */ +#define AFIO_ECR_PORT_PC ((uint8_t)0x20) /* Port C selected */ +#define AFIO_ECR_PORT_PD ((uint8_t)0x30) /* Port D selected */ +#define AFIO_ECR_PORT_PE ((uint8_t)0x40) /* Port E selected */ + +#define AFIO_ECR_EVOE ((uint8_t)0x80) /* Event Output Enable */ +#endif + +/****************** Bit definition for AFIO_PCFR1register *******************/ +#define AFIO_PCFR1_SPI1_REMAP ((uint32_t)0x00000001) /* SPI1 remapping */ +#define AFIO_PCFR1_I2C1_REMAP ((uint32_t)0x00000002) /* I2C1 remapping */ +#define AFIO_PCFR1_USART1_REMAP ((uint32_t)0x00000004) /* USART1 remapping */ +#define AFIO_PCFR1_USART1_REMAP_1 ((uint32_t)0x00200000) /* USART1 remapping higher bit */ +#define AFIO_PCFR1_USART2_REMAP ((uint32_t)0x00000008) /* USART2 remapping */ + +#define AFIO_PCFR1_USART3_REMAP ((uint32_t)0x00000030) /* USART3_REMAP[1:0] bits (USART3 remapping) */ +#define AFIO_PCFR1_USART3_REMAP_0 ((uint32_t)0x00000010) /* Bit 0 */ +#define AFIO_PCFR1_USART3_REMAP_1 ((uint32_t)0x00000020) /* Bit 1 */ + +#define AFIO_PCFR1_USART3_REMAP_NOREMAP ((uint32_t)0x00000000) /* No remap (TX/PB10, RX/PB11, CK/PB12, CTS/PB13, RTS/PB14) */ +#define AFIO_PCFR1_USART3_REMAP_PARTIALREMAP ((uint32_t)0x00000010) /* Partial remap (TX/PC10, RX/PC11, CK/PC12, CTS/PB13, RTS/PB14) */ +#define AFIO_PCFR1_USART3_REMAP_FULLREMAP ((uint32_t)0x00000030) /* Full remap (TX/PD8, RX/PD9, CK/PD10, CTS/PD11, RTS/PD12) */ + +#define AFIO_PCFR1_TIM1_REMAP ((uint32_t)0x000000C0) /* TIM1_REMAP[1:0] bits (TIM1 remapping) */ +#define AFIO_PCFR1_TIM1_REMAP_0 ((uint32_t)0x00000040) /* Bit 0 */ +#define AFIO_PCFR1_TIM1_REMAP_1 ((uint32_t)0x00000080) /* Bit 1 */ + +#define AFIO_PCFR1_TIM1_REMAP_NOREMAP ((uint32_t)0x00000000) /* No remap (ETR/PA12, CH1/PA8, CH2/PA9, CH3/PA10, CH4/PA11, BKIN/PB12, CH1N/PB13, CH2N/PB14, CH3N/PB15) */ +#define AFIO_PCFR1_TIM1_REMAP_PARTIALREMAP1 ((uint32_t)0x00000040) /* Partial remap (ETR/PA12, CH1/PA8, CH2/PA9, CH3/PA10, CH4/PA11, BKIN/PA6, CH1N/PA7, CH2N/PB0, CH3N/PB1) */ +#define AFIO_PCFR1_TIM1_REMAP_PARTIALREMAP AFIO_PCFR1_TIM1_REMAP_PARTIALREMAP1 /* legacy compatibility */ +#define AFIO_PCFR1_TIM1_REMAP_PARTIALREMAP2 ((uint32_t)0x00000080) /* Partial remap (ETR/PD4, CH1/PD2, CH2/PA1, CH3/PC3, CH4/PC4, BKIN/PC2, CH1N/PD0, CN2N/PA2, CH3N/PD1) */ +#define AFIO_PCFR1_TIM1_REMAP_FULLREMAP ((uint32_t)0x000000C0) /* Full remap (ETR/PE7, CH1/PE9, CH2/PE11, CH3/PE13, CH4/PE14, BKIN/PE15, CH1N/PE8, CH2N/PE10, CH3N/PE12) */ + +#define AFIO_PCFR1_TIM2_REMAP ((uint32_t)0x00000300) /* TIM2_REMAP[1:0] bits (TIM2 remapping) */ +#define AFIO_PCFR1_TIM2_REMAP_0 ((uint32_t)0x00000100) /* Bit 0 */ +#define AFIO_PCFR1_TIM2_REMAP_1 ((uint32_t)0x00000200) /* Bit 1 */ + +#define AFIO_PCFR1_TIM2_REMAP_NOREMAP ((uint32_t)0x00000000) /* No remap (CH1/ETR/PA0, CH2/PA1, CH3/PA2, CH4/PA3) */ +#define AFIO_PCFR1_TIM2_REMAP_PARTIALREMAP1 ((uint32_t)0x00000100) /* Partial remap (CH1/ETR/PA15, CH2/PB3, CH3/PA2, CH4/PA3) */ +#define AFIO_PCFR1_TIM2_REMAP_PARTIALREMAP2 ((uint32_t)0x00000200) /* Partial remap (CH1/ETR/PA0, CH2/PA1, CH3/PB10, CH4/PB11) */ +#define AFIO_PCFR1_TIM2_REMAP_FULLREMAP ((uint32_t)0x00000300) /* Full remap (CH1/ETR/PA15, CH2/PB3, CH3/PB10, CH4/PB11) */ + +#define AFIO_PCFR1_TIM3_REMAP ((uint32_t)0x00000C00) /* TIM3_REMAP[1:0] bits (TIM3 remapping) */ +#define AFIO_PCFR1_TIM3_REMAP_0 ((uint32_t)0x00000400) /* Bit 0 */ +#define AFIO_PCFR1_TIM3_REMAP_1 ((uint32_t)0x00000800) /* Bit 1 */ + +#define AFIO_PCFR1_TIM3_REMAP_NOREMAP ((uint32_t)0x00000000) /* No remap (CH1/PA6, CH2/PA7, CH3/PB0, CH4/PB1) */ +#define AFIO_PCFR1_TIM3_REMAP_PARTIALREMAP ((uint32_t)0x00000800) /* Partial remap (CH1/PB4, CH2/PB5, CH3/PB0, CH4/PB1) */ +#define AFIO_PCFR1_TIM3_REMAP_FULLREMAP ((uint32_t)0x00000C00) /* Full remap (CH1/PC6, CH2/PC7, CH3/PC8, CH4/PC9) */ + +#define AFIO_PCFR1_TIM4_REMAP ((uint32_t)0x00001000) /* TIM4_REMAP bit (TIM4 remapping) */ + +#define AFIO_PCFR1_CAN_REMAP ((uint32_t)0x00006000) /* CAN_REMAP[1:0] bits (CAN Alternate function remapping) */ +#define AFIO_PCFR1_CAN_REMAP_0 ((uint32_t)0x00002000) /* Bit 0 */ +#define AFIO_PCFR1_CAN_REMAP_1 ((uint32_t)0x00004000) /* Bit 1 */ + +#define AFIO_PCFR1_CAN_REMAP_REMAP1 ((uint32_t)0x00000000) /* CANRX mapped to PA11, CANTX mapped to PA12 */ +#define AFIO_PCFR1_CAN_REMAP_REMAP2 ((uint32_t)0x00004000) /* CANRX mapped to PB8, CANTX mapped to PB9 */ +#define AFIO_PCFR1_CAN_REMAP_REMAP3 ((uint32_t)0x00006000) /* CANRX mapped to PD0, CANTX mapped to PD1 */ + +#ifdef CH32V003 +#define AFIO_PCFR1_PA12_REMAP ((uint32_t)0x00008000) /* Port D0/Port D1 mapping on OSC_IN/OSC_OUT */ +#elif defined(CH32V20x) || defined(CH32V30x) +#define AFIO_PCFR1_PD01_REMAP ((uint32_t)0x00008000) /* Port D0/Port D1 mapping on OSC_IN/OSC_OUT */ +#endif +#define AFIO_PCFR1_TIM5CH4_IREMAP ((uint32_t)0x00010000) /* TIM5 Channel4 Internal Remap */ +#define AFIO_PCFR1_ADC1_ETRGINJ_REMAP ((uint32_t)0x00020000) /* ADC 1 External Trigger Injected Conversion remapping */ +#define AFIO_PCFR1_ADC1_ETRGREG_REMAP ((uint32_t)0x00040000) /* ADC 1 External Trigger Regular Conversion remapping */ +#define AFIO_PCFR1_ADC2_ETRGINJ_REMAP ((uint32_t)0x00080000) /* ADC 2 External Trigger Injected Conversion remapping */ +#define AFIO_PCFR1_ADC2_ETRGREG_REMAP ((uint32_t)0x00100000) /* ADC 2 External Trigger Regular Conversion remapping */ + +#define AFIO_PCFR1_SWJ_CFG ((uint32_t)0x07000000) /* SWJ_CFG[2:0] bits (Serial Wire JTAG configuration) */ +#define AFIO_PCFR1_SWJ_CFG_0 ((uint32_t)0x01000000) /* Bit 0 */ +#define AFIO_PCFR1_SWJ_CFG_1 ((uint32_t)0x02000000) /* Bit 1 */ +#define AFIO_PCFR1_SWJ_CFG_2 ((uint32_t)0x04000000) /* Bit 2 */ + +#define AFIO_PCFR1_SWJ_CFG_RESET ((uint32_t)0x00000000) /* Full SWJ (JTAG-DP + SW-DP) : Reset State */ +#define AFIO_PCFR1_SWJ_CFG_NOJNTRST ((uint32_t)0x01000000) /* Full SWJ (JTAG-DP + SW-DP) but without JNTRST */ +#define AFIO_PCFR1_SWJ_CFG_JTAGDISABLE ((uint32_t)0x02000000) /* JTAG-DP Disabled and SW-DP Enabled */ +#define AFIO_PCFR1_SWJ_CFG_DISABLE ((uint32_t)0x04000000) /* JTAG-DP Disabled and SW-DP Disabled */ + + +#if defined(CH32V003) +/***************** Bit definition for AFIO_EXTICR register *****************/ +#define AFIO_EXTICR_EXTI0 ((uint16_t)0x0003) /* EXTI 0 configuration */ +#define AFIO_EXTICR_EXTI1 ((uint16_t)0x000C) /* EXTI 1 configuration */ +#define AFIO_EXTICR_EXTI2 ((uint16_t)0x0030) /* EXTI 2 configuration */ +#define AFIO_EXTICR_EXTI3 ((uint16_t)0x00C0) /* EXTI 3 configuration */ +#define AFIO_EXTICR_EXTI4 ((uint16_t)0x0300) /* EXTI 4 configuration */ +#define AFIO_EXTICR_EXTI5 ((uint16_t)0x0C00) /* EXTI 5 configuration */ +#define AFIO_EXTICR_EXTI6 ((uint16_t)0x3000) /* EXTI 6 configuration */ +#define AFIO_EXTICR_EXTI7 ((uint16_t)0xC000) /* EXTI 7 configuration */ + +#define AFIO_EXTICR_EXTI0_PC ((uint16_t)0x0002) /* PC[0] pin */ +#define AFIO_EXTICR_EXTI0_PD ((uint16_t)0x0003) /* PD[0] pin */ +#define AFIO_EXTICR_EXTI1_PA ((uint16_t)0x0000) /* PA[1] pin */ +#define AFIO_EXTICR_EXTI1_PC ((uint16_t)0x0008) /* PC[1] pin */ +#define AFIO_EXTICR_EXTI1_PD ((uint16_t)0x000C) /* PD[1] pin */ +#define AFIO_EXTICR_EXTI2_PA ((uint16_t)0x0000) /* PA[2] pin */ +#define AFIO_EXTICR_EXTI2_PC ((uint16_t)0x0020) /* PC[2] pin */ +#define AFIO_EXTICR_EXTI2_PD ((uint16_t)0x0030) /* PD[2] pin */ +#define AFIO_EXTICR_EXTI3_PC ((uint16_t)0x0080) /* PC[3] pin */ +#define AFIO_EXTICR_EXTI3_PD ((uint16_t)0x00C0) /* PD[3] pin */ +#define AFIO_EXTICR_EXTI4_PC ((uint16_t)0x0200) /* PC[4] pin */ +#define AFIO_EXTICR_EXTI4_PD ((uint16_t)0x0300) /* PD[4] pin */ +#define AFIO_EXTICR_EXTI5_PC ((uint16_t)0x0800) /* PC[5] pin */ +#define AFIO_EXTICR_EXTI5_PD ((uint16_t)0x0C00) /* PD[5] pin */ +#define AFIO_EXTICR_EXTI6_PC ((uint16_t)0x2000) /* PC[6] pin */ +#define AFIO_EXTICR_EXTI6_PD ((uint16_t)0x3000) /* PD[6] pin */ +#define AFIO_EXTICR_EXTI7_PC ((uint16_t)0x8000) /* PC[7] pin */ +#define AFIO_EXTICR_EXTI7_PD ((uint16_t)0xC000) /* PD[7] pin */ +#endif + +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +/***************** Bit definition for AFIO_EXTICR1 register *****************/ +#define AFIO_EXTICR1_EXTI0 ((uint16_t)0x000F) /* EXTI 0 configuration */ +#define AFIO_EXTICR1_EXTI1 ((uint16_t)0x00F0) /* EXTI 1 configuration */ +#define AFIO_EXTICR1_EXTI2 ((uint16_t)0x0F00) /* EXTI 2 configuration */ +#define AFIO_EXTICR1_EXTI3 ((uint16_t)0xF000) /* EXTI 3 configuration */ + +#define AFIO_EXTICR1_EXTI0_PA ((uint16_t)0x0000) /* PA[0] pin */ +#define AFIO_EXTICR1_EXTI0_PB ((uint16_t)0x0001) /* PB[0] pin */ +#define AFIO_EXTICR1_EXTI0_PC ((uint16_t)0x0002) /* PC[0] pin */ +#define AFIO_EXTICR1_EXTI0_PD ((uint16_t)0x0003) /* PD[0] pin */ +#define AFIO_EXTICR1_EXTI0_PE ((uint16_t)0x0004) /* PE[0] pin */ +#define AFIO_EXTICR1_EXTI0_PF ((uint16_t)0x0005) /* PF[0] pin */ +#define AFIO_EXTICR1_EXTI0_PG ((uint16_t)0x0006) /* PG[0] pin */ + +#define AFIO_EXTICR1_EXTI1_PA ((uint16_t)0x0000) /* PA[1] pin */ +#define AFIO_EXTICR1_EXTI1_PB ((uint16_t)0x0010) /* PB[1] pin */ +#define AFIO_EXTICR1_EXTI1_PC ((uint16_t)0x0020) /* PC[1] pin */ +#define AFIO_EXTICR1_EXTI1_PD ((uint16_t)0x0030) /* PD[1] pin */ +#define AFIO_EXTICR1_EXTI1_PE ((uint16_t)0x0040) /* PE[1] pin */ +#define AFIO_EXTICR1_EXTI1_PF ((uint16_t)0x0050) /* PF[1] pin */ +#define AFIO_EXTICR1_EXTI1_PG ((uint16_t)0x0060) /* PG[1] pin */ + +#define AFIO_EXTICR1_EXTI2_PA ((uint16_t)0x0000) /* PA[2] pin */ +#define AFIO_EXTICR1_EXTI2_PB ((uint16_t)0x0100) /* PB[2] pin */ +#define AFIO_EXTICR1_EXTI2_PC ((uint16_t)0x0200) /* PC[2] pin */ +#define AFIO_EXTICR1_EXTI2_PD ((uint16_t)0x0300) /* PD[2] pin */ +#define AFIO_EXTICR1_EXTI2_PE ((uint16_t)0x0400) /* PE[2] pin */ +#define AFIO_EXTICR1_EXTI2_PF ((uint16_t)0x0500) /* PF[2] pin */ +#define AFIO_EXTICR1_EXTI2_PG ((uint16_t)0x0600) /* PG[2] pin */ + +#define AFIO_EXTICR1_EXTI3_PA ((uint16_t)0x0000) /* PA[3] pin */ +#define AFIO_EXTICR1_EXTI3_PB ((uint16_t)0x1000) /* PB[3] pin */ +#define AFIO_EXTICR1_EXTI3_PC ((uint16_t)0x2000) /* PC[3] pin */ +#define AFIO_EXTICR1_EXTI3_PD ((uint16_t)0x3000) /* PD[3] pin */ +#define AFIO_EXTICR1_EXTI3_PE ((uint16_t)0x4000) /* PE[3] pin */ +#define AFIO_EXTICR1_EXTI3_PF ((uint16_t)0x5000) /* PF[3] pin */ +#define AFIO_EXTICR1_EXTI3_PG ((uint16_t)0x6000) /* PG[3] pin */ + +/***************** Bit definition for AFIO_EXTICR2 register *****************/ +#define AFIO_EXTICR2_EXTI4 ((uint16_t)0x000F) /* EXTI 4 configuration */ +#define AFIO_EXTICR2_EXTI5 ((uint16_t)0x00F0) /* EXTI 5 configuration */ +#define AFIO_EXTICR2_EXTI6 ((uint16_t)0x0F00) /* EXTI 6 configuration */ +#define AFIO_EXTICR2_EXTI7 ((uint16_t)0xF000) /* EXTI 7 configuration */ + +#define AFIO_EXTICR2_EXTI4_PA ((uint16_t)0x0000) /* PA[4] pin */ +#define AFIO_EXTICR2_EXTI4_PB ((uint16_t)0x0001) /* PB[4] pin */ +#define AFIO_EXTICR2_EXTI4_PC ((uint16_t)0x0002) /* PC[4] pin */ +#define AFIO_EXTICR2_EXTI4_PD ((uint16_t)0x0003) /* PD[4] pin */ +#define AFIO_EXTICR2_EXTI4_PE ((uint16_t)0x0004) /* PE[4] pin */ +#define AFIO_EXTICR2_EXTI4_PF ((uint16_t)0x0005) /* PF[4] pin */ +#define AFIO_EXTICR2_EXTI4_PG ((uint16_t)0x0006) /* PG[4] pin */ + +#define AFIO_EXTICR2_EXTI5_PA ((uint16_t)0x0000) /* PA[5] pin */ +#define AFIO_EXTICR2_EXTI5_PB ((uint16_t)0x0010) /* PB[5] pin */ +#define AFIO_EXTICR2_EXTI5_PC ((uint16_t)0x0020) /* PC[5] pin */ +#define AFIO_EXTICR2_EXTI5_PD ((uint16_t)0x0030) /* PD[5] pin */ +#define AFIO_EXTICR2_EXTI5_PE ((uint16_t)0x0040) /* PE[5] pin */ +#define AFIO_EXTICR2_EXTI5_PF ((uint16_t)0x0050) /* PF[5] pin */ +#define AFIO_EXTICR2_EXTI5_PG ((uint16_t)0x0060) /* PG[5] pin */ + +#define AFIO_EXTICR2_EXTI6_PA ((uint16_t)0x0000) /* PA[6] pin */ +#define AFIO_EXTICR2_EXTI6_PB ((uint16_t)0x0100) /* PB[6] pin */ +#define AFIO_EXTICR2_EXTI6_PC ((uint16_t)0x0200) /* PC[6] pin */ +#define AFIO_EXTICR2_EXTI6_PD ((uint16_t)0x0300) /* PD[6] pin */ +#define AFIO_EXTICR2_EXTI6_PE ((uint16_t)0x0400) /* PE[6] pin */ +#define AFIO_EXTICR2_EXTI6_PF ((uint16_t)0x0500) /* PF[6] pin */ +#define AFIO_EXTICR2_EXTI6_PG ((uint16_t)0x0600) /* PG[6] pin */ + +#define AFIO_EXTICR2_EXTI7_PA ((uint16_t)0x0000) /* PA[7] pin */ +#define AFIO_EXTICR2_EXTI7_PB ((uint16_t)0x1000) /* PB[7] pin */ +#define AFIO_EXTICR2_EXTI7_PC ((uint16_t)0x2000) /* PC[7] pin */ +#define AFIO_EXTICR2_EXTI7_PD ((uint16_t)0x3000) /* PD[7] pin */ +#define AFIO_EXTICR2_EXTI7_PE ((uint16_t)0x4000) /* PE[7] pin */ +#define AFIO_EXTICR2_EXTI7_PF ((uint16_t)0x5000) /* PF[7] pin */ +#define AFIO_EXTICR2_EXTI7_PG ((uint16_t)0x6000) /* PG[7] pin */ + +/***************** Bit definition for AFIO_EXTICR3 register *****************/ +#define AFIO_EXTICR3_EXTI8 ((uint16_t)0x000F) /* EXTI 8 configuration */ +#define AFIO_EXTICR3_EXTI9 ((uint16_t)0x00F0) /* EXTI 9 configuration */ +#define AFIO_EXTICR3_EXTI10 ((uint16_t)0x0F00) /* EXTI 10 configuration */ +#define AFIO_EXTICR3_EXTI11 ((uint16_t)0xF000) /* EXTI 11 configuration */ + +#define AFIO_EXTICR3_EXTI8_PA ((uint16_t)0x0000) /* PA[8] pin */ +#define AFIO_EXTICR3_EXTI8_PB ((uint16_t)0x0001) /* PB[8] pin */ +#define AFIO_EXTICR3_EXTI8_PC ((uint16_t)0x0002) /* PC[8] pin */ +#define AFIO_EXTICR3_EXTI8_PD ((uint16_t)0x0003) /* PD[8] pin */ +#define AFIO_EXTICR3_EXTI8_PE ((uint16_t)0x0004) /* PE[8] pin */ +#define AFIO_EXTICR3_EXTI8_PF ((uint16_t)0x0005) /* PF[8] pin */ +#define AFIO_EXTICR3_EXTI8_PG ((uint16_t)0x0006) /* PG[8] pin */ + +#define AFIO_EXTICR3_EXTI9_PA ((uint16_t)0x0000) /* PA[9] pin */ +#define AFIO_EXTICR3_EXTI9_PB ((uint16_t)0x0010) /* PB[9] pin */ +#define AFIO_EXTICR3_EXTI9_PC ((uint16_t)0x0020) /* PC[9] pin */ +#define AFIO_EXTICR3_EXTI9_PD ((uint16_t)0x0030) /* PD[9] pin */ +#define AFIO_EXTICR3_EXTI9_PE ((uint16_t)0x0040) /* PE[9] pin */ +#define AFIO_EXTICR3_EXTI9_PF ((uint16_t)0x0050) /* PF[9] pin */ +#define AFIO_EXTICR3_EXTI9_PG ((uint16_t)0x0060) /* PG[9] pin */ + +#define AFIO_EXTICR3_EXTI10_PA ((uint16_t)0x0000) /* PA[10] pin */ +#define AFIO_EXTICR3_EXTI10_PB ((uint16_t)0x0100) /* PB[10] pin */ +#define AFIO_EXTICR3_EXTI10_PC ((uint16_t)0x0200) /* PC[10] pin */ +#define AFIO_EXTICR3_EXTI10_PD ((uint16_t)0x0300) /* PD[10] pin */ +#define AFIO_EXTICR3_EXTI10_PE ((uint16_t)0x0400) /* PE[10] pin */ +#define AFIO_EXTICR3_EXTI10_PF ((uint16_t)0x0500) /* PF[10] pin */ +#define AFIO_EXTICR3_EXTI10_PG ((uint16_t)0x0600) /* PG[10] pin */ + +#define AFIO_EXTICR3_EXTI11_PA ((uint16_t)0x0000) /* PA[11] pin */ +#define AFIO_EXTICR3_EXTI11_PB ((uint16_t)0x1000) /* PB[11] pin */ +#define AFIO_EXTICR3_EXTI11_PC ((uint16_t)0x2000) /* PC[11] pin */ +#define AFIO_EXTICR3_EXTI11_PD ((uint16_t)0x3000) /* PD[11] pin */ +#define AFIO_EXTICR3_EXTI11_PE ((uint16_t)0x4000) /* PE[11] pin */ +#define AFIO_EXTICR3_EXTI11_PF ((uint16_t)0x5000) /* PF[11] pin */ +#define AFIO_EXTICR3_EXTI11_PG ((uint16_t)0x6000) /* PG[11] pin */ + +/***************** Bit definition for AFIO_EXTICR4 register *****************/ +#define AFIO_EXTICR4_EXTI12 ((uint16_t)0x000F) /* EXTI 12 configuration */ +#define AFIO_EXTICR4_EXTI13 ((uint16_t)0x00F0) /* EXTI 13 configuration */ +#define AFIO_EXTICR4_EXTI14 ((uint16_t)0x0F00) /* EXTI 14 configuration */ +#define AFIO_EXTICR4_EXTI15 ((uint16_t)0xF000) /* EXTI 15 configuration */ + +#define AFIO_EXTICR4_EXTI12_PA ((uint16_t)0x0000) /* PA[12] pin */ +#define AFIO_EXTICR4_EXTI12_PB ((uint16_t)0x0001) /* PB[12] pin */ +#define AFIO_EXTICR4_EXTI12_PC ((uint16_t)0x0002) /* PC[12] pin */ +#define AFIO_EXTICR4_EXTI12_PD ((uint16_t)0x0003) /* PD[12] pin */ +#define AFIO_EXTICR4_EXTI12_PE ((uint16_t)0x0004) /* PE[12] pin */ +#define AFIO_EXTICR4_EXTI12_PF ((uint16_t)0x0005) /* PF[12] pin */ +#define AFIO_EXTICR4_EXTI12_PG ((uint16_t)0x0006) /* PG[12] pin */ + +#define AFIO_EXTICR4_EXTI13_PA ((uint16_t)0x0000) /* PA[13] pin */ +#define AFIO_EXTICR4_EXTI13_PB ((uint16_t)0x0010) /* PB[13] pin */ +#define AFIO_EXTICR4_EXTI13_PC ((uint16_t)0x0020) /* PC[13] pin */ +#define AFIO_EXTICR4_EXTI13_PD ((uint16_t)0x0030) /* PD[13] pin */ +#define AFIO_EXTICR4_EXTI13_PE ((uint16_t)0x0040) /* PE[13] pin */ +#define AFIO_EXTICR4_EXTI13_PF ((uint16_t)0x0050) /* PF[13] pin */ +#define AFIO_EXTICR4_EXTI13_PG ((uint16_t)0x0060) /* PG[13] pin */ + +#define AFIO_EXTICR4_EXTI14_PA ((uint16_t)0x0000) /* PA[14] pin */ +#define AFIO_EXTICR4_EXTI14_PB ((uint16_t)0x0100) /* PB[14] pin */ +#define AFIO_EXTICR4_EXTI14_PC ((uint16_t)0x0200) /* PC[14] pin */ +#define AFIO_EXTICR4_EXTI14_PD ((uint16_t)0x0300) /* PD[14] pin */ +#define AFIO_EXTICR4_EXTI14_PE ((uint16_t)0x0400) /* PE[14] pin */ +#define AFIO_EXTICR4_EXTI14_PF ((uint16_t)0x0500) /* PF[14] pin */ +#define AFIO_EXTICR4_EXTI14_PG ((uint16_t)0x0600) /* PG[14] pin */ + +#define AFIO_EXTICR4_EXTI15_PA ((uint16_t)0x0000) /* PA[15] pin */ +#define AFIO_EXTICR4_EXTI15_PB ((uint16_t)0x1000) /* PB[15] pin */ +#define AFIO_EXTICR4_EXTI15_PC ((uint16_t)0x2000) /* PC[15] pin */ +#define AFIO_EXTICR4_EXTI15_PD ((uint16_t)0x3000) /* PD[15] pin */ +#define AFIO_EXTICR4_EXTI15_PE ((uint16_t)0x4000) /* PE[15] pin */ +#define AFIO_EXTICR4_EXTI15_PF ((uint16_t)0x5000) /* PF[15] pin */ +#define AFIO_EXTICR4_EXTI15_PG ((uint16_t)0x6000) /* PG[15] pin */ +#endif + +/******************************************************************************/ +/* Independent WATCHDOG */ +/******************************************************************************/ + +/******************* Bit definition for IWDG_CTLR register ********************/ +#define IWDG_KEY ((uint16_t)0xFFFF) /* Key value (write only, read 0000h) */ + +/******************* Bit definition for IWDG_PSCR register ********************/ +#define IWDG_PR ((uint8_t)0x07) /* PR[2:0] (Prescaler divider) */ +#define IWDG_PR_0 ((uint8_t)0x01) /* Bit 0 */ +#define IWDG_PR_1 ((uint8_t)0x02) /* Bit 1 */ +#define IWDG_PR_2 ((uint8_t)0x04) /* Bit 2 */ + +/******************* Bit definition for IWDG_RLDR register *******************/ +#define IWDG_RL ((uint16_t)0x0FFF) /* Watchdog counter reload value */ + +/******************* Bit definition for IWDG_STATR register ********************/ +#define IWDG_PVU ((uint8_t)0x01) /* Watchdog prescaler value update */ +#define IWDG_RVU ((uint8_t)0x02) /* Watchdog counter reload value update */ + +/******************************************************************************/ +/* Inter-integrated Circuit Interface */ +/******************************************************************************/ + +/******************* Bit definition for I2C_CTLR1 register ********************/ +#define I2C_CTLR1_PE ((uint16_t)0x0001) /* Peripheral Enable */ +#define I2C_CTLR1_SMBUS ((uint16_t)0x0002) /* SMBus Mode */ +#define I2C_CTLR1_SMBTYPE ((uint16_t)0x0008) /* SMBus Type */ +#define I2C_CTLR1_ENARP ((uint16_t)0x0010) /* ARP Enable */ +#define I2C_CTLR1_ENPEC ((uint16_t)0x0020) /* PEC Enable */ +#define I2C_CTLR1_ENGC ((uint16_t)0x0040) /* General Call Enable */ +#define I2C_CTLR1_NOSTRETCH ((uint16_t)0x0080) /* Clock Stretching Disable (Slave mode) */ +#define I2C_CTLR1_START ((uint16_t)0x0100) /* Start Generation */ +#define I2C_CTLR1_STOP ((uint16_t)0x0200) /* Stop Generation */ +#define I2C_CTLR1_ACK ((uint16_t)0x0400) /* Acknowledge Enable */ +#define I2C_CTLR1_POS ((uint16_t)0x0800) /* Acknowledge/PEC Position (for data reception) */ +#define I2C_CTLR1_PEC ((uint16_t)0x1000) /* Packet Error Checking */ +#define I2C_CTLR1_ALERT ((uint16_t)0x2000) /* SMBus Alert */ +#define I2C_CTLR1_SWRST ((uint16_t)0x8000) /* Software Reset */ + +/******************* Bit definition for I2C_CTLR2 register ********************/ +#define I2C_CTLR2_FREQ ((uint16_t)0x003F) /* FREQ[5:0] bits (Peripheral Clock Frequency) */ +#define I2C_CTLR2_FREQ_0 ((uint16_t)0x0001) /* Bit 0 */ +#define I2C_CTLR2_FREQ_1 ((uint16_t)0x0002) /* Bit 1 */ +#define I2C_CTLR2_FREQ_2 ((uint16_t)0x0004) /* Bit 2 */ +#define I2C_CTLR2_FREQ_3 ((uint16_t)0x0008) /* Bit 3 */ +#define I2C_CTLR2_FREQ_4 ((uint16_t)0x0010) /* Bit 4 */ +#define I2C_CTLR2_FREQ_5 ((uint16_t)0x0020) /* Bit 5 */ + +#define I2C_CTLR2_ITERREN ((uint16_t)0x0100) /* Error Interrupt Enable */ +#define I2C_CTLR2_ITEVTEN ((uint16_t)0x0200) /* Event Interrupt Enable */ +#define I2C_CTLR2_ITBUFEN ((uint16_t)0x0400) /* Buffer Interrupt Enable */ +#define I2C_CTLR2_DMAEN ((uint16_t)0x0800) /* DMA Requests Enable */ +#define I2C_CTLR2_LAST ((uint16_t)0x1000) /* DMA Last Transfer */ + +/******************* Bit definition for I2C_OADDR1 register *******************/ +#define I2C_OADDR1_ADD1_7 ((uint16_t)0x00FE) /* Interface Address */ +#define I2C_OADDR1_ADD8_9 ((uint16_t)0x0300) /* Interface Address */ + +#define I2C_OADDR1_ADD0 ((uint16_t)0x0001) /* Bit 0 */ +#define I2C_OADDR1_ADD1 ((uint16_t)0x0002) /* Bit 1 */ +#define I2C_OADDR1_ADD2 ((uint16_t)0x0004) /* Bit 2 */ +#define I2C_OADDR1_ADD3 ((uint16_t)0x0008) /* Bit 3 */ +#define I2C_OADDR1_ADD4 ((uint16_t)0x0010) /* Bit 4 */ +#define I2C_OADDR1_ADD5 ((uint16_t)0x0020) /* Bit 5 */ +#define I2C_OADDR1_ADD6 ((uint16_t)0x0040) /* Bit 6 */ +#define I2C_OADDR1_ADD7 ((uint16_t)0x0080) /* Bit 7 */ +#define I2C_OADDR1_ADD8 ((uint16_t)0x0100) /* Bit 8 */ +#define I2C_OADDR1_ADD9 ((uint16_t)0x0200) /* Bit 9 */ + +#define I2C_OADDR1_ADDMODE ((uint16_t)0x8000) /* Addressing Mode (Slave mode) */ + +/******************* Bit definition for I2C_OADDR2 register *******************/ +#define I2C_OADDR2_ENDUAL ((uint8_t)0x01) /* Dual addressing mode enable */ +#define I2C_OADDR2_ADD2 ((uint8_t)0xFE) /* Interface address */ + +/******************** Bit definition for I2C_DATAR register ********************/ +#define I2C_DR_DATAR ((uint8_t)0xFF) /* 8-bit Data Register */ + +/******************* Bit definition for I2C_STAR1 register ********************/ +#define I2C_STAR1_SB ((uint16_t)0x0001) /* Start Bit (Master mode) */ +#define I2C_STAR1_ADDR ((uint16_t)0x0002) /* Address sent (master mode)/matched (slave mode) */ +#define I2C_STAR1_BTF ((uint16_t)0x0004) /* Byte Transfer Finished */ +#define I2C_STAR1_ADD10 ((uint16_t)0x0008) /* 10-bit header sent (Master mode) */ +#define I2C_STAR1_STOPF ((uint16_t)0x0010) /* Stop detection (Slave mode) */ +#define I2C_STAR1_RXNE ((uint16_t)0x0040) /* Data Register not Empty (receivers) */ +#define I2C_STAR1_TXE ((uint16_t)0x0080) /* Data Register Empty (transmitters) */ +#define I2C_STAR1_BERR ((uint16_t)0x0100) /* Bus Error */ +#define I2C_STAR1_ARLO ((uint16_t)0x0200) /* Arbitration Lost (master mode) */ +#define I2C_STAR1_AF ((uint16_t)0x0400) /* Acknowledge Failure */ +#define I2C_STAR1_OVR ((uint16_t)0x0800) /* Overrun/Underrun */ +#define I2C_STAR1_PECERR ((uint16_t)0x1000) /* PEC Error in reception */ +#define I2C_STAR1_TIMEOUT ((uint16_t)0x4000) /* Timeout or Tlow Error */ +#define I2C_STAR1_SMBALERT ((uint16_t)0x8000) /* SMBus Alert */ + +/******************* Bit definition for I2C_STAR2 register ********************/ +#define I2C_STAR2_MSL ((uint16_t)0x0001) /* Master/Slave */ +#define I2C_STAR2_BUSY ((uint16_t)0x0002) /* Bus Busy */ +#define I2C_STAR2_TRA ((uint16_t)0x0004) /* Transmitter/Receiver */ +#define I2C_STAR2_GENCALL ((uint16_t)0x0010) /* General Call Address (Slave mode) */ +#define I2C_STAR2_SMBDEFAULT ((uint16_t)0x0020) /* SMBus Device Default Address (Slave mode) */ +#define I2C_STAR2_SMBHOST ((uint16_t)0x0040) /* SMBus Host Header (Slave mode) */ +#define I2C_STAR2_DUALF ((uint16_t)0x0080) /* Dual Flag (Slave mode) */ +#define I2C_STAR2_PEC ((uint16_t)0xFF00) /* Packet Error Checking Register */ + +/******************* Bit definition for I2C_CKCFGR register ********************/ +#define I2C_CKCFGR_CCR ((uint16_t)0x0FFF) /* Clock Control Register in Fast/Standard mode (Master mode) */ +#define I2C_CKCFGR_DUTY ((uint16_t)0x4000) /* Fast Mode Duty Cycle */ +#define I2C_CKCFGR_FS ((uint16_t)0x8000) /* I2C Master Mode Selection */ + +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +/****************** Bit definition for I2C_RTR register *******************/ +#define I2C_RTR_TRISE ((uint8_t)0x3F) /* Maximum Rise Time in Fast/Standard mode (Master mode) */ +#endif + +/******************************************************************************/ +/* Power Control */ +/******************************************************************************/ + +/******************** Bit definition for PWR_CTLR register ********************/ +#define PWR_CTLR_LPDS ((uint16_t)0x0001) /* Low-Power Deepsleep */ +#define PWR_CTLR_PDDS ((uint16_t)0x0002) /* Power Down Deepsleep */ +#define PWR_CTLR_CWUF ((uint16_t)0x0004) /* Clear Wakeup Flag */ +#define PWR_CTLR_CSBF ((uint16_t)0x0008) /* Clear Standby Flag */ +#define PWR_CTLR_PVDE ((uint16_t)0x0010) /* Power Voltage Detector Enable */ + +#define PWR_CTLR_PLS ((uint16_t)0x00E0) /* PLS[2:0] bits (PVD Level Selection) */ +#define PWR_CTLR_PLS_0 ((uint16_t)0x0020) /* Bit 0 */ +#define PWR_CTLR_PLS_1 ((uint16_t)0x0040) /* Bit 1 */ +#define PWR_CTLR_PLS_2 ((uint16_t)0x0080) /* Bit 2 */ + +#define PWR_CTLR_PLS_2V2 ((uint16_t)0x0000) /* PVD level 2.2V */ +#define PWR_CTLR_PLS_2V3 ((uint16_t)0x0020) /* PVD level 2.3V */ +#define PWR_CTLR_PLS_2V4 ((uint16_t)0x0040) /* PVD level 2.4V */ +#define PWR_CTLR_PLS_2V5 ((uint16_t)0x0060) /* PVD level 2.5V */ +#define PWR_CTLR_PLS_2V6 ((uint16_t)0x0080) /* PVD level 2.6V */ +#define PWR_CTLR_PLS_2V7 ((uint16_t)0x00A0) /* PVD level 2.7V */ +#define PWR_CTLR_PLS_2V8 ((uint16_t)0x00C0) /* PVD level 2.8V */ +#define PWR_CTLR_PLS_2V9 ((uint16_t)0x00E0) /* PVD level 2.9V */ + +#define PWR_CTLR_DBP ((uint16_t)0x0100) /* Disable Backup Domain write protection */ + +/******************* Bit definition for PWR_CSR register ********************/ +#define PWR_CSR_WUF ((uint16_t)0x0001) /* Wakeup Flag */ +#define PWR_CSR_SBF ((uint16_t)0x0002) /* Standby Flag */ +#define PWR_CSR_PVDO ((uint16_t)0x0004) /* PVD Output */ +#define PWR_CSR_EWUP ((uint16_t)0x0100) /* Enable WKUP pin */ + +/******************************************************************************/ +/* Reset and Clock Control */ +/******************************************************************************/ + +/******************** Bit definition for RCC_CTLR register ********************/ +#define RCC_HSION ((uint32_t)0x00000001) /* Internal High Speed clock enable */ +#define RCC_HSIRDY ((uint32_t)0x00000002) /* Internal High Speed clock ready flag */ +#define RCC_HSITRIM ((uint32_t)0x000000F8) /* Internal High Speed clock trimming */ +#define RCC_HSICAL ((uint32_t)0x0000FF00) /* Internal High Speed clock Calibration */ +#define RCC_HSEON ((uint32_t)0x00010000) /* External High Speed clock enable */ +#define RCC_HSERDY ((uint32_t)0x00020000) /* External High Speed clock ready flag */ +#define RCC_HSEBYP ((uint32_t)0x00040000) /* External High Speed clock Bypass */ +#define RCC_CSSON ((uint32_t)0x00080000) /* Clock Security System enable */ +#define RCC_PLLON ((uint32_t)0x01000000) /* PLL enable */ +#define RCC_PLLRDY ((uint32_t)0x02000000) /* PLL clock ready flag */ + +#if defined(CH32V30x) +/* for CH32V307 */ +#define RCC_PLL3RDY ((uint32_t)(1<<29)) +#define RCC_PLL3ON ((uint32_t)(1<<28)) +#define RCC_PLL2RDY ((uint32_t)(1<<27)) +#define RCC_PLL2ON ((uint32_t)(1<<26)) +#endif + +/******************* Bit definition for RCC_CFGR0 register *******************/ +#define RCC_SW ((uint32_t)0x00000003) /* SW[1:0] bits (System clock Switch) */ +#define RCC_SW_0 ((uint32_t)0x00000001) /* Bit 0 */ +#define RCC_SW_1 ((uint32_t)0x00000002) /* Bit 1 */ + +#define RCC_SW_HSI ((uint32_t)0x00000000) /* HSI selected as system clock */ +#define RCC_SW_HSE ((uint32_t)0x00000001) /* HSE selected as system clock */ +#define RCC_SW_PLL ((uint32_t)0x00000002) /* PLL selected as system clock */ + +#define RCC_SWS ((uint32_t)0x0000000C) /* SWS[1:0] bits (System Clock Switch Status) */ +#define RCC_SWS_0 ((uint32_t)0x00000004) /* Bit 0 */ +#define RCC_SWS_1 ((uint32_t)0x00000008) /* Bit 1 */ + +#define RCC_SWS_HSI ((uint32_t)0x00000000) /* HSI oscillator used as system clock */ +#define RCC_SWS_HSE ((uint32_t)0x00000004) /* HSE oscillator used as system clock */ +#define RCC_SWS_PLL ((uint32_t)0x00000008) /* PLL used as system clock */ + +#define RCC_HPRE ((uint32_t)0x000000F0) /* HPRE[3:0] bits (AHB prescaler) */ +#define RCC_HPRE_0 ((uint32_t)0x00000010) /* Bit 0 */ +#define RCC_HPRE_1 ((uint32_t)0x00000020) /* Bit 1 */ +#define RCC_HPRE_2 ((uint32_t)0x00000040) /* Bit 2 */ +#define RCC_HPRE_3 ((uint32_t)0x00000080) /* Bit 3 */ + +#if defined(CH32V003) || defined(CH32X03x) +#define RCC_HPRE_DIV1 ((uint32_t)0x00000000) /* SYSCLK not divided */ +#define RCC_HPRE_DIV2 ((uint32_t)0x00000010) /* SYSCLK divided by 2 */ +#define RCC_HPRE_DIV3 ((uint32_t)0x00000020) /* SYSCLK divided by 3 */ +#define RCC_HPRE_DIV4 ((uint32_t)0x00000030) /* SYSCLK divided by 4 */ +#define RCC_HPRE_DIV5 ((uint32_t)0x00000040) /* SYSCLK divided by 5 */ +#define RCC_HPRE_DIV6 ((uint32_t)0x00000050) /* SYSCLK divided by 6 */ +#define RCC_HPRE_DIV7 ((uint32_t)0x00000060) /* SYSCLK divided by 7 */ +#define RCC_HPRE_DIV8 ((uint32_t)0x00000070) /* SYSCLK divided by 8 */ +#define RCC_HPRE_DIV16 ((uint32_t)0x000000B0) /* SYSCLK divided by 16 */ +#define RCC_HPRE_DIV32 ((uint32_t)0x000000C0) /* SYSCLK divided by 32 */ +#define RCC_HPRE_DIV64 ((uint32_t)0x000000D0) /* SYSCLK divided by 64 */ +#define RCC_HPRE_DIV128 ((uint32_t)0x000000E0) /* SYSCLK divided by 128 */ +#define RCC_HPRE_DIV256 ((uint32_t)0x000000F0) /* SYSCLK divided by 256 */ +#elif defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +#define RCC_HPRE_DIV1 ((uint32_t)0x00000000) /* SYSCLK not divided */ +#define RCC_HPRE_DIV2 ((uint32_t)0x00000080) /* SYSCLK divided by 2 */ +#define RCC_HPRE_DIV4 ((uint32_t)0x00000090) /* SYSCLK divided by 4 */ +#define RCC_HPRE_DIV8 ((uint32_t)0x000000A0) /* SYSCLK divided by 8 */ +#define RCC_HPRE_DIV16 ((uint32_t)0x000000B0) /* SYSCLK divided by 16 */ +#define RCC_HPRE_DIV64 ((uint32_t)0x000000C0) /* SYSCLK divided by 64 */ +#define RCC_HPRE_DIV128 ((uint32_t)0x000000D0) /* SYSCLK divided by 128 */ +#define RCC_HPRE_DIV256 ((uint32_t)0x000000E0) /* SYSCLK divided by 256 */ +#define RCC_HPRE_DIV512 ((uint32_t)0x000000F0) /* SYSCLK divided by 512 */ +#endif + +#define RCC_PPRE1 ((uint32_t)0x00000700) /* PRE1[2:0] bits (APB1 prescaler) */ +#define RCC_PPRE1_0 ((uint32_t)0x00000100) /* Bit 0 */ +#define RCC_PPRE1_1 ((uint32_t)0x00000200) /* Bit 1 */ +#define RCC_PPRE1_2 ((uint32_t)0x00000400) /* Bit 2 */ + +#define RCC_PPRE1_DIV1 ((uint32_t)0x00000000) /* HCLK not divided */ +#define RCC_PPRE1_DIV2 ((uint32_t)0x00000400) /* HCLK divided by 2 */ +#define RCC_PPRE1_DIV4 ((uint32_t)0x00000500) /* HCLK divided by 4 */ +#define RCC_PPRE1_DIV8 ((uint32_t)0x00000600) /* HCLK divided by 8 */ +#define RCC_PPRE1_DIV16 ((uint32_t)0x00000700) /* HCLK divided by 16 */ + +#define RCC_PPRE2 ((uint32_t)0x00003800) /* PRE2[2:0] bits (APB2 prescaler) */ +#define RCC_PPRE2_0 ((uint32_t)0x00000800) /* Bit 0 */ +#define RCC_PPRE2_1 ((uint32_t)0x00001000) /* Bit 1 */ +#define RCC_PPRE2_2 ((uint32_t)0x00002000) /* Bit 2 */ + +#define RCC_PPRE2_DIV1 ((uint32_t)0x00000000) /* HCLK not divided */ +#define RCC_PPRE2_DIV2 ((uint32_t)0x00002000) /* HCLK divided by 2 */ +#define RCC_PPRE2_DIV4 ((uint32_t)0x00002800) /* HCLK divided by 4 */ +#define RCC_PPRE2_DIV8 ((uint32_t)0x00003000) /* HCLK divided by 8 */ +#define RCC_PPRE2_DIV16 ((uint32_t)0x00003800) /* HCLK divided by 16 */ + +#define RCC_ADCPRE ((uint32_t)0x0000C000) /* ADCPRE[1:0] bits (ADC prescaler) */ +#define RCC_ADCPRE_0 ((uint32_t)0x00004000) /* Bit 0 */ +#define RCC_ADCPRE_1 ((uint32_t)0x00008000) /* Bit 1 */ + +#define RCC_ADCPRE_DIV2 ((uint32_t)0x00000000) /* PCLK2 divided by 2 */ +#define RCC_ADCPRE_DIV4 ((uint32_t)0x00004000) /* PCLK2 divided by 4 */ +#define RCC_ADCPRE_DIV6 ((uint32_t)0x00008000) /* PCLK2 divided by 6 */ +#define RCC_ADCPRE_DIV8 ((uint32_t)0x0000C000) /* PCLK2 divided by 8 */ + +#define RCC_PLLSRC ((uint32_t)0x00010000) /* PLL entry clock source */ + +#define RCC_PLLXTPRE ((uint32_t)0x00020000) /* HSE divider for PLL entry */ + +#define RCC_PLLMULL ((uint32_t)0x003C0000) /* PLLMUL[3:0] bits (PLL multiplication factor) */ +#define RCC_PLLMULL_0 ((uint32_t)0x00040000) /* Bit 0 */ +#define RCC_PLLMULL_1 ((uint32_t)0x00080000) /* Bit 1 */ +#define RCC_PLLMULL_2 ((uint32_t)0x00100000) /* Bit 2 */ +#define RCC_PLLMULL_3 ((uint32_t)0x00200000) /* Bit 3 */ + +#ifdef CH32V003 +#define RCC_PLLSRC_HSI_Mul2 ((uint32_t)0x00000000) /* HSI clock*2 selected as PLL entry clock source */ +#define RCC_PLLSRC_HSE_Mul2 ((uint32_t)0x00010000) /* HSE clock*2 selected as PLL entry clock source */ +#elif defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) +#define RCC_PLLSRC_HSI_Div2 ((uint32_t)0x00000000) /* HSI clock divided by 2 selected as PLL entry clock source */ +#define RCC_PLLSRC_HSE ((uint32_t)0x00010000) /* HSE clock selected as PLL entry clock source */ +#endif + +#define RCC_PLLXTPRE_HSE ((uint32_t)0x00000000) /* HSE clock not divided for PLL entry */ +#define RCC_PLLXTPRE_HSE_Div2 ((uint32_t)0x00020000) /* HSE clock divided by 2 for PLL entry */ + +#define RCC_PLLMULL2 ((uint32_t)0x00000000) /* PLL input clock*2 */ +#define RCC_PLLMULL3 ((uint32_t)0x00040000) /* PLL input clock*3 */ +#define RCC_PLLMULL4 ((uint32_t)0x00080000) /* PLL input clock*4 */ +#define RCC_PLLMULL5 ((uint32_t)0x000C0000) /* PLL input clock*5 */ +#define RCC_PLLMULL6 ((uint32_t)0x00100000) /* PLL input clock*6 */ +#define RCC_PLLMULL7 ((uint32_t)0x00140000) /* PLL input clock*7 */ +#define RCC_PLLMULL8 ((uint32_t)0x00180000) /* PLL input clock*8 */ +#define RCC_PLLMULL9 ((uint32_t)0x001C0000) /* PLL input clock*9 */ +#define RCC_PLLMULL10 ((uint32_t)0x00200000) /* PLL input clock10 */ +#define RCC_PLLMULL11 ((uint32_t)0x00240000) /* PLL input clock*11 */ +#define RCC_PLLMULL12 ((uint32_t)0x00280000) /* PLL input clock*12 */ +#define RCC_PLLMULL13 ((uint32_t)0x002C0000) /* PLL input clock*13 */ +#define RCC_PLLMULL14 ((uint32_t)0x00300000) /* PLL input clock*14 */ +#define RCC_PLLMULL15 ((uint32_t)0x00340000) /* PLL input clock*15 */ +#define RCC_PLLMULL16 ((uint32_t)0x00380000) /* PLL input clock*16 */ +#if defined(CH32V20x) +#define RCC_PLLMULL18 ((uint32_t)0x003C0000) /* PLL input clock*18 */ +#endif + +#if defined(CH32V30x) + +/* for CH32V307 */ +#define RCC_PLLMULL18_EXTEN ((uint32_t)0x00000000) /* PLL input clock*18 */ +#define RCC_PLLMULL3_EXTEN ((uint32_t)0x00040000) /* PLL input clock*3 */ +#define RCC_PLLMULL4_EXTEN ((uint32_t)0x00080000) /* PLL input clock*4 */ +#define RCC_PLLMULL5_EXTEN ((uint32_t)0x000C0000) /* PLL input clock*5 */ +#define RCC_PLLMULL6_EXTEN ((uint32_t)0x00100000) /* PLL input clock*6 */ +#define RCC_PLLMULL7_EXTEN ((uint32_t)0x00140000) /* PLL input clock*7 */ +#define RCC_PLLMULL8_EXTEN ((uint32_t)0x00180000) /* PLL input clock*8 */ +#define RCC_PLLMULL9_EXTEN ((uint32_t)0x001C0000) /* PLL input clock*9 */ +#define RCC_PLLMULL10_EXTEN ((uint32_t)0x00200000) /* PLL input clock10 */ +#define RCC_PLLMULL11_EXTEN ((uint32_t)0x00240000) /* PLL input clock*11 */ +#define RCC_PLLMULL12_EXTEN ((uint32_t)0x00280000) /* PLL input clock*12 */ +#define RCC_PLLMULL13_EXTEN ((uint32_t)0x002C0000) /* PLL input clock*13 */ +#define RCC_PLLMULL14_EXTEN ((uint32_t)0x00300000) /* PLL input clock*14 */ +#define RCC_PLLMULL6_5_EXTEN ((uint32_t)0x00340000) /* PLL input clock*6.5 */ +#define RCC_PLLMULL15_EXTEN ((uint32_t)0x00380000) /* PLL input clock*15 */ +#define RCC_PLLMULL16_EXTEN ((uint32_t)0x003C0000) /* PLL input clock*16 */ +#endif + +#define RCC_USBPRE ((uint32_t)0x00400000) /* USB Device prescaler */ + +#define RCC_CFGR0_MCO ((uint32_t)0x07000000) /* MCO[2:0] bits (Microcontroller Clock Output) */ +#define RCC_MCO_0 ((uint32_t)0x01000000) /* Bit 0 */ +#define RCC_MCO_1 ((uint32_t)0x02000000) /* Bit 1 */ +#define RCC_MCO_2 ((uint32_t)0x04000000) /* Bit 2 */ + +#define RCC_MCO_NOCLOCK ((uint32_t)0x00000000) /* No clock */ +#define RCC_CFGR0_MCO_SYSCLK ((uint32_t)0x04000000) /* System clock selected as MCO source */ +#define RCC_CFGR0_MCO_HSI ((uint32_t)0x05000000) /* HSI clock selected as MCO source */ +#define RCC_CFGR0_MCO_HSE ((uint32_t)0x06000000) /* HSE clock selected as MCO source */ +#define RCC_CFGR0_MCO_PLL ((uint32_t)0x07000000) /* PLL clock divided by 2 selected as MCO source */ + +/******************* Bit definition for RCC_CFGR2 register *******************/ +#ifdef CH32V30x +#define RCC_PREDIV1_OFFSET (0) +#define RCC_PREDIV1_MASK ((uint32_t)(0xf<= 0 && (IMM) < 32); .2byte ((OP) | (REG2I(R1) << 2) | (REG2I(R2) << 7) | \ + (((IMM) & 0b1) << 12) | (((IMM) & 0b110) << (5 - 1)) | (((IMM) & 0b11000) << (10 - 3))) + +#define XW_ENCODE2(OP, R1, R2, IMM) ASM_ASSERT((IMM) >= 0 && (IMM) < 32); .2byte ((OP) | (REG2I(R1) << 2) | (REG2I(R2) << 7) | \ + (((IMM) & 0b11) << 5) | (((IMM) & 0b11100) << (10 - 2)) + +// Compressed load byte, zero-extend result +#define XW_C_LBU(RD, RS, IMM) XW_ENCODE1(XW_OP_LBU, RD, RS, IMM) + +// Compressed store byte +#define XW_C_SB(RS1, RS2, IMM) XW_ENCODE1(XW_OP_SB, RS1, RS2, IMM) + +// Compressed load half, zero-extend result +#define XW_C_LHU(RD, RS, IMM) ASM_ASSERT(((IMM) & 1) == 0); XW_ENCODE2(XW_OP_LHU, RD, RS, ((IMM) >> 1))) + +// Compressed store half +#define XW_C_SH(RS1, RS2, IMM) ASM_ASSERT(((IMM) & 1) == 0); XW_ENCODE2(XW_OP_SH, RS1, RS2, ((IMM) >> 1))) + +#endif // CH32V003 + + +// Applies to all processors + + +/* memory mapped structure for Program Fast Interrupt Controller (PFIC) */ +typedef struct{ + __I uint32_t ISR[8]; + __I uint32_t IPR[8]; + __IO uint32_t ITHRESDR; + __IO uint32_t RESERVED; + __IO uint32_t CFGR; + __I uint32_t GISR; + __IO uint8_t VTFIDR[4]; + uint8_t RESERVED0[12]; + __IO uint32_t VTFADDR[4]; + uint8_t RESERVED1[0x90]; + __O uint32_t IENR[8]; + uint8_t RESERVED2[0x60]; + __O uint32_t IRER[8]; + uint8_t RESERVED3[0x60]; + __O uint32_t IPSR[8]; + uint8_t RESERVED4[0x60]; + __O uint32_t IPRR[8]; + uint8_t RESERVED5[0x60]; + __IO uint32_t IACTR[8]; + uint8_t RESERVED6[0xE0]; + __IO uint8_t IPRIOR[256]; + uint8_t RESERVED7[0x810]; + __IO uint32_t SCTLR; +}PFIC_Type; + + +/* some bit definitions for systick regs */ +#define SYSTICK_SR_CNTIF (1<<0) +#define SYSTICK_CTLR_STE (1<<0) +#define SYSTICK_CTLR_STIE (1<<1) +#define SYSTICK_CTLR_STCLK (1<<2) +#define SYSTICK_CTLR_STRE (1<<3) +#define SYSTICK_CTLR_SWIE (1<<31) + +#define PFIC ((PFIC_Type *) PFIC_BASE ) +#define NVIC PFIC +#define NVIC_KEY1 ((uint32_t)0xFA050000) +#define NVIC_KEY2 ((uint32_t)0xBCAF0000) +#define NVIC_KEY3 ((uint32_t)0xBEEF0000) + + +#define SysTick ((SysTick_Type *) SysTick_BASE) + + +#define PA1 1 +#define PA2 2 +#define PC0 32 +#define PC1 33 +#define PC2 34 +#define PC3 35 +#define PC4 36 +#define PC5 37 +#define PC6 38 +#define PC7 39 +#define PD0 48 +#define PD1 49 +#define PD2 50 +#define PD3 51 +#define PD4 52 +#define PD5 53 +#define PD6 54 +#define PD7 55 + +#if defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) || defined(CH32X03x) +#define PA0 0 +#define PA3 3 +#define PA4 4 +#define PA5 5 +#define PA6 6 +#define PA7 7 +#define PA8 8 +#define PA9 9 +#define PA10 10 +#define PA11 11 +#define PA12 12 +#define PA13 13 +#define PA14 14 +#define PA15 15 +#define PB0 16 +#define PB1 17 +#define PB2 18 +#define PB3 19 +#define PB4 20 +#define PB5 21 +#define PB6 22 +#define PB7 23 +#define PB8 24 +#define PB9 25 +#define PB10 26 +#define PB11 27 +#define PB12 28 +#define PB13 29 +#define PB14 30 +#define PB15 31 +#define PC8 40 +#define PC9 41 +#define PC10 42 +#define PC11 43 +#define PC12 44 +#define PC13 45 +#define PC14 46 +#define PC15 47 +#define PD8 56 +#define PD9 57 +#define PD10 58 +#define PD11 59 +#define PD12 60 +#define PD13 61 +#define PD14 62 +#define PD15 63 +#endif // defined(CH32V10x) || defined(CH32V20x) || defined(CH32V30x) || defined(CH32X03x) + +/* + * This file contains various parts of the official WCH EVT Headers which + * were originally under a restrictive license. + * + * The collection of this file was generated by + * cnlohr, 2023-02-18 and + * AlexanderMandera, 2023-06-23 + * It was significantly reworked into several files cnlohr, 2025-01-29 + * + * While originally under a restrictive copyright, WCH has approved use + * under MIT-licensed use, because of inclusion in Zephyr, as well as other + * open-source licensed projects. + * + * These copies of the headers from WCH are available now under: + * + * Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the “Softwareâ€), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED “AS ISâ€, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#endif // Header guard diff --git a/src/misc/attic/temp_transition_helper.c b/src/misc/attic/temp_transition_helper.c new file mode 100644 index 0000000..a05b193 --- /dev/null +++ b/src/misc/attic/temp_transition_helper.c @@ -0,0 +1,226 @@ +#include +#include +#include +#include + +const char * yes[] = { "SENTINEL_WILL_BE_REPLACED_BY_CMDLINE" }; // "CH32X03x", etc. element 0 is filled in by command-line +const char * no[] = { "CH32V10x", "CH32V30x", "CH32V20x", "CH32X03x", "CH32V003" }; + +char * WhitePull( const char ** sti ) +{ + const char * st = *sti; + int len = 0; + while( ( *st == ' ' || *st == '\t' || *st == '(' ) && *st ) { st++; } + const char * sts = st; + while( *st != ' ' && *st != '\t' && *st != '\n' && *st != ')' && *st != '(' && *st != 0 ) { st++; len++; } + if( *st == ')' ) { st++; } + char * ret = malloc( len + 1 ); + memcpy( ret, sts, len ); + ret[len] = 0; + *sti = st; + return ret; +} + +int NYI( const char * s ) +{ + int ret = 2; + char * wp = WhitePull( &s ); + int i; + for( i = 0; i < sizeof(yes)/sizeof(yes[0]); i++ ) + if( strcmp( yes[i], wp ) == 0 ) ret = 1; + if( ret != 1 ) + for( i = 0; i < sizeof(no)/sizeof(no[0]); i++ ) + if( strcmp( no[i], wp ) == 0 ) ret = 0; + free( wp ); + return ret; +} + +int EvalSpec( const char * spl ) +{ + int rsofar = 0; + int i; + int lastv = 0; + int lasto = -1; + int ret = 0; +cont: + char * wp = WhitePull( &spl ); + int def = -1; + if( strcmp( wp, "defined" ) == 0 ) def = 1; + if( strcmp( wp, "!defined" ) == 0 ) def = 2; + if( def < 0 ) return 2; + char * wpn = WhitePull( &spl ); + i = NYI( wpn ); +//printf( "SPIN: %s/%s/%d/%d/%d\n", wp, wpn, i, def, lasto ); + if( i == 2 ) return 2; + + if( def == 2 ) i = !i; + + if( lasto == 1 ) + { + ret = lastv || i; + } + else if( lasto == 2 ) + ret = lastv && i; + else + ret = i; + + char * wpa = WhitePull( &spl ); +//printf( "WPA: \"%s\"\n", wpa ); + lastv = ret; + lasto = -1; +//printf( "RET: %d\n", ret ); + if( strcmp( wpa, "||" ) == 0 ) { lasto = 1; goto cont; } + else if( strcmp( wpa, "&&" ) == 0 ) { lasto = 2; goto cont; } + else return ret; +} + +// 0 for no +// 1 for yes +// 2 for indeterminate +int NoYesInd( const char * preprocc ) +{ + int ret; + int ofs = 0; + if( strncmp( preprocc, "#if ", 4 ) == 0 ) ofs = 4; + if( strncmp( preprocc, "#elif ", 6 ) == 0 ) ofs = 6; + if( ofs ) + { + ret = EvalSpec( preprocc + ofs ); + //printf( "SPEC: %d\n", ret ); + } + else if( strncmp( preprocc, "#ifdef ", 7 ) == 0 ) + { + const char * ep = preprocc + 6; + char * wp = WhitePull( &ep ); + ret = NYI( wp ); + free( wp ); + } + else if( strncmp( preprocc, "#ifndef ", 8 ) == 0 ) + { + const char * ep = preprocc + 6; + char * wp = WhitePull( &ep ); + ret = NYI( wp ); + if( ret < 2 ) ret = !ret; + free( wp ); + } + else + ret = 2; + //printf( "%d-> %s\n", ret, preprocc ); + return ret; +} + +const char * sslineis( const char * line, const char * match ) +{ + while( *line == ' ' || *line == '\t' ) line++; + const char * linestart = line; + while( *line && *match == *line ) { line++; match++; } + if( *match == 0 ) + return linestart; + else + return 0; +} + +int main( int argc, char ** argv ) +{ + if( argc != 3 ) + { + fprintf( stderr, "Syntax: transition [#define to trigger on] [file to convert]\nNo'd architectures:\n" ); + int i; + for( i = 0; i < sizeof(no)/sizeof(no[0]); i++ ) + { + fprintf( stderr, "\t%s\n", no[i] ); + } + return -1; + } + + yes[0] = argv[1]; + + FILE * f = fopen( argv[2], "r" ); + if( !f ) + { + fprintf( stderr, "Error: Could not open \"%s\"\n", argv[2] ); + return -2; + } + char line[1024]; + char * l; + + + int depth = 0; + + // 0 = no + // 1 = yes + // 2 = indeterminate + // 3 = super no. (I.e. after a true #if clause) + int yesnoind[1024]; + yesnoind[0] = 1; + + while( l = fgets( line, sizeof(line)-1, f ) ) + { + const char * ss = 0; + int nyi = yesnoind[depth]; + int waspre = 0; + + if( (ss = sslineis( line, "#if " ) ) || (ss = sslineis( line, "#ifdef " ) ) || (ss = sslineis( line, "#ifndef " ) ) ) + { + waspre = 1; + //printf( "CHECK: %d/%s\n", depth, l ); + nyi = NoYesInd( ss ); + depth++; + yesnoind[depth] = nyi; + } + else if( (ss = sslineis( line, "#elif " ) ) ) + { + if( nyi != 2 ) + { + waspre = 1; + if( nyi == 1 ) + { + nyi = 3; + } + else + { + nyi = NoYesInd( ss ); + } + //printf( "ELIF check: %s %d\n", ss, nyi ); + yesnoind[depth] = nyi; + } + } + else if( (ss = sslineis( line, "#else" ) ) ) + { + if( nyi != 2 ) + { + waspre = 1; + if( yesnoind[depth] == 1 ) + nyi = 3; + else + nyi = !yesnoind[depth]; + yesnoind[depth] = nyi; + } + } + else if( (ss = sslineis( line, "#endif" ) ) ) + { + waspre = 1; + depth--; + if( depth < 0 ) + { + fprintf( stderr, "UNTERMD IF\n" ); + } + } + + int thisv = nyi; + int i; + for( i = 0; i <= depth; i++ ) + { + //printf( "%d", yesnoind[i] ); + if( yesnoind[i] == 0 || yesnoind[i] == 3 ) thisv = 0; + } + //printf( ">>%s", l ); + + if( thisv != 0 && thisv != 3 && ( thisv != 1 || !waspre ) ) + { + printf( "%s", l ); + } + } +} + + diff --git a/src/misc/drivers_for_WCH-LinkE/R0-1v3/README.txt b/src/misc/drivers_for_WCH-LinkE/R0-1v3/README.txt new file mode 100644 index 0000000..312ef5b --- /dev/null +++ b/src/misc/drivers_for_WCH-LinkE/R0-1v3/README.txt @@ -0,0 +1,11 @@ +This only works for the WCH LinkE in RISC-V mode. If your programmer has the BLUE light ON shortly after boot your programmer is in ARM mode. + +Please follow instructions here to convert your programmer to RISC-V mode from ARM mode. + +Basically press-and-hold the ModeS button while plugging in the USB. + +Once powered, it will store that to default. + +The blue light should be OFF. + +Once you are in RISC-V mode, you can install this driver by right-clicking on the driver and saying install. diff --git a/src/misc/drivers_for_WCH-LinkE/R0-1v3/WCH-Link_(Interface_0).cat b/src/misc/drivers_for_WCH-LinkE/R0-1v3/WCH-Link_(Interface_0).cat new file mode 100644 index 0000000..53493be Binary files /dev/null and b/src/misc/drivers_for_WCH-LinkE/R0-1v3/WCH-Link_(Interface_0).cat differ diff --git a/src/misc/drivers_for_WCH-LinkE/R0-1v3/WCH-Link_(Interface_0).inf b/src/misc/drivers_for_WCH-LinkE/R0-1v3/WCH-Link_(Interface_0).inf new file mode 100644 index 0000000..9628faa Binary files /dev/null and b/src/misc/drivers_for_WCH-LinkE/R0-1v3/WCH-Link_(Interface_0).inf differ diff --git a/src/misc/dumped_libgcc.S b/src/misc/dumped_libgcc.S new file mode 100644 index 0000000..6513e16 --- /dev/null +++ b/src/misc/dumped_libgcc.S @@ -0,0 +1,44121 @@ +In archive ./libgcc.a: + +_negdi2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__negdi2>: + 0: 00a037b3 snez a5,a0 + 4: 40b005b3 neg a1,a1 + 8: 40a00533 neg a0,a0 + +0000000c <.LVL1>: + c: 8d9d sub a1,a1,a5 + e: 8082 ret + +_lshrdi3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__lshrdi3>: + 0: ca19 beqz a2,16 <.L2> + 2: 02000793 li a5,32 + 6: 8f91 sub a5,a5,a2 + +00000008 <.LVL1>: + 8: 00f04863 bgtz a5,18 <.L3> + c: 1601 add a2,a2,-32 + +0000000e <.LVL2>: + e: 00c5d533 srl a0,a1,a2 + +00000012 <.LVL3>: + 12: 4701 li a4,0 + +00000014 <.L4>: + 14: 85ba mv a1,a4 + +00000016 <.L2>: + 16: 8082 ret + +00000018 <.L3>: + 18: 00c5d733 srl a4,a1,a2 + 1c: 00c55533 srl a0,a0,a2 + +00000020 <.LVL7>: + 20: 00f595b3 sll a1,a1,a5 + +00000024 <.LVL8>: + 24: 8d4d or a0,a0,a1 + 26: b7fd j 14 <.L4> + +_ashldi3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__ashldi3>: + 0: ca19 beqz a2,16 <.L2> + 2: 02000793 li a5,32 + 6: 8f91 sub a5,a5,a2 + +00000008 <.LVL1>: + 8: 00f04863 bgtz a5,18 <.L3> + c: 1601 add a2,a2,-32 + +0000000e <.LVL2>: + e: 00c515b3 sll a1,a0,a2 + 12: 4701 li a4,0 + +00000014 <.L4>: + 14: 853a mv a0,a4 + +00000016 <.L2>: + 16: 8082 ret + +00000018 <.L3>: + 18: 00c595b3 sll a1,a1,a2 + 1c: 00f557b3 srl a5,a0,a5 + +00000020 <.LVL6>: + 20: 00c51733 sll a4,a0,a2 + 24: 8ddd or a1,a1,a5 + 26: b7fd j 14 <.L4> + +_ashrdi3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__ashrdi3>: + 0: ce01 beqz a2,18 <.L2> + 2: 02000793 li a5,32 + 6: 8f91 sub a5,a5,a2 + +00000008 <.LVL1>: + 8: 00f04963 bgtz a5,1a <.L3> + c: 1601 add a2,a2,-32 + +0000000e <.LVL2>: + e: 41f5d713 sra a4,a1,0x1f + 12: 40c5d533 sra a0,a1,a2 + +00000016 <.L4>: + 16: 85ba mv a1,a4 + +00000018 <.L2>: + 18: 8082 ret + +0000001a <.L3>: + 1a: 40c5d733 sra a4,a1,a2 + 1e: 00c55533 srl a0,a0,a2 + +00000022 <.LVL6>: + 22: 00f595b3 sll a1,a1,a5 + +00000026 <.LVL7>: + 26: 8d4d or a0,a0,a1 + 28: b7fd j 16 <.L4> + +_cmpdi2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__cmpdi2>: + 0: 4785 li a5,1 + 2: 00b6c763 blt a3,a1,10 <.L2> + 6: 00d59463 bne a1,a3,e <.L3> + a: 00a66363 bltu a2,a0,10 <.L2> + +0000000e <.L3>: + e: 4781 li a5,0 + +00000010 <.L2>: + 10: 4705 li a4,1 + 12: 00d5c763 blt a1,a3,20 <.L4> + 16: 00b69463 bne a3,a1,1e <.L5> + 1a: 00c56363 bltu a0,a2,20 <.L4> + +0000001e <.L5>: + 1e: 4701 li a4,0 + +00000020 <.L4>: + 20: 40e78533 sub a0,a5,a4 + +00000024 <.LVL1>: + 24: 0505 add a0,a0,1 + 26: 8082 ret + +_ucmpdi2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__ucmpdi2>: + 0: 4785 li a5,1 + 2: 00b6e763 bltu a3,a1,10 <.L2> + 6: 00d59463 bne a1,a3,e <.L3> + a: 00a66363 bltu a2,a0,10 <.L2> + +0000000e <.L3>: + e: 4781 li a5,0 + +00000010 <.L2>: + 10: 4705 li a4,1 + 12: 00d5e763 bltu a1,a3,20 <.L4> + 16: 00b69463 bne a3,a1,1e <.L5> + 1a: 00c56363 bltu a0,a2,20 <.L4> + +0000001e <.L5>: + 1e: 4701 li a4,0 + +00000020 <.L4>: + 20: 40e78533 sub a0,a5,a4 + +00000024 <.LVL1>: + 24: 0505 add a0,a0,1 + 26: 8082 ret + +_clear_cache.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__clear_cache>: + 0: 8082 ret + +_trampoline.o: file format elf32-littleriscv + + +__main.o: file format elf32-littleriscv + + +_absvsi2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__absvsi2>: + 0: 41f55713 sra a4,a0,0x1f + +00000004 <.LVL1>: + 4: 00e506b3 add a3,a0,a4 + 8: 00072613 slti a2,a4,0 + c: 00a6a7b3 slt a5,a3,a0 + 10: 00f60863 beq a2,a5,20 <.L6> + 14: 1151 add sp,sp,-12 + 16: c406 sw ra,8(sp) + 18: 00000097 auipc ra,0x0 + 1c: 000080e7 jalr ra # 18 <.LVL1+0x14> + +00000020 <.L6>: + 20: 00e6c533 xor a0,a3,a4 + +00000024 <.LVL3>: + 24: 8082 ret + +_absvdi2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__absvdi2>: + 0: 41f5d613 sra a2,a1,0x1f + +00000004 <.LVL1>: + 4: 9532 add a0,a0,a2 + +00000006 <.LVL2>: + 6: 00c537b3 sltu a5,a0,a2 + a: 00b60733 add a4,a2,a1 + e: 973e add a4,a4,a5 + +00000010 <.LVL3>: + 10: 00b64333 xor t1,a2,a1 + 14: 00b747b3 xor a5,a4,a1 + 18: fff34593 not a1,t1 + 1c: 8fed and a5,a5,a1 + 1e: 0007d863 bgez a5,2e <.L5> + 22: 1151 add sp,sp,-12 + 24: c406 sw ra,8(sp) + 26: 00000097 auipc ra,0x0 + 2a: 000080e7 jalr ra # 26 <.LVL3+0x16> + +0000002e <.L5>: + 2e: 8d31 xor a0,a0,a2 + +00000030 <.LVL5>: + 30: 00c745b3 xor a1,a4,a2 + 34: 8082 ret + +_addvsi3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__addvsi3>: + 0: 87aa mv a5,a0 + 2: 952e add a0,a0,a1 + +00000004 <.LVL1>: + 4: 00f527b3 slt a5,a0,a5 + +00000008 <.LVL2>: + 8: 0005a593 slti a1,a1,0 + +0000000c <.LVL3>: + c: 00f58863 beq a1,a5,1c <.L6> + 10: 1151 add sp,sp,-12 + 12: c406 sw ra,8(sp) + 14: 00000097 auipc ra,0x0 + 18: 000080e7 jalr ra # 14 <.LVL3+0x8> + +0000001c <.L6>: + 1c: 8082 ret + +_addvdi3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__addvdi3>: + 0: 872a mv a4,a0 + 2: 9532 add a0,a0,a2 + +00000004 <.LVL1>: + 4: 87ae mv a5,a1 + 6: 00e53733 sltu a4,a0,a4 + a: 95b6 add a1,a1,a3 + c: 8fb5 xor a5,a5,a3 + e: 95ba add a1,a1,a4 + +00000010 <.LVL2>: + 10: 8ead xor a3,a3,a1 + 12: fff7c793 not a5,a5 + 16: 8efd and a3,a3,a5 + 18: 0006d863 bgez a3,28 <.L1> + 1c: 1151 add sp,sp,-12 + 1e: c406 sw ra,8(sp) + 20: 00000097 auipc ra,0x0 + 24: 000080e7 jalr ra # 20 <.LVL2+0x10> + +00000028 <.L1>: + 28: 8082 ret + +_subvsi3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__subvsi3>: + 0: 87aa mv a5,a0 + 2: 8d0d sub a0,a0,a1 + +00000004 <.LVL1>: + 4: 00a7a7b3 slt a5,a5,a0 + +00000008 <.LVL2>: + 8: 0005a593 slti a1,a1,0 + +0000000c <.LVL3>: + c: 00f58863 beq a1,a5,1c <.L6> + 10: 1151 add sp,sp,-12 + 12: c406 sw ra,8(sp) + 14: 00000097 auipc ra,0x0 + 18: 000080e7 jalr ra # 14 <.LVL3+0x8> + +0000001c <.L6>: + 1c: 8082 ret + +_subvdi3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__subvdi3>: + 0: 872a mv a4,a0 + 2: 8d11 sub a0,a0,a2 + +00000004 <.LVL1>: + 4: 87ae mv a5,a1 + 6: 00a73733 sltu a4,a4,a0 + a: 8d95 sub a1,a1,a3 + c: 8d99 sub a1,a1,a4 + +0000000e <.LVL2>: + e: 8fb5 xor a5,a5,a3 + 10: 8ead xor a3,a3,a1 + 12: fff6c693 not a3,a3 + 16: 8ff5 and a5,a5,a3 + 18: 0007d863 bgez a5,28 <.L1> + 1c: 1151 add sp,sp,-12 + 1e: c406 sw ra,8(sp) + 20: 00000097 auipc ra,0x0 + 24: 000080e7 jalr ra # 20 <.LVL2+0x12> + +00000028 <.L1>: + 28: 8082 ret + +_mulvsi3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__mulvsi3>: + 0: 1121 add sp,sp,-24 + 2: 01051393 sll t2,a0,0x10 + 6: ca06 sw ra,20(sp) + 8: 4103d393 sra t2,t2,0x10 + c: 01059093 sll ra,a1,0x10 + 10: 40f3d293 sra t0,t2,0xf + 14: 4100d093 sra ra,ra,0x10 + 18: 40f0d313 sra t1,ra,0xf + 1c: 02c2 sll t0,t0,0x10 + 1e: c626 sw s1,12(sp) + 20: 0342 sll t1,t1,0x10 + 22: c822 sw s0,16(sp) + 24: 0102d293 srl t0,t0,0x10 + 28: 01055693 srl a3,a0,0x10 + 2c: 87aa mv a5,a0 + 2e: 872e mv a4,a1 + 30: 4105d613 sra a2,a1,0x10 + 34: 01035313 srl t1,t1,0x10 + 38: 0105d493 srl s1,a1,0x10 + 3c: 08d29c63 bne t0,a3,d4 <.L4> + 40: 00931d63 bne t1,s1,5a <.L5> + 44: 8586 mv a1,ra + +00000046 <.LVL1>: + 46: 851e mv a0,t2 + +00000048 <.LVL2>: + 48: 00000097 auipc ra,0x0 + 4c: 000080e7 jalr ra # 48 <.LVL2> + +00000050 <.L1>: + 50: 40d2 lw ra,20(sp) + 52: 4442 lw s0,16(sp) + 54: 44b2 lw s1,12(sp) + 56: 0161 add sp,sp,24 + 58: 8082 ret + +0000005a <.L5>: + 5a: 86ae mv a3,a1 + 5c: 8432 mv s0,a2 + 5e: 84aa mv s1,a0 + +00000060 <.L6>: + 60: 01079513 sll a0,a5,0x10 + +00000064 <.LVL5>: + 64: 01071593 sll a1,a4,0x10 + +00000068 <.LVL6>: + 68: 81c1 srl a1,a1,0x10 + 6a: 8141 srl a0,a0,0x10 + 6c: c436 sw a3,8(sp) + 6e: 00000097 auipc ra,0x0 + 72: 000080e7 jalr ra # 6e <.LVL6+0x6> + +00000076 <.LVL7>: + 76: 01049713 sll a4,s1,0x10 + 7a: 8341 srl a4,a4,0x10 + 7c: 01041593 sll a1,s0,0x10 + 80: c22a sw a0,4(sp) + 82: 81c1 srl a1,a1,0x10 + 84: 853a mv a0,a4 + 86: c03a sw a4,0(sp) + 88: 00000097 auipc ra,0x0 + 8c: 000080e7 jalr ra # 88 <.LVL7+0x12> + +00000090 <.LVL8>: + 90: 01041793 sll a5,s0,0x10 + 94: 4612 lw a2,4(sp) + 96: 46a2 lw a3,8(sp) + 98: 0007d663 bgez a5,a4 <.L8> + 9c: 4702 lw a4,0(sp) + 9e: 01071413 sll s0,a4,0x10 + a2: 8d01 sub a0,a0,s0 + +000000a4 <.L8>: + a4: 01049793 sll a5,s1,0x10 + a8: 0007d363 bgez a5,ae <.L9> + ac: 8d15 sub a0,a0,a3 + +000000ae <.L9>: + ae: 01065793 srl a5,a2,0x10 + b2: 953e add a0,a0,a5 + b4: 01051793 sll a5,a0,0x10 + b8: 87c1 sra a5,a5,0x10 + ba: 87bd sra a5,a5,0xf + bc: 07c2 sll a5,a5,0x10 + be: 83c1 srl a5,a5,0x10 + c0: 01055713 srl a4,a0,0x10 + c4: 04e79863 bne a5,a4,114 <.L13> + c8: 01061493 sll s1,a2,0x10 + cc: 0542 sll a0,a0,0x10 + ce: 80c1 srl s1,s1,0x10 + d0: 8d45 or a0,a0,s1 + d2: bfbd j 50 <.L1> + +000000d4 <.L4>: + d4: 41055413 sra s0,a0,0x10 + d8: 00931563 bne t1,s1,e2 <.L7> + dc: 86aa mv a3,a0 + de: 84ae mv s1,a1 + e0: b741 j 60 <.L6> + +000000e2 <.L7>: + e2: c236 sw a3,4(sp) + e4: c032 sw a2,0(sp) + e6: 0405 add s0,s0,1 + e8: 00000097 auipc ra,0x0 + ec: 000080e7 jalr ra # e8 <.L7+0x6> + +000000f0 <.LVL10>: + f0: 01041793 sll a5,s0,0x10 + f4: 83c1 srl a5,a5,0x10 + f6: 4705 li a4,1 + f8: 00f76e63 bltu a4,a5,114 <.L13> + fc: 4602 lw a2,0(sp) + fe: 00160413 add s0,a2,1 + 102: 0442 sll s0,s0,0x10 + 104: 8041 srl s0,s0,0x10 + 106: 00876763 bltu a4,s0,114 <.L13> + 10a: 4692 lw a3,4(sp) + 10c: 00969863 bne a3,s1,11c <.L11> + 110: f4a040e3 bgtz a0,50 <.L1> + +00000114 <.L13>: + 114: 00000097 auipc ra,0x0 + 118: 000080e7 jalr ra # 114 <.L13> + +0000011c <.L11>: + 11c: f2054ae3 bltz a0,50 <.L1> + 120: bfd5 j 114 <.L13> + +_mulvdi3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__mulvdi3>: + 0: 1121 add sp,sp,-24 + 2: c822 sw s0,16(sp) + 4: c626 sw s1,12(sp) + 6: ca06 sw ra,20(sp) + 8: 41f55713 sra a4,a0,0x1f + c: 84aa mv s1,a0 + e: 8432 mv s0,a2 + 10: 41f65793 sra a5,a2,0x1f + 14: 08b71163 bne a4,a1,96 <.L2> + 18: 00d79b63 bne a5,a3,2e <.L3> + 1c: 00000097 auipc ra,0x0 + 20: 000080e7 jalr ra # 1c <__mulvdi3+0x1c> + +00000024 <.L1>: + 24: 40d2 lw ra,20(sp) + 26: 4442 lw s0,16(sp) + 28: 44b2 lw s1,12(sp) + 2a: 0161 add sp,sp,24 + 2c: 8082 ret + +0000002e <.L3>: + 2e: 862a mv a2,a0 + +00000030 <.LVL3>: + 30: c036 sw a3,0(sp) + 32: 8522 mv a0,s0 + +00000034 <.LVL4>: + 34: 4681 li a3,0 + 36: 4581 li a1,0 + 38: 00000097 auipc ra,0x0 + 3c: 000080e7 jalr ra # 38 <.LVL4+0x4> + +00000040 <.LVL5>: + 40: 4302 lw t1,0(sp) + 42: c42a sw a0,8(sp) + 44: c22e sw a1,4(sp) + 46: 8626 mv a2,s1 + 48: 4681 li a3,0 + 4a: 851a mv a0,t1 + 4c: 4581 li a1,0 + 4e: 00000097 auipc ra,0x0 + 52: 000080e7 jalr ra # 4e <.LVL5+0xe> + +00000056 <.LVL6>: + 56: 4302 lw t1,0(sp) + 58: 4792 lw a5,4(sp) + 5a: 4722 lw a4,8(sp) + 5c: 86aa mv a3,a0 + 5e: 862e mv a2,a1 + 60: 00035463 bgez t1,68 <.L5> + 64: 40958633 sub a2,a1,s1 + +00000068 <.L5>: + 68: 0004d963 bgez s1,7a <.L11> + 6c: 408506b3 sub a3,a0,s0 + 70: 00d53533 sltu a0,a0,a3 + 74: 40660633 sub a2,a2,t1 + +00000078 <.L30>: + 78: 8e09 sub a2,a2,a0 + +0000007a <.L11>: + 7a: 00f685b3 add a1,a3,a5 + 7e: 00d5b6b3 sltu a3,a1,a3 + 82: 96b2 add a3,a3,a2 + 84: 41f5d793 sra a5,a1,0x1f + 88: 853a mv a0,a4 + 8a: f8d78de3 beq a5,a3,24 <.L1> + +0000008e <.L8>: + 8e: 00000097 auipc ra,0x0 + 92: 000080e7 jalr ra # 8e <.L8> + +00000096 <.L2>: + 96: 04d79663 bne a5,a3,e2 <.L9> + 9a: c02e sw a1,0(sp) + +0000009c <.LBB4>: + 9c: 4681 li a3,0 + 9e: 4581 li a1,0 + a0: 00000097 auipc ra,0x0 + a4: 000080e7 jalr ra # a0 <.LBB4+0x4> + +000000a8 <.LVL9>: + a8: 4282 lw t0,0(sp) + aa: c42a sw a0,8(sp) + ac: c22e sw a1,4(sp) + ae: 8622 mv a2,s0 + b0: 4681 li a3,0 + b2: 8516 mv a0,t0 + b4: 4581 li a1,0 + b6: 00000097 auipc ra,0x0 + ba: 000080e7 jalr ra # b6 <.LVL9+0xe> + +000000be <.LVL10>: + be: 4282 lw t0,0(sp) + c0: 4792 lw a5,4(sp) + c2: 4722 lw a4,8(sp) + c4: 86aa mv a3,a0 + c6: 862e mv a2,a1 + c8: 0002d463 bgez t0,d0 <.L10> + cc: 40858633 sub a2,a1,s0 + +000000d0 <.L10>: + d0: fa0455e3 bgez s0,7a <.L11> + d4: 409506b3 sub a3,a0,s1 + d8: 00d53533 sltu a0,a0,a3 + dc: 40560633 sub a2,a2,t0 + e0: bf61 j 78 <.L30> + +000000e2 <.L9>: + e2: 0205ce63 bltz a1,11e <.L13> + e6: 0006cf63 bltz a3,104 <.L14> + ea: 00b6e333 or t1,a3,a1 + ee: fa0310e3 bnez t1,8e <.L8> + +000000f2 <.LBB5>: + f2: 4681 li a3,0 + f4: 4581 li a1,0 + f6: 00000097 auipc ra,0x0 + fa: 000080e7 jalr ra # f6 <.LBB5+0x4> + +000000fe <.L25>: + fe: f205d3e3 bgez a1,24 <.L1> + 102: b771 j 8e <.L8> + +00000104 <.L14>: + 104: f5c9 bnez a1,8e <.L8> + 106: 57fd li a5,-1 + 108: f8f693e3 bne a3,a5,8e <.L8> + +0000010c <.LBB7>: + 10c: 4681 li a3,0 + 10e: 00000097 auipc ra,0x0 + 112: 000080e7 jalr ra # 10e <.LBB7+0x2> + +00000116 <.LVL14>: + 116: 8d85 sub a1,a1,s1 + +00000118 <.L27>: + 118: f005c6e3 bltz a1,24 <.L1> + 11c: bf8d j 8e <.L8> + +0000011e <.L13>: + 11e: 0006cd63 bltz a3,138 <.L17> + 122: 57fd li a5,-1 + 124: f6f595e3 bne a1,a5,8e <.L8> + 128: f2bd bnez a3,8e <.L8> + +0000012a <.LBB9>: + 12a: 4581 li a1,0 + 12c: 00000097 auipc ra,0x0 + 130: 000080e7 jalr ra # 12c <.LBB9+0x2> + +00000134 <.LVL16>: + 134: 8d81 sub a1,a1,s0 + 136: b7cd j 118 <.L27> + +00000138 <.L17>: + 138: 00b6f333 and t1,a3,a1 + 13c: 57fd li a5,-1 + 13e: f4f318e3 bne t1,a5,8e <.L8> + 142: 00a667b3 or a5,a2,a0 + 146: d7a1 beqz a5,8e <.L8> + +00000148 <.LBB10>: + 148: 4681 li a3,0 + 14a: 4581 li a1,0 + 14c: 00000097 auipc ra,0x0 + 150: 000080e7 jalr ra # 14c <.LBB10+0x4> + +00000154 <.LVL18>: + 154: 8d85 sub a1,a1,s1 + 156: 8d81 sub a1,a1,s0 + 158: b75d j fe <.L25> + +_negvsi2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__negvsi2>: + 0: 80000737 lui a4,0x80000 + 4: 00e51863 bne a0,a4,14 <.L1> + 8: 1151 add sp,sp,-12 + a: c406 sw ra,8(sp) + c: 00000097 auipc ra,0x0 + 10: 000080e7 jalr ra # c <__negvsi2+0xc> + +00000014 <.L1>: + 14: 40a00533 neg a0,a0 + +00000018 <.LVL2>: + 18: 8082 ret + +_negvdi2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__negvdi2>: + 0: 87aa mv a5,a0 + 2: 872e mv a4,a1 + 4: 00f03633 snez a2,a5 + 8: 40b005b3 neg a1,a1 + c: 4681 li a3,0 + e: 40a00533 neg a0,a0 + +00000012 <.LVL1>: + 12: 8d91 sub a1,a1,a2 + 14: e791 bnez a5,20 <.L2> + 16: 800007b7 lui a5,0x80000 + 1a: 00f71363 bne a4,a5,20 <.L2> + 1e: 4685 li a3,1 + +00000020 <.L2>: + 20: c699 beqz a3,2e <.L1> + 22: 1151 add sp,sp,-12 + 24: c406 sw ra,8(sp) + 26: 00000097 auipc ra,0x0 + 2a: 000080e7 jalr ra # 26 <.L2+0x6> + +0000002e <.L1>: + 2e: 8082 ret + +_ctors.o: file format elf32-littleriscv + + +_ffssi2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__ffssi2>: + 0: cd15 beqz a0,3c <.L5> + +00000002 <.LBB2>: + 2: 40a007b3 neg a5,a0 + 6: 8d7d and a0,a0,a5 + +00000008 <.LVL2>: + 8: 67c1 lui a5,0x10 + +0000000a <.LVL3>: + a: 02f57263 bgeu a0,a5,2e <.L3> + e: 10053793 sltiu a5,a0,256 + 12: 0017c793 xor a5,a5,1 + 16: 078e sll a5,a5,0x3 + +00000018 <.L4>: + 18: 00000737 lui a4,0x0 + 1c: 00f55533 srl a0,a0,a5 + +00000020 <.LVL5>: + 20: 00070713 mv a4,a4 + 24: 972a add a4,a4,a0 + 26: 00074503 lbu a0,0(a4) # 0 <__ffssi2> + 2a: 953e add a0,a0,a5 + +0000002c <.LBE6>: + 2c: 8082 ret + +0000002e <.L3>: + 2e: 01000737 lui a4,0x1000 + 32: 47c1 li a5,16 + 34: fee562e3 bltu a0,a4,18 <.L4> + 38: 47e1 li a5,24 + 3a: bff9 j 18 <.L4> + +0000003c <.L5>: + 3c: 4501 li a0,0 + +0000003e <.LVL8>: + 3e: 8082 ret + +_ffsdi2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__ffsdi2>: + 0: c915 beqz a0,34 <.L2> + 2: 85aa mv a1,a0 + +00000004 <.LVL1>: + 4: 4601 li a2,0 + +00000006 <.L3>: + 6: 40b00733 neg a4,a1 + a: 8f6d and a4,a4,a1 + +0000000c <.LVL3>: + c: 67c1 lui a5,0x10 + e: 02f77863 bgeu a4,a5,3e <.L5> + 12: 10073793 sltiu a5,a4,256 + 16: 0017c793 xor a5,a5,1 + 1a: 078e sll a5,a5,0x3 + +0000001c <.L6>: + 1c: 000006b7 lui a3,0x0 + 20: 00f75733 srl a4,a4,a5 + +00000024 <.LVL5>: + 24: 00068693 mv a3,a3 + 28: 9736 add a4,a4,a3 + 2a: 00074503 lbu a0,0(a4) + +0000002e <.LBE6>: + 2e: 963e add a2,a2,a5 + +00000030 <.LVL6>: + 30: 9532 add a0,a0,a2 + +00000032 <.L1>: + 32: 8082 ret + +00000034 <.L2>: + 34: 852e mv a0,a1 + +00000036 <.LVL9>: + 36: ddf5 beqz a1,32 <.L1> + +00000038 <.LVL10>: + 38: 02000613 li a2,32 + 3c: b7e9 j 6 <.L3> + +0000003e <.L5>: + 3e: 010006b7 lui a3,0x1000 + 42: 47c1 li a5,16 + 44: fcd76ce3 bltu a4,a3,1c <.L6> + 48: 47e1 li a5,24 + 4a: bfc9 j 1c <.L6> + +_clz.o: file format elf32-littleriscv + + +_clzsi2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__clzsi2>: + 0: 67c1 lui a5,0x10 + 2: 02f57663 bgeu a0,a5,2e <.L2> + 6: 10053793 sltiu a5,a0,256 + a: 0017c793 xor a5,a5,1 + e: 078e sll a5,a5,0x3 + +00000010 <.L3>: + 10: 00000737 lui a4,0x0 + 14: 02000693 li a3,32 + 18: 8e9d sub a3,a3,a5 + 1a: 00f55533 srl a0,a0,a5 + +0000001e <.LVL2>: + 1e: 00070793 mv a5,a4 + +00000022 <.LVL3>: + 22: 97aa add a5,a5,a0 + 24: 0007c503 lbu a0,0(a5) # 10000 <.LASF5+0xfe54> + +00000028 <.LBE3>: + 28: 40a68533 sub a0,a3,a0 + 2c: 8082 ret + +0000002e <.L2>: + 2e: 01000737 lui a4,0x1000 + 32: 47c1 li a5,16 + 34: fce56ee3 bltu a0,a4,10 <.L3> + 38: 47e1 li a5,24 + 3a: bfd9 j 10 <.L3> + +_clzdi2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__clzdi2>: + 0: c995 beqz a1,34 <.L2> + +00000002 <.LVL1>: + 2: 4501 li a0,0 + +00000004 <.L3>: + 4: 67c1 lui a5,0x10 + 6: 02f5fb63 bgeu a1,a5,3c <.L4> + a: 1005b793 sltiu a5,a1,256 + e: 0017c793 xor a5,a5,1 + 12: 078e sll a5,a5,0x3 + +00000014 <.L5>: + 14: 000006b7 lui a3,0x0 + 18: 02000713 li a4,32 + 1c: 8f1d sub a4,a4,a5 + 1e: 00f5d5b3 srl a1,a1,a5 + +00000022 <.LVL4>: + 22: 00068793 mv a5,a3 + +00000026 <.LVL5>: + 26: 97ae add a5,a5,a1 + 28: 0007c783 lbu a5,0(a5) # 10000 <.LASF16+0xfe25> + 2c: 40f707b3 sub a5,a4,a5 + +00000030 <.LBE3>: + 30: 953e add a0,a0,a5 + +00000032 <.LVL6>: + 32: 8082 ret + +00000034 <.L2>: + 34: 85aa mv a1,a0 + +00000036 <.LVL8>: + 36: 02000513 li a0,32 + +0000003a <.LVL9>: + 3a: b7e9 j 4 <.L3> + +0000003c <.L4>: + 3c: 01000737 lui a4,0x1000 + 40: 47c1 li a5,16 + 42: fce5e9e3 bltu a1,a4,14 <.L5> + 46: 47e1 li a5,24 + 48: b7f1 j 14 <.L5> + +_ctzsi2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__ctzsi2>: + 0: 40a007b3 neg a5,a0 + 4: 8d7d and a0,a0,a5 + +00000006 <.LVL1>: + 6: 67c1 lui a5,0x10 + +00000008 <.LVL2>: + 8: 02f57363 bgeu a0,a5,2e <.L2> + c: 10053793 sltiu a5,a0,256 + 10: 0017c793 xor a5,a5,1 + 14: 078e sll a5,a5,0x3 + +00000016 <.L3>: + 16: 00000737 lui a4,0x0 + 1a: 00f55533 srl a0,a0,a5 + +0000001e <.LVL4>: + 1e: 00070713 mv a4,a4 + 22: 972a add a4,a4,a0 + 24: 00074503 lbu a0,0(a4) # 0 <__ctzsi2> + +00000028 <.LBE4>: + 28: 17fd add a5,a5,-1 # ffff <.LASF5+0xfe43> + +0000002a <.LBE6>: + 2a: 953e add a0,a0,a5 + 2c: 8082 ret + +0000002e <.L2>: + 2e: 01000737 lui a4,0x1000 + 32: 47c1 li a5,16 + 34: fee561e3 bltu a0,a4,16 <.L3> + 38: 47e1 li a5,24 + 3a: bff1 j 16 <.L3> + +_ctzdi2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__ctzdi2>: + 0: 02000613 li a2,32 + 4: c119 beqz a0,a <.L3> + 6: 85aa mv a1,a0 + +00000008 <.LVL1>: + 8: 4601 li a2,0 + +0000000a <.L3>: + a: 40b00733 neg a4,a1 + e: 8f6d and a4,a4,a1 + +00000010 <.LVL3>: + 10: 67c1 lui a5,0x10 + 12: 02f77463 bgeu a4,a5,3a <.L4> + 16: 10073793 sltiu a5,a4,256 + 1a: 0017c793 xor a5,a5,1 + 1e: 078e sll a5,a5,0x3 + +00000020 <.L5>: + 20: 000006b7 lui a3,0x0 + 24: 00f75733 srl a4,a4,a5 + +00000028 <.LVL5>: + 28: 00068693 mv a3,a3 + 2c: 9736 add a4,a4,a3 + 2e: 00074503 lbu a0,0(a4) + +00000032 <.LBE4>: + 32: 17fd add a5,a5,-1 # ffff <.LASF16+0xfe14> + +00000034 <.LVL7>: + 34: 953e add a0,a0,a5 + +00000036 <.LBE6>: + 36: 9532 add a0,a0,a2 + 38: 8082 ret + +0000003a <.L4>: + 3a: 010006b7 lui a3,0x1000 + 3e: 47c1 li a5,16 + 40: fed760e3 bltu a4,a3,20 <.L5> + 44: 47e1 li a5,24 + 46: bfe9 j 20 <.L5> + +_popcount_tab.o: file format elf32-littleriscv + + +_popcountsi2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__popcountsi2>: + 0: 55555737 lui a4,0x55555 + 4: 00155793 srl a5,a0,0x1 + 8: 55570713 add a4,a4,1365 # 55555555 <.LASF5+0x555553c2> + c: 8ff9 and a5,a5,a4 + e: 8d1d sub a0,a0,a5 + +00000010 <.LVL1>: + 10: 333337b7 lui a5,0x33333 + 14: 33378793 add a5,a5,819 # 33333333 <.LASF5+0x333331a0> + 18: 00f57733 and a4,a0,a5 + 1c: 8109 srl a0,a0,0x2 + +0000001e <.LVL2>: + 1e: 8d7d and a0,a0,a5 + 20: 972a add a4,a4,a0 + +00000022 <.LVL3>: + 22: 00475793 srl a5,a4,0x4 + 26: 97ba add a5,a5,a4 + +00000028 <.LVL4>: + 28: 0f0f1737 lui a4,0xf0f1 + 2c: f0f70713 add a4,a4,-241 # f0f0f0f <.LASF5+0xf0f0d7c> + 30: 8ff9 and a5,a5,a4 + +00000032 <.LVL5>: + 32: 00879513 sll a0,a5,0x8 + +00000036 <.LVL6>: + 36: 953e add a0,a0,a5 + 38: 01051793 sll a5,a0,0x10 + 3c: 953e add a0,a0,a5 + 3e: 8161 srl a0,a0,0x18 + 40: 8082 ret + +_popcountdi2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__popcountdi2>: + 0: 555557b7 lui a5,0x55555 + 4: 00155713 srl a4,a0,0x1 + 8: 55578793 add a5,a5,1365 # 55555555 <.LASF15+0x55555391> + c: 8f7d and a4,a4,a5 + e: 8d19 sub a0,a0,a4 + +00000010 <.LVL1>: + 10: 0015d713 srl a4,a1,0x1 + 14: 8ff9 and a5,a5,a4 + 16: 8d9d sub a1,a1,a5 + 18: 333337b7 lui a5,0x33333 + 1c: 33378793 add a5,a5,819 # 33333333 <.LASF15+0x3333316f> + 20: 00f576b3 and a3,a0,a5 + 24: 8109 srl a0,a0,0x2 + +00000026 <.LVL3>: + 26: 8d7d and a0,a0,a5 + 28: 00f5f633 and a2,a1,a5 + 2c: 8189 srl a1,a1,0x2 + +0000002e <.LVL4>: + 2e: 96aa add a3,a3,a0 + +00000030 <.LVL5>: + 30: 8dfd and a1,a1,a5 + 32: 962e add a2,a2,a1 + +00000034 <.LVL6>: + 34: 0046d713 srl a4,a3,0x4 + 38: 9736 add a4,a4,a3 + 3a: 00465793 srl a5,a2,0x4 + 3e: 0f0f16b7 lui a3,0xf0f1 + +00000042 <.LVL7>: + 42: f0f68693 add a3,a3,-241 # f0f0f0f <.LASF15+0xf0f0d4b> + 46: 97b2 add a5,a5,a2 + 48: 8f75 and a4,a4,a3 + +0000004a <.LVL8>: + 4a: 8ff5 and a5,a5,a3 + +0000004c <.LVL9>: + 4c: 97ba add a5,a5,a4 + 4e: 00879513 sll a0,a5,0x8 + 52: 953e add a0,a0,a5 + 54: 01051793 sll a5,a0,0x10 + 58: 953e add a0,a0,a5 + 5a: 8161 srl a0,a0,0x18 + 5c: 8082 ret + +_paritysi2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__paritysi2>: + 0: 01055793 srl a5,a0,0x10 + 4: 8fa9 xor a5,a5,a0 + +00000006 <.LVL1>: + 6: 0087d513 srl a0,a5,0x8 + a: 8d3d xor a0,a0,a5 + +0000000c <.LVL2>: + c: 00455793 srl a5,a0,0x4 + 10: 8fa9 xor a5,a5,a0 + +00000012 <.LVL3>: + 12: 651d lui a0,0x7 + 14: 8bbd and a5,a5,15 + +00000016 <.LVL4>: + 16: 99650513 add a0,a0,-1642 # 6996 <.LASF5+0x6805> + 1a: 40f55533 sra a0,a0,a5 + 1e: 8905 and a0,a0,1 + 20: 8082 ret + +_paritydi2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__paritydi2>: + 0: 8d2d xor a0,a0,a1 + +00000002 <.LVL1>: + 2: 01055793 srl a5,a0,0x10 + 6: 8fa9 xor a5,a5,a0 + +00000008 <.LVL2>: + 8: 0087d713 srl a4,a5,0x8 + c: 8f3d xor a4,a4,a5 + +0000000e <.LVL3>: + e: 00475793 srl a5,a4,0x4 + 12: 8fb9 xor a5,a5,a4 + +00000014 <.LVL4>: + 14: 651d lui a0,0x7 + 16: 8bbd and a5,a5,15 + +00000018 <.LVL5>: + 18: 99650513 add a0,a0,-1642 # 6996 <.LASF15+0x67d4> + 1c: 40f55533 sra a0,a0,a5 + 20: 8905 and a0,a0,1 + 22: 8082 ret + +_powisf2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__powisf2>: + 0: 41f5d793 sra a5,a1,0x1f + 4: 00b7c733 xor a4,a5,a1 + 8: 1131 add sp,sp,-20 + a: 8f1d sub a4,a4,a5 + +0000000c <.LVL1>: + c: c622 sw s0,12(sp) + e: c426 sw s1,8(sp) + 10: c806 sw ra,16(sp) + 12: 00177793 and a5,a4,1 + 16: 86aa mv a3,a0 + 18: 84ae mv s1,a1 + 1a: 842a mv s0,a0 + 1c: e789 bnez a5,26 <.L4> + 1e: 000007b7 lui a5,0x0 + 22: 0007a403 lw s0,0(a5) # 0 <__powisf2> + +00000026 <.L4>: + 26: 8305 srl a4,a4,0x1 + 28: e31d bnez a4,4e <.L6> + 2a: 0004dc63 bgez s1,42 <.L1> + 2e: 000007b7 lui a5,0x0 + 32: 0007a503 lw a0,0(a5) # 0 <__powisf2> + 36: 85a2 mv a1,s0 + 38: 00000097 auipc ra,0x0 + 3c: 000080e7 jalr ra # 38 <.L4+0x12> + +00000040 <.LVL4>: + 40: 842a mv s0,a0 + +00000042 <.L1>: + 42: 40c2 lw ra,16(sp) + 44: 8522 mv a0,s0 + 46: 4432 lw s0,12(sp) + 48: 44a2 lw s1,8(sp) + +0000004a <.LVL6>: + 4a: 0151 add sp,sp,20 + 4c: 8082 ret + +0000004e <.L6>: + 4e: 85b6 mv a1,a3 + 50: 8536 mv a0,a3 + 52: c03a sw a4,0(sp) + 54: 00000097 auipc ra,0x0 + 58: 000080e7 jalr ra # 54 <.L6+0x6> + +0000005c <.LVL8>: + 5c: 4702 lw a4,0(sp) + 5e: 86aa mv a3,a0 + +00000060 <.LVL9>: + 60: 00177793 and a5,a4,1 + 64: d3e9 beqz a5,26 <.L4> + +00000066 <.LVL10>: + 66: 85aa mv a1,a0 + 68: c02a sw a0,0(sp) + 6a: 8522 mv a0,s0 + +0000006c <.LVL11>: + 6c: c23a sw a4,4(sp) + 6e: 00000097 auipc ra,0x0 + 72: 000080e7 jalr ra # 6e <.LVL11+0x2> + +00000076 <.LVL12>: + 76: 4712 lw a4,4(sp) + 78: 4682 lw a3,0(sp) + 7a: 842a mv s0,a0 + 7c: b76d j 26 <.L4> + +_powidf2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__powidf2>: + 0: 41f65693 sra a3,a2,0x1f + 4: 00c6c333 xor t1,a3,a2 + 8: 1111 add sp,sp,-28 + a: 40d30333 sub t1,t1,a3 + +0000000e <.LVL1>: + e: ca22 sw s0,20(sp) + 10: c826 sw s1,16(sp) + 12: cc06 sw ra,24(sp) + 14: 00137693 and a3,t1,1 + 18: 87aa mv a5,a0 + 1a: 872e mv a4,a1 + 1c: 82b2 mv t0,a2 + 1e: 84aa mv s1,a0 + 20: 842e mv s0,a1 + 22: e699 bnez a3,30 <.L4> + 24: 000006b7 lui a3,0x0 + 28: 0006a483 lw s1,0(a3) # 0 <__powidf2> + 2c: 0046a403 lw s0,4(a3) + +00000030 <.L4>: + 30: 00135313 srl t1,t1,0x1 + 34: 02031963 bnez t1,66 <.L6> + 38: 0202d063 bgez t0,58 <.L1> + 3c: 000007b7 lui a5,0x0 + +00000040 <.LVL4>: + 40: 0007a503 lw a0,0(a5) # 0 <__powidf2> + 44: 0047a583 lw a1,4(a5) + 48: 8626 mv a2,s1 + 4a: 86a2 mv a3,s0 + 4c: 00000097 auipc ra,0x0 + 50: 000080e7 jalr ra # 4c <.LVL4+0xc> + +00000054 <.LVL5>: + 54: 84aa mv s1,a0 + +00000056 <.LVL6>: + 56: 842e mv s0,a1 + +00000058 <.L1>: + 58: 40e2 lw ra,24(sp) + 5a: 85a2 mv a1,s0 + 5c: 4452 lw s0,20(sp) + 5e: 8526 mv a0,s1 + 60: 44c2 lw s1,16(sp) + 62: 0171 add sp,sp,28 + 64: 8082 ret + +00000066 <.L6>: + 66: 86ba mv a3,a4 + 68: 863e mv a2,a5 + 6a: 853e mv a0,a5 + 6c: 85ba mv a1,a4 + 6e: c216 sw t0,4(sp) + 70: c01a sw t1,0(sp) + 72: 00000097 auipc ra,0x0 + 76: 000080e7 jalr ra # 72 <.L6+0xc> + +0000007a <.LVL8>: + 7a: 4302 lw t1,0(sp) + 7c: 4292 lw t0,4(sp) + 7e: 87aa mv a5,a0 + 80: 00137693 and a3,t1,1 + 84: 872e mv a4,a1 + +00000086 <.LVL9>: + 86: d6cd beqz a3,30 <.L4> + +00000088 <.LVL10>: + 88: 862a mv a2,a0 + 8a: c22a sw a0,4(sp) + 8c: 86ae mv a3,a1 + 8e: c02e sw a1,0(sp) + 90: 8526 mv a0,s1 + +00000092 <.LVL11>: + 92: 85a2 mv a1,s0 + +00000094 <.LVL12>: + 94: c616 sw t0,12(sp) + 96: c41a sw t1,8(sp) + 98: 00000097 auipc ra,0x0 + 9c: 000080e7 jalr ra # 98 <.LVL12+0x4> + +000000a0 <.LVL13>: + a0: 42b2 lw t0,12(sp) + a2: 4322 lw t1,8(sp) + a4: 4792 lw a5,4(sp) + a6: 4702 lw a4,0(sp) + a8: 84aa mv s1,a0 + +000000aa <.LVL14>: + aa: 842e mv s0,a1 + +000000ac <.LVL15>: + ac: b751 j 30 <.L4> + +_powixf2.o: file format elf32-littleriscv + + +_powitf2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__powitf2>: + 0: 41dc lw a5,4(a1) + 2: fa810113 add sp,sp,-88 + 6: c6a6 sw s1,76(sp) + 8: c23e sw a5,4(sp) + a: 41f65793 sra a5,a2,0x1f + e: 00c7c4b3 xor s1,a5,a2 + 12: 8c9d sub s1,s1,a5 + +00000014 <.LVL1>: + 14: c8a2 sw s0,80(sp) + 16: ca86 sw ra,84(sp) + 18: c02a sw a0,0(sp) + 1a: c432 sw a2,8(sp) + 1c: 0014f793 and a5,s1,1 + 20: 4180 lw s0,0(a1) + 22: 0085a283 lw t0,8(a1) + 26: 00c5a383 lw t2,12(a1) + 2a: efa9 bnez a5,84 <.L8> + 2c: 4301 li t1,0 + 2e: 4681 li a3,0 + 30: 4701 li a4,0 + 32: 3fff07b7 lui a5,0x3fff0 + +00000036 <.L4>: + 36: 8085 srl s1,s1,0x1 + 38: e8b9 bnez s1,8e <.L6> + 3a: 4622 lw a2,8(sp) + 3c: 02065763 bgez a2,6a <.L7> + 40: 3fff0637 lui a2,0x3fff0 + 44: dc32 sw a2,56(sp) + 46: 106c add a1,sp,44 + 48: 0870 add a2,sp,28 + 4a: 1868 add a0,sp,60 + 4c: ce1a sw t1,28(sp) + 4e: d036 sw a3,32(sp) + 50: d23a sw a4,36(sp) + 52: d43e sw a5,40(sp) + 54: d602 sw zero,44(sp) + 56: d802 sw zero,48(sp) + 58: da02 sw zero,52(sp) + 5a: 00000097 auipc ra,0x0 + 5e: 000080e7 jalr ra # 5a <.L4+0x24> + +00000062 <.LVL4>: + 62: 5372 lw t1,60(sp) + 64: 4686 lw a3,64(sp) + 66: 4716 lw a4,68(sp) + 68: 47a6 lw a5,72(sp) + +0000006a <.L7>: + 6a: 4602 lw a2,0(sp) + 6c: 40d6 lw ra,84(sp) + 6e: 4446 lw s0,80(sp) + 70: 00662023 sw t1,0(a2) # 3fff0000 <.LASF5+0x3ffefe60> + 74: c254 sw a3,4(a2) + 76: c618 sw a4,8(a2) + 78: c65c sw a5,12(a2) + 7a: 44b6 lw s1,76(sp) + +0000007c <.LVL5>: + 7c: 8532 mv a0,a2 + 7e: 05810113 add sp,sp,88 + +00000082 <.LVL6>: + 82: 8082 ret + +00000084 <.L8>: + 84: 4692 lw a3,4(sp) + 86: 8322 mv t1,s0 + 88: 8716 mv a4,t0 + 8a: 879e mv a5,t2 + 8c: b76d j 36 <.L4> + +0000008e <.L6>: + 8e: cc3e sw a5,24(sp) + 90: 4792 lw a5,4(sp) + +00000092 <.LVL9>: + 92: 0870 add a2,sp,28 + 94: 106c add a1,sp,44 + 96: 1868 add a0,sp,60 + 98: ca3a sw a4,20(sp) + 9a: c836 sw a3,16(sp) + 9c: c61a sw t1,12(sp) + 9e: d622 sw s0,44(sp) + a0: d83e sw a5,48(sp) + a2: da16 sw t0,52(sp) + a4: dc1e sw t2,56(sp) + a6: ce22 sw s0,28(sp) + a8: d03e sw a5,32(sp) + aa: d216 sw t0,36(sp) + ac: d41e sw t2,40(sp) + ae: 00000097 auipc ra,0x0 + b2: 000080e7 jalr ra # ae <.LVL9+0x1c> + +000000b6 <.LVL10>: + b6: 4786 lw a5,64(sp) + b8: 0014f613 and a2,s1,1 + bc: 5472 lw s0,60(sp) + be: c23e sw a5,4(sp) + c0: 4296 lw t0,68(sp) + c2: 43a6 lw t2,72(sp) + +000000c4 <.LVL11>: + c4: 4332 lw t1,12(sp) + c6: 46c2 lw a3,16(sp) + c8: 4752 lw a4,20(sp) + ca: 47e2 lw a5,24(sp) + +000000cc <.LVL12>: + cc: d62d beqz a2,36 <.L4> + ce: dc3e sw a5,56(sp) + d0: 4792 lw a5,4(sp) + d2: 0870 add a2,sp,28 + d4: 106c add a1,sp,44 + d6: 1868 add a0,sp,60 + d8: d61a sw t1,44(sp) + da: d836 sw a3,48(sp) + dc: da3a sw a4,52(sp) + de: d03e sw a5,32(sp) + e0: d216 sw t0,36(sp) + e2: c816 sw t0,16(sp) + +000000e4 <.LVL13>: + e4: d41e sw t2,40(sp) + e6: c61e sw t2,12(sp) + e8: ce22 sw s0,28(sp) + ea: 00000097 auipc ra,0x0 + ee: 000080e7 jalr ra # ea <.LVL13+0x6> + +000000f2 <.LVL14>: + f2: 5372 lw t1,60(sp) + f4: 4686 lw a3,64(sp) + f6: 4716 lw a4,68(sp) + f8: 47a6 lw a5,72(sp) + fa: 42c2 lw t0,16(sp) + fc: 43b2 lw t2,12(sp) + +000000fe <.LVL15>: + fe: bf25 j 36 <.L4> + +_mulhc3.o: file format elf32-littleriscv + + +_mulsc3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__mulsc3>: + 0: fc410113 add sp,sp,-60 + 4: c02e sw a1,0(sp) + 6: 85b2 mv a1,a2 + +00000008 <.LVL1>: + 8: dc06 sw ra,56(sp) + a: c232 sw a2,4(sp) + c: c436 sw a3,8(sp) + e: da22 sw s0,52(sp) + 10: d826 sw s1,48(sp) + 12: c62a sw a0,12(sp) + 14: 00000097 auipc ra,0x0 + 18: 000080e7 jalr ra # 14 <.LVL1+0xc> + +0000001c <.LVL2>: + 1c: 45a2 lw a1,8(sp) + 1e: d02a sw a0,32(sp) + +00000020 <.LVL3>: + 20: 4502 lw a0,0(sp) + +00000022 <.LVL4>: + 22: 00000097 auipc ra,0x0 + 26: 000080e7 jalr ra # 22 <.LVL4> + +0000002a <.LVL5>: + 2a: 45a2 lw a1,8(sp) + 2c: d22a sw a0,36(sp) + +0000002e <.LVL6>: + 2e: 4532 lw a0,12(sp) + +00000030 <.LVL7>: + 30: 00000097 auipc ra,0x0 + 34: 000080e7 jalr ra # 30 <.LVL7> + +00000038 <.LVL8>: + 38: 4582 lw a1,0(sp) + 3a: d42a sw a0,40(sp) + +0000003c <.LVL9>: + 3c: 4512 lw a0,4(sp) + +0000003e <.LVL10>: + 3e: 00000097 auipc ra,0x0 + 42: 000080e7 jalr ra # 3e <.LVL10> + +00000046 <.LVL11>: + 46: 5592 lw a1,36(sp) + 48: d62a sw a0,44(sp) + +0000004a <.LVL12>: + 4a: 5502 lw a0,32(sp) + +0000004c <.LVL13>: + 4c: 00000097 auipc ra,0x0 + 50: 000080e7 jalr ra # 4c <.LVL13> + +00000054 <.LVL14>: + 54: 55b2 lw a1,44(sp) + 56: ca2a sw a0,20(sp) + +00000058 <.LVL15>: + 58: 5522 lw a0,40(sp) + +0000005a <.LVL16>: + 5a: 00000097 auipc ra,0x0 + 5e: 000080e7 jalr ra # 5a <.LVL16> + +00000062 <.LVL17>: + 62: 45d2 lw a1,20(sp) + 64: cc2a sw a0,24(sp) + +00000066 <.LVL18>: + 66: 852e mv a0,a1 + +00000068 <.LVL19>: + 68: 00000097 auipc ra,0x0 + 6c: 000080e7 jalr ra # 68 <.LVL19> + +00000070 <.LVL20>: + 70: 30050063 beqz a0,370 <.L2> + 74: 45e2 lw a1,24(sp) + 76: 852e mv a0,a1 + 78: 00000097 auipc ra,0x0 + 7c: 000080e7 jalr ra # 78 <.LVL20+0x8> + +00000080 <.LVL21>: + 80: 2e050863 beqz a0,370 <.L2> + +00000084 <.LBB2>: + 84: 4732 lw a4,12(sp) + 86: 800007b7 lui a5,0x80000 + 8a: fff7c793 not a5,a5 + 8e: 00f774b3 and s1,a4,a5 + 92: 00000437 lui s0,0x0 + 96: 4702 lw a4,0(sp) + 98: 00042583 lw a1,0(s0) # 0 <__mulsc3> + 9c: 8526 mv a0,s1 + 9e: 8ff9 and a5,a5,a4 + a0: c83e sw a5,16(sp) + a2: 00000097 auipc ra,0x0 + a6: 000080e7 jalr ra # a2 <.LBB2+0x1e> + +000000aa <.LVL23>: + aa: e911 bnez a0,be <.L45> + ac: 00042583 lw a1,0(s0) + b0: 8526 mv a0,s1 + b2: 00000097 auipc ra,0x0 + b6: 000080e7 jalr ra # b2 <.LVL23+0x8> + +000000ba <.LVL24>: + ba: 02a04563 bgtz a0,e4 <.L5> + +000000be <.L45>: + be: 00042583 lw a1,0(s0) + c2: 4542 lw a0,16(sp) + c4: 00000097 auipc ra,0x0 + c8: 000080e7 jalr ra # c4 <.L45+0x6> + +000000cc <.LVL25>: + cc: ed75 bnez a0,1c8 <.L41> + ce: 000007b7 lui a5,0x0 + d2: 0007a583 lw a1,0(a5) # 0 <__mulsc3> + d6: 4542 lw a0,16(sp) + d8: 00000097 auipc ra,0x0 + dc: 000080e7 jalr ra # d8 <.LVL25+0xc> + +000000e0 <.LVL26>: + e0: 0ea05463 blez a0,1c8 <.L41> + +000000e4 <.L5>: + e4: 000007b7 lui a5,0x0 + e8: 0007a583 lw a1,0(a5) # 0 <__mulsc3> + ec: 8526 mv a0,s1 + ee: 4405 li s0,1 + f0: 00000097 auipc ra,0x0 + f4: 000080e7 jalr ra # f0 <.L5+0xc> + +000000f8 <.LVL27>: + f8: ed09 bnez a0,112 <.L8> + fa: 000007b7 lui a5,0x0 + fe: 0007a583 lw a1,0(a5) # 0 <__mulsc3> + 102: 8526 mv a0,s1 + 104: 00000097 auipc ra,0x0 + 108: 000080e7 jalr ra # 104 <.LVL27+0xc> + +0000010c <.LVL28>: + 10c: 00a05363 blez a0,112 <.L8> + 110: 4401 li s0,0 + +00000112 <.L8>: + 112: 00144513 xor a0,s0,1 + 116: 8905 and a0,a0,1 + 118: 00000097 auipc ra,0x0 + 11c: 000080e7 jalr ra # 118 <.L8+0x6> + +00000120 <.LVL29>: + 120: 4732 lw a4,12(sp) + 122: 800007b7 lui a5,0x80000 + 126: 4405 li s0,1 + 128: 8f7d and a4,a4,a5 + 12a: fff7c793 not a5,a5 + 12e: 8fe9 and a5,a5,a0 + 130: 8fd9 or a5,a5,a4 + 132: c63e sw a5,12(sp) + +00000134 <.LVL30>: + 134: 000007b7 lui a5,0x0 + 138: 0007a583 lw a1,0(a5) # 0 <__mulsc3> + 13c: 4542 lw a0,16(sp) + +0000013e <.LVL31>: + 13e: 00000097 auipc ra,0x0 + 142: 000080e7 jalr ra # 13e <.LVL31> + +00000146 <.LVL32>: + 146: ed09 bnez a0,160 <.L9> + 148: 000007b7 lui a5,0x0 + 14c: 0007a583 lw a1,0(a5) # 0 <__mulsc3> + 150: 4542 lw a0,16(sp) + 152: 00000097 auipc ra,0x0 + 156: 000080e7 jalr ra # 152 <.LVL32+0xc> + +0000015a <.LVL33>: + 15a: 00a05363 blez a0,160 <.L9> + 15e: 4401 li s0,0 + +00000160 <.L9>: + 160: 00144513 xor a0,s0,1 + 164: 8905 and a0,a0,1 + 166: 00000097 auipc ra,0x0 + 16a: 000080e7 jalr ra # 166 <.L9+0x6> + +0000016e <.LVL34>: + 16e: 4702 lw a4,0(sp) + 170: 800007b7 lui a5,0x80000 + 174: 4592 lw a1,4(sp) + 176: 8f7d and a4,a4,a5 + 178: fff7c793 not a5,a5 + 17c: 8fe9 and a5,a5,a0 + 17e: 8fd9 or a5,a5,a4 + 180: 852e mv a0,a1 + 182: c03e sw a5,0(sp) + +00000184 <.LVL35>: + 184: 00000097 auipc ra,0x0 + 188: 000080e7 jalr ra # 184 <.LVL35> + +0000018c <.LVL36>: + 18c: c919 beqz a0,1a2 <.L10> + 18e: 4712 lw a4,4(sp) + 190: 00000793 li a5,0 + 194: 00075663 bgez a4,1a0 <.L12> + 198: 000007b7 lui a5,0x0 + 19c: 0007a783 lw a5,0(a5) # 0 <__mulsc3> + +000001a0 <.L12>: + 1a0: c23e sw a5,4(sp) + +000001a2 <.L10>: + 1a2: 45a2 lw a1,8(sp) + 1a4: 852e mv a0,a1 + 1a6: 00000097 auipc ra,0x0 + 1aa: 000080e7 jalr ra # 1a6 <.L10+0x4> + +000001ae <.LVL38>: + 1ae: c919 beqz a0,1c4 <.L82> + 1b0: 4722 lw a4,8(sp) + 1b2: 00000793 li a5,0 + 1b6: 00075663 bgez a4,1c2 <.L14> + 1ba: 000007b7 lui a5,0x0 + 1be: 0007a783 lw a5,0(a5) # 0 <__mulsc3> + +000001c2 <.L14>: + 1c2: c43e sw a5,8(sp) + +000001c4 <.L82>: + 1c4: 4485 li s1,1 + 1c6: a011 j 1ca <.L7> + +000001c8 <.L41>: + 1c8: 4481 li s1,0 + +000001ca <.L7>: + 1ca: 4712 lw a4,4(sp) + 1cc: 800007b7 lui a5,0x80000 + 1d0: fff7c793 not a5,a5 + 1d4: 8f7d and a4,a4,a5 + 1d6: c83a sw a4,16(sp) + 1d8: 00000437 lui s0,0x0 + 1dc: 4722 lw a4,8(sp) + 1de: 00042583 lw a1,0(s0) # 0 <__mulsc3> + 1e2: 4542 lw a0,16(sp) + 1e4: 8ff9 and a5,a5,a4 + 1e6: ce3e sw a5,28(sp) + 1e8: 00000097 auipc ra,0x0 + 1ec: 000080e7 jalr ra # 1e8 <.L7+0x1e> + +000001f0 <.LVL42>: + 1f0: e911 bnez a0,204 <.L48> + 1f2: 00042583 lw a1,0(s0) + 1f6: 4542 lw a0,16(sp) + 1f8: 00000097 auipc ra,0x0 + 1fc: 000080e7 jalr ra # 1f8 <.LVL42+0x8> + +00000200 <.LVL43>: + 200: 02a04663 bgtz a0,22c <.L15> + +00000204 <.L48>: + 204: 00042583 lw a1,0(s0) + 208: 4572 lw a0,28(sp) + 20a: 00000097 auipc ra,0x0 + 20e: 000080e7 jalr ra # 20a <.L48+0x6> + +00000212 <.LVL44>: + 212: 16051763 bnez a0,380 <.L17> + 216: 000007b7 lui a5,0x0 + 21a: 0007a583 lw a1,0(a5) # 0 <__mulsc3> + 21e: 4572 lw a0,28(sp) + 220: 00000097 auipc ra,0x0 + 224: 000080e7 jalr ra # 220 <.LVL44+0xe> + +00000228 <.LVL45>: + 228: 14a05c63 blez a0,380 <.L17> + +0000022c <.L15>: + 22c: 000004b7 lui s1,0x0 + +00000230 <.LVL46>: + 230: 0004a583 lw a1,0(s1) # 0 <__mulsc3> + 234: 4542 lw a0,16(sp) + 236: 4405 li s0,1 + 238: 00000097 auipc ra,0x0 + 23c: 000080e7 jalr ra # 238 <.LVL46+0x8> + +00000240 <.LVL47>: + 240: e919 bnez a0,256 <.L18> + 242: 0004a583 lw a1,0(s1) + 246: 4542 lw a0,16(sp) + 248: 00000097 auipc ra,0x0 + 24c: 000080e7 jalr ra # 248 <.LVL47+0x8> + +00000250 <.LVL48>: + 250: 00a05363 blez a0,256 <.L18> + 254: 4401 li s0,0 + +00000256 <.L18>: + 256: 00144513 xor a0,s0,1 + 25a: 8905 and a0,a0,1 + 25c: 00000097 auipc ra,0x0 + 260: 000080e7 jalr ra # 25c <.L18+0x6> + +00000264 <.LVL49>: + 264: 4712 lw a4,4(sp) + 266: 800007b7 lui a5,0x80000 + 26a: 0004a583 lw a1,0(s1) + 26e: 8f7d and a4,a4,a5 + 270: fff7c793 not a5,a5 + 274: 8fe9 and a5,a5,a0 + 276: 4572 lw a0,28(sp) + 278: 8fd9 or a5,a5,a4 + 27a: c23e sw a5,4(sp) + +0000027c <.LVL50>: + 27c: 4405 li s0,1 + 27e: 00000097 auipc ra,0x0 + 282: 000080e7 jalr ra # 27e <.LVL50+0x2> + +00000286 <.LVL51>: + 286: ed09 bnez a0,2a0 <.L19> + 288: 000007b7 lui a5,0x0 + 28c: 0007a583 lw a1,0(a5) # 0 <__mulsc3> + 290: 4572 lw a0,28(sp) + 292: 00000097 auipc ra,0x0 + 296: 000080e7 jalr ra # 292 <.LVL51+0xc> + +0000029a <.LVL52>: + 29a: 00a05363 blez a0,2a0 <.L19> + 29e: 4401 li s0,0 + +000002a0 <.L19>: + 2a0: 00144513 xor a0,s0,1 + 2a4: 8905 and a0,a0,1 + 2a6: 00000097 auipc ra,0x0 + 2aa: 000080e7 jalr ra # 2a6 <.L19+0x6> + +000002ae <.LVL53>: + 2ae: 4722 lw a4,8(sp) + 2b0: 800007b7 lui a5,0x80000 + 2b4: 45b2 lw a1,12(sp) + 2b6: 8f7d and a4,a4,a5 + 2b8: fff7c793 not a5,a5 + 2bc: 8fe9 and a5,a5,a0 + 2be: 8fd9 or a5,a5,a4 + 2c0: 852e mv a0,a1 + 2c2: c43e sw a5,8(sp) + +000002c4 <.LVL54>: + 2c4: 00000097 auipc ra,0x0 + 2c8: 000080e7 jalr ra # 2c4 <.LVL54> + +000002cc <.LVL55>: + 2cc: c919 beqz a0,2e2 <.L20> + 2ce: 4732 lw a4,12(sp) + 2d0: 00000793 li a5,0 + 2d4: 00075663 bgez a4,2e0 <.L22> + 2d8: 000007b7 lui a5,0x0 + 2dc: 0007a783 lw a5,0(a5) # 0 <__mulsc3> + +000002e0 <.L22>: + 2e0: c63e sw a5,12(sp) + +000002e2 <.L20>: + 2e2: 4582 lw a1,0(sp) + 2e4: 852e mv a0,a1 + 2e6: 00000097 auipc ra,0x0 + 2ea: 000080e7 jalr ra # 2e6 <.L20+0x4> + +000002ee <.LVL57>: + 2ee: c919 beqz a0,304 <.L23> + 2f0: 4702 lw a4,0(sp) + 2f2: 00000793 li a5,0 + 2f6: 00075663 bgez a4,302 <.L25> + 2fa: 000007b7 lui a5,0x0 + 2fe: 0007a783 lw a5,0(a5) # 0 <__mulsc3> + +00000302 <.L25>: + 302: c03e sw a5,0(sp) + +00000304 <.L23>: + 304: 4592 lw a1,4(sp) + 306: 4532 lw a0,12(sp) + 308: 000004b7 lui s1,0x0 + 30c: 00000097 auipc ra,0x0 + 310: 000080e7 jalr ra # 30c <.L23+0x8> + +00000314 <.LVL59>: + 314: 842a mv s0,a0 + 316: 45a2 lw a1,8(sp) + 318: 4502 lw a0,0(sp) + 31a: 00000097 auipc ra,0x0 + 31e: 000080e7 jalr ra # 31a <.LVL59+0x6> + +00000322 <.LVL60>: + 322: 85aa mv a1,a0 + 324: 8522 mv a0,s0 + 326: 00000097 auipc ra,0x0 + 32a: 000080e7 jalr ra # 326 <.LVL60+0x4> + +0000032e <.LVL61>: + 32e: 0004a583 lw a1,0(s1) # 0 <__mulsc3> + 332: 00000097 auipc ra,0x0 + 336: 000080e7 jalr ra # 332 <.LVL61+0x4> + +0000033a <.LVL62>: + 33a: 45a2 lw a1,8(sp) + 33c: ca2a sw a0,20(sp) + +0000033e <.LVL63>: + 33e: 4532 lw a0,12(sp) + +00000340 <.LVL64>: + 340: 00000097 auipc ra,0x0 + 344: 000080e7 jalr ra # 340 <.LVL64> + +00000348 <.LVL65>: + 348: 4592 lw a1,4(sp) + 34a: 842a mv s0,a0 + 34c: 4502 lw a0,0(sp) + 34e: 00000097 auipc ra,0x0 + 352: 000080e7 jalr ra # 34e <.LVL65+0x6> + +00000356 <.LVL66>: + 356: 85aa mv a1,a0 + 358: 8522 mv a0,s0 + 35a: 00000097 auipc ra,0x0 + 35e: 000080e7 jalr ra # 35a <.LVL66+0x4> + +00000362 <.LVL67>: + 362: 0004a583 lw a1,0(s1) + 366: 00000097 auipc ra,0x0 + 36a: 000080e7 jalr ra # 366 <.LVL67+0x4> + +0000036e <.LVL68>: + 36e: cc2a sw a0,24(sp) + +00000370 <.L2>: + 370: 50e2 lw ra,56(sp) + 372: 5452 lw s0,52(sp) + 374: 4552 lw a0,20(sp) + 376: 45e2 lw a1,24(sp) + 378: 54c2 lw s1,48(sp) + 37a: 03c10113 add sp,sp,60 + +0000037e <.LVL70>: + 37e: 8082 ret + +00000380 <.L17>: + 380: f0d1 bnez s1,304 <.L23> + 382: 5782 lw a5,32(sp) + 384: 000004b7 lui s1,0x0 + +00000388 <.LVL72>: + 388: 0004a583 lw a1,0(s1) # 0 <__mulsc3> + 38c: 00179413 sll s0,a5,0x1 + 390: 8005 srl s0,s0,0x1 + 392: 8522 mv a0,s0 + 394: 00000097 auipc ra,0x0 + 398: 000080e7 jalr ra # 394 <.LVL72+0xc> + +0000039c <.LVL73>: + 39c: e911 bnez a0,3b0 <.L51> + 39e: 0004a583 lw a1,0(s1) + 3a2: 8522 mv a0,s0 + 3a4: 00000097 auipc ra,0x0 + 3a8: 000080e7 jalr ra # 3a4 <.LVL73+0x8> + +000003ac <.LVL74>: + 3ac: 08a04763 bgtz a0,43a <.L26> + +000003b0 <.L51>: + 3b0: 5792 lw a5,36(sp) + 3b2: 0004a583 lw a1,0(s1) + 3b6: 00179413 sll s0,a5,0x1 + 3ba: 8005 srl s0,s0,0x1 + 3bc: 8522 mv a0,s0 + 3be: 00000097 auipc ra,0x0 + 3c2: 000080e7 jalr ra # 3be <.L51+0xe> + +000003c6 <.LVL75>: + 3c6: ed01 bnez a0,3de <.L52> + 3c8: 000007b7 lui a5,0x0 + 3cc: 0007a583 lw a1,0(a5) # 0 <__mulsc3> + 3d0: 8522 mv a0,s0 + 3d2: 00000097 auipc ra,0x0 + 3d6: 000080e7 jalr ra # 3d2 <.LVL75+0xc> + +000003da <.LVL76>: + 3da: 06a04063 bgtz a0,43a <.L26> + +000003de <.L52>: + 3de: 57a2 lw a5,40(sp) + 3e0: 0004a583 lw a1,0(s1) + 3e4: 00179413 sll s0,a5,0x1 + 3e8: 8005 srl s0,s0,0x1 + 3ea: 8522 mv a0,s0 + 3ec: 00000097 auipc ra,0x0 + 3f0: 000080e7 jalr ra # 3ec <.L52+0xe> + +000003f4 <.LVL77>: + 3f4: ed01 bnez a0,40c <.L53> + 3f6: 000007b7 lui a5,0x0 + 3fa: 0007a583 lw a1,0(a5) # 0 <__mulsc3> + 3fe: 8522 mv a0,s0 + 400: 00000097 auipc ra,0x0 + 404: 000080e7 jalr ra # 400 <.LVL77+0xc> + +00000408 <.LVL78>: + 408: 02a04963 bgtz a0,43a <.L26> + +0000040c <.L53>: + 40c: 57b2 lw a5,44(sp) + 40e: 0004a583 lw a1,0(s1) + 412: 00179413 sll s0,a5,0x1 + 416: 8005 srl s0,s0,0x1 + 418: 8522 mv a0,s0 + 41a: 00000097 auipc ra,0x0 + 41e: 000080e7 jalr ra # 41a <.L53+0xe> + +00000422 <.LVL79>: + 422: f539 bnez a0,370 <.L2> + 424: 000007b7 lui a5,0x0 + 428: 0007a583 lw a1,0(a5) # 0 <__mulsc3> + 42c: 8522 mv a0,s0 + 42e: 00000097 auipc ra,0x0 + 432: 000080e7 jalr ra # 42e <.LVL79+0xc> + +00000436 <.LVL80>: + 436: f2a05de3 blez a0,370 <.L2> + +0000043a <.L26>: + 43a: 45b2 lw a1,12(sp) + 43c: 852e mv a0,a1 + 43e: 00000097 auipc ra,0x0 + 442: 000080e7 jalr ra # 43e <.L26+0x4> + +00000446 <.LVL81>: + 446: c919 beqz a0,45c <.L30> + 448: 4732 lw a4,12(sp) + 44a: 00000793 li a5,0 + 44e: 00075663 bgez a4,45a <.L32> + 452: 000007b7 lui a5,0x0 + 456: 0007a783 lw a5,0(a5) # 0 <__mulsc3> + +0000045a <.L32>: + 45a: c63e sw a5,12(sp) + +0000045c <.L30>: + 45c: 4582 lw a1,0(sp) + 45e: 852e mv a0,a1 + 460: 00000097 auipc ra,0x0 + 464: 000080e7 jalr ra # 460 <.L30+0x4> + +00000468 <.LVL83>: + 468: c919 beqz a0,47e <.L33> + 46a: 4702 lw a4,0(sp) + 46c: 00000793 li a5,0 + 470: 00075663 bgez a4,47c <.L35> + 474: 000007b7 lui a5,0x0 + 478: 0007a783 lw a5,0(a5) # 0 <__mulsc3> + +0000047c <.L35>: + 47c: c03e sw a5,0(sp) + +0000047e <.L33>: + 47e: 4592 lw a1,4(sp) + 480: 852e mv a0,a1 + 482: 00000097 auipc ra,0x0 + 486: 000080e7 jalr ra # 482 <.L33+0x4> + +0000048a <.LVL85>: + 48a: c919 beqz a0,4a0 <.L36> + 48c: 4712 lw a4,4(sp) + 48e: 00000793 li a5,0 + 492: 00075663 bgez a4,49e <.L38> + 496: 000007b7 lui a5,0x0 + 49a: 0007a783 lw a5,0(a5) # 0 <__mulsc3> + +0000049e <.L38>: + 49e: c23e sw a5,4(sp) + +000004a0 <.L36>: + 4a0: 45a2 lw a1,8(sp) + 4a2: 852e mv a0,a1 + 4a4: 00000097 auipc ra,0x0 + 4a8: 000080e7 jalr ra # 4a4 <.L36+0x4> + +000004ac <.LVL87>: + 4ac: e4050ce3 beqz a0,304 <.L23> + 4b0: 4722 lw a4,8(sp) + 4b2: 00000793 li a5,0 + 4b6: 00075663 bgez a4,4c2 <.L40> + 4ba: 000007b7 lui a5,0x0 + 4be: 0007a783 lw a5,0(a5) # 0 <__mulsc3> + +000004c2 <.L40>: + 4c2: c43e sw a5,8(sp) + +000004c4 <.LVL88>: + 4c4: b581 j 304 <.L23> + +_muldc3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__muldc3>: + 0: 7119 add sp,sp,-128 + 2: c83e sw a5,16(sp) + 4: debe sw a5,124(sp) + 6: 478a lw a5,128(sp) + 8: c232 sw a2,4(sp) + a: c436 sw a3,8(sp) + c: ca3e sw a5,20(sp) + e: 47d2 lw a5,20(sp) + 10: c63a sw a4,12(sp) + 12: 4742 lw a4,16(sp) + 14: 86be mv a3,a5 + +00000016 <.LVL1>: + 16: 4792 lw a5,4(sp) + 18: 863a mv a2,a4 + 1a: c2aa sw a0,68(sp) + 1c: c02e sw a1,0(sp) + 1e: 852e mv a0,a1 + 20: 85be mv a1,a5 + +00000022 <.LVL3>: + 22: dc86 sw ra,120(sp) + 24: daa2 sw s0,116(sp) + 26: d8a6 sw s1,112(sp) + 28: 00000097 auipc ra,0x0 + 2c: 000080e7 jalr ra # 28 <.LVL3+0x6> + +00000030 <.LVL4>: + 30: 4722 lw a4,8(sp) + 32: 47b2 lw a5,12(sp) + 34: 449a lw s1,132(sp) + 36: 442a lw s0,136(sp) + 38: c4aa sw a0,72(sp) + 3a: d0ae sw a1,96(sp) + +0000003c <.LVL5>: + 3c: 8626 mv a2,s1 + 3e: 86a2 mv a3,s0 + 40: 853a mv a0,a4 + +00000042 <.LVL6>: + 42: 85be mv a1,a5 + +00000044 <.LVL7>: + 44: 00000097 auipc ra,0x0 + 48: 000080e7 jalr ra # 44 <.LVL7> + +0000004c <.LVL8>: + 4c: 4702 lw a4,0(sp) + 4e: 4792 lw a5,4(sp) + 50: c6aa sw a0,76(sp) + 52: d2ae sw a1,100(sp) + +00000054 <.LVL9>: + 54: 8626 mv a2,s1 + 56: 86a2 mv a3,s0 + 58: 853a mv a0,a4 + +0000005a <.LVL10>: + 5a: 85be mv a1,a5 + +0000005c <.LVL11>: + 5c: 00000097 auipc ra,0x0 + 60: 000080e7 jalr ra # 5c <.LVL11> + +00000064 <.LVL12>: + 64: 4722 lw a4,8(sp) + 66: 47b2 lw a5,12(sp) + 68: c8aa sw a0,80(sp) + 6a: 863a mv a2,a4 + 6c: 86be mv a3,a5 + 6e: 4742 lw a4,16(sp) + 70: 47d2 lw a5,20(sp) + 72: d4ae sw a1,104(sp) + +00000074 <.LVL13>: + 74: 853a mv a0,a4 + +00000076 <.LVL14>: + 76: 85be mv a1,a5 + +00000078 <.LVL15>: + 78: 00000097 auipc ra,0x0 + 7c: 000080e7 jalr ra # 78 <.LVL15> + +00000080 <.LVL16>: + 80: 4736 lw a4,76(sp) + 82: 5796 lw a5,100(sp) + 84: caaa sw a0,84(sp) + 86: 863a mv a2,a4 + 88: 86be mv a3,a5 + 8a: 4726 lw a4,72(sp) + 8c: 5786 lw a5,96(sp) + 8e: d6ae sw a1,108(sp) + +00000090 <.LVL17>: + 90: 853a mv a0,a4 + +00000092 <.LVL18>: + 92: 85be mv a1,a5 + +00000094 <.LVL19>: + 94: 00000097 auipc ra,0x0 + 98: 000080e7 jalr ra # 94 <.LVL19> + +0000009c <.LVL20>: + 9c: 4756 lw a4,84(sp) + 9e: 57b6 lw a5,108(sp) + a0: d22a sw a0,36(sp) + a2: 863a mv a2,a4 + a4: 86be mv a3,a5 + a6: 4746 lw a4,80(sp) + a8: 57a6 lw a5,104(sp) + aa: d62e sw a1,44(sp) + +000000ac <.LVL21>: + ac: 853a mv a0,a4 + +000000ae <.LVL22>: + ae: 85be mv a1,a5 + +000000b0 <.LVL23>: + b0: 00000097 auipc ra,0x0 + b4: 000080e7 jalr ra # b0 <.LVL23> + +000000b8 <.LVL24>: + b8: 5612 lw a2,36(sp) + ba: 56b2 lw a3,44(sp) + bc: da2a sw a0,52(sp) + be: dc2e sw a1,56(sp) + +000000c0 <.LVL25>: + c0: 8532 mv a0,a2 + +000000c2 <.LVL26>: + c2: 85b6 mv a1,a3 + +000000c4 <.LVL27>: + c4: 00000097 auipc ra,0x0 + c8: 000080e7 jalr ra # c4 <.LVL27> + +000000cc <.LVL28>: + cc: 46050263 beqz a0,530 <.L2> + d0: 5652 lw a2,52(sp) + d2: 56e2 lw a3,56(sp) + d4: 8532 mv a0,a2 + d6: 85b6 mv a1,a3 + d8: 00000097 auipc ra,0x0 + dc: 000080e7 jalr ra # d8 <.LVL28+0xc> + +000000e0 <.LVL29>: + e0: 44050863 beqz a0,530 <.L2> + +000000e4 <.LBB2>: + e4: 4712 lw a4,4(sp) + e6: 800007b7 lui a5,0x80000 + ea: fff7c793 not a5,a5 + ee: 8f7d and a4,a4,a5 + f0: cc3a sw a4,24(sp) + f2: 4732 lw a4,12(sp) + f4: 8ff9 and a5,a5,a4 + f6: d03e sw a5,32(sp) + f8: 000007b7 lui a5,0x0 + fc: 0007a703 lw a4,0(a5) # 0 <__muldc3> + 100: 0047a783 lw a5,4(a5) + 104: de3a sw a4,60(sp) + 106: c0be sw a5,64(sp) + 108: 863a mv a2,a4 + 10a: 86be mv a3,a5 + 10c: 4702 lw a4,0(sp) + 10e: 47e2 lw a5,24(sp) + 110: 853a mv a0,a4 + 112: 85be mv a1,a5 + 114: 00000097 auipc ra,0x0 + 118: 000080e7 jalr ra # 114 <.LBB2+0x30> + +0000011c <.LVL31>: + 11c: ed09 bnez a0,136 <.L45> + 11e: 4702 lw a4,0(sp) + 120: 47e2 lw a5,24(sp) + 122: 5672 lw a2,60(sp) + 124: 4686 lw a3,64(sp) + 126: 853a mv a0,a4 + 128: 85be mv a1,a5 + 12a: 00000097 auipc ra,0x0 + 12e: 000080e7 jalr ra # 12a <.LVL31+0xe> + +00000132 <.LVL32>: + 132: 04a04263 bgtz a0,176 <.L5> + +00000136 <.L45>: + 136: 000007b7 lui a5,0x0 + 13a: 0007a703 lw a4,0(a5) # 0 <__muldc3> + 13e: 0047a783 lw a5,4(a5) + 142: de3a sw a4,60(sp) + 144: c0be sw a5,64(sp) + 146: 863a mv a2,a4 + 148: 86be mv a3,a5 + 14a: 4722 lw a4,8(sp) + 14c: 5782 lw a5,32(sp) + 14e: 853a mv a0,a4 + 150: 85be mv a1,a5 + 152: 00000097 auipc ra,0x0 + 156: 000080e7 jalr ra # 152 <.L45+0x1c> + +0000015a <.LVL33>: + 15a: 14051a63 bnez a0,2ae <.L41> + 15e: 4722 lw a4,8(sp) + 160: 5782 lw a5,32(sp) + 162: 5672 lw a2,60(sp) + 164: 4686 lw a3,64(sp) + 166: 853a mv a0,a4 + 168: 85be mv a1,a5 + 16a: 00000097 auipc ra,0x0 + 16e: 000080e7 jalr ra # 16a <.LVL33+0x10> + +00000172 <.LVL34>: + 172: 12a05e63 blez a0,2ae <.L41> + +00000176 <.L5>: + 176: 4785 li a5,1 + 178: 02f10e23 sb a5,60(sp) + 17c: 000007b7 lui a5,0x0 + 180: 0007a703 lw a4,0(a5) # 0 <__muldc3> + 184: 0047a783 lw a5,4(a5) + 188: ccba sw a4,88(sp) + 18a: cebe sw a5,92(sp) + 18c: 863a mv a2,a4 + 18e: 86be mv a3,a5 + 190: 4702 lw a4,0(sp) + 192: 47e2 lw a5,24(sp) + 194: 853a mv a0,a4 + 196: 85be mv a1,a5 + 198: 00000097 auipc ra,0x0 + 19c: 000080e7 jalr ra # 198 <.L5+0x22> + +000001a0 <.LVL35>: + 1a0: ed19 bnez a0,1be <.L8> + 1a2: 4702 lw a4,0(sp) + 1a4: 47e2 lw a5,24(sp) + 1a6: 4666 lw a2,88(sp) + 1a8: 46f6 lw a3,92(sp) + 1aa: 853a mv a0,a4 + 1ac: 85be mv a1,a5 + 1ae: 00000097 auipc ra,0x0 + 1b2: 000080e7 jalr ra # 1ae <.LVL35+0xe> + +000001b6 <.LVL36>: + 1b6: 00a05463 blez a0,1be <.L8> + 1ba: 02010e23 sb zero,60(sp) + +000001be <.L8>: + 1be: 57f2 lw a5,60(sp) + 1c0: 0017c513 xor a0,a5,1 + 1c4: 8905 and a0,a0,1 + 1c6: 00000097 auipc ra,0x0 + 1ca: 000080e7 jalr ra # 1c6 <.L8+0x8> + +000001ce <.LVL37>: + 1ce: 800007b7 lui a5,0x80000 + 1d2: fff7c713 not a4,a5 + 1d6: 8df9 and a1,a1,a4 + 1d8: 4712 lw a4,4(sp) + 1da: c02a sw a0,0(sp) + 1dc: 8ff9 and a5,a5,a4 + 1de: 8fcd or a5,a5,a1 + 1e0: c23e sw a5,4(sp) + +000001e2 <.LVL38>: + 1e2: 4785 li a5,1 + +000001e4 <.LVL39>: + 1e4: 00f10c23 sb a5,24(sp) + 1e8: 000007b7 lui a5,0x0 + 1ec: 0007a703 lw a4,0(a5) # 0 <__muldc3> + 1f0: 0047a783 lw a5,4(a5) + 1f4: de3a sw a4,60(sp) + 1f6: c0be sw a5,64(sp) + 1f8: 863a mv a2,a4 + 1fa: 86be mv a3,a5 + 1fc: 4722 lw a4,8(sp) + 1fe: 5782 lw a5,32(sp) + 200: 853a mv a0,a4 + +00000202 <.LVL40>: + 202: 85be mv a1,a5 + 204: 00000097 auipc ra,0x0 + 208: 000080e7 jalr ra # 204 <.LVL40+0x2> + +0000020c <.LVL41>: + 20c: ed19 bnez a0,22a <.L9> + 20e: 4722 lw a4,8(sp) + 210: 5782 lw a5,32(sp) + 212: 5672 lw a2,60(sp) + 214: 4686 lw a3,64(sp) + 216: 853a mv a0,a4 + 218: 85be mv a1,a5 + 21a: 00000097 auipc ra,0x0 + 21e: 000080e7 jalr ra # 21a <.LVL41+0xe> + +00000222 <.LVL42>: + 222: 00a05463 blez a0,22a <.L9> + 226: 00010c23 sb zero,24(sp) + +0000022a <.L9>: + 22a: 47e2 lw a5,24(sp) + 22c: 0017c513 xor a0,a5,1 + 230: 8905 and a0,a0,1 + 232: 00000097 auipc ra,0x0 + 236: 000080e7 jalr ra # 232 <.L9+0x8> + +0000023a <.LVL43>: + 23a: 800007b7 lui a5,0x80000 + 23e: fff7c713 not a4,a5 + 242: 8df9 and a1,a1,a4 + 244: 4732 lw a4,12(sp) + 246: c42a sw a0,8(sp) + 248: 8ff9 and a5,a5,a4 + 24a: 8fcd or a5,a5,a1 + 24c: 4742 lw a4,16(sp) + 24e: c63e sw a5,12(sp) + +00000250 <.LVL44>: + 250: 47d2 lw a5,20(sp) + +00000252 <.LVL45>: + 252: 863a mv a2,a4 + 254: 853a mv a0,a4 + +00000256 <.LVL46>: + 256: 86be mv a3,a5 + 258: 85be mv a1,a5 + 25a: 00000097 auipc ra,0x0 + 25e: 000080e7 jalr ra # 25a <.LVL46+0x4> + +00000262 <.LVL47>: + 262: cd11 beqz a0,27e <.L10> + 264: 46d2 lw a3,20(sp) + 266: 4701 li a4,0 + 268: 4781 li a5,0 + 26a: 0006d863 bgez a3,27a <.L12> + 26e: 000007b7 lui a5,0x0 + 272: 0007a703 lw a4,0(a5) # 0 <__muldc3> + 276: 0047a783 lw a5,4(a5) + +0000027a <.L12>: + 27a: c83a sw a4,16(sp) + 27c: ca3e sw a5,20(sp) + +0000027e <.L10>: + 27e: 8626 mv a2,s1 + 280: 86a2 mv a3,s0 + 282: 8526 mv a0,s1 + 284: 85a2 mv a1,s0 + 286: 00000097 auipc ra,0x0 + 28a: 000080e7 jalr ra # 286 <.L10+0x8> + +0000028e <.LVL49>: + 28e: cd09 beqz a0,2a8 <.L82> + 290: 4701 li a4,0 + 292: 4781 li a5,0 + 294: 00045863 bgez s0,2a4 <.L14> + 298: 000007b7 lui a5,0x0 + 29c: 0007a703 lw a4,0(a5) # 0 <__muldc3> + 2a0: 0047a783 lw a5,4(a5) + +000002a4 <.L14>: + 2a4: 84ba mv s1,a4 + 2a6: 843e mv s0,a5 + +000002a8 <.L82>: + 2a8: 4785 li a5,1 + 2aa: de3e sw a5,60(sp) + 2ac: a011 j 2b0 <.L7> + +000002ae <.L41>: + 2ae: de02 sw zero,60(sp) + +000002b0 <.L7>: + 2b0: 4752 lw a4,20(sp) + 2b2: 800007b7 lui a5,0x80000 + 2b6: fff7c793 not a5,a5 + 2ba: 8f7d and a4,a4,a5 + 2bc: 8fe1 and a5,a5,s0 + 2be: d03e sw a5,32(sp) + 2c0: 000007b7 lui a5,0x0 + 2c4: cc3a sw a4,24(sp) + 2c6: 0007a703 lw a4,0(a5) # 0 <__muldc3> + 2ca: 0047a783 lw a5,4(a5) + 2ce: ccba sw a4,88(sp) + 2d0: cebe sw a5,92(sp) + 2d2: 863a mv a2,a4 + 2d4: 86be mv a3,a5 + 2d6: 4742 lw a4,16(sp) + 2d8: 47e2 lw a5,24(sp) + 2da: 853a mv a0,a4 + 2dc: 85be mv a1,a5 + 2de: 00000097 auipc ra,0x0 + 2e2: 000080e7 jalr ra # 2de <.L7+0x2e> + +000002e6 <.LVL53>: + 2e6: ed09 bnez a0,300 <.L48> + 2e8: 4742 lw a4,16(sp) + 2ea: 47e2 lw a5,24(sp) + 2ec: 4666 lw a2,88(sp) + 2ee: 46f6 lw a3,92(sp) + 2f0: 853a mv a0,a4 + 2f2: 85be mv a1,a5 + 2f4: 00000097 auipc ra,0x0 + 2f8: 000080e7 jalr ra # 2f4 <.LVL53+0xe> + +000002fc <.LVL54>: + 2fc: 04a04063 bgtz a0,33c <.L15> + +00000300 <.L48>: + 300: 000007b7 lui a5,0x0 + 304: 0007a703 lw a4,0(a5) # 0 <__muldc3> + 308: 0047a783 lw a5,4(a5) + 30c: 8526 mv a0,s1 + 30e: 863a mv a2,a4 + 310: cebe sw a5,92(sp) + 312: 86be mv a3,a5 + 314: 5782 lw a5,32(sp) + 316: ccba sw a4,88(sp) + 318: 85be mv a1,a5 + 31a: 00000097 auipc ra,0x0 + 31e: 000080e7 jalr ra # 31a <.L48+0x1a> + +00000322 <.LVL55>: + 322: 22051663 bnez a0,54e <.L17> + 326: 5782 lw a5,32(sp) + 328: 4666 lw a2,88(sp) + 32a: 46f6 lw a3,92(sp) + 32c: 8526 mv a0,s1 + 32e: 85be mv a1,a5 + 330: 00000097 auipc ra,0x0 + 334: 000080e7 jalr ra # 330 <.LVL55+0xe> + +00000338 <.LVL56>: + 338: 20a05b63 blez a0,54e <.L17> + +0000033c <.L15>: + 33c: 4785 li a5,1 + 33e: 02f10223 sb a5,36(sp) + +00000342 <.LVL57>: + 342: 000007b7 lui a5,0x0 + 346: 0007a703 lw a4,0(a5) # 0 <__muldc3> + 34a: 0047a783 lw a5,4(a5) + 34e: d63a sw a4,44(sp) + 350: d83e sw a5,48(sp) + 352: 863a mv a2,a4 + 354: 86be mv a3,a5 + 356: 4742 lw a4,16(sp) + 358: 47e2 lw a5,24(sp) + 35a: 853a mv a0,a4 + 35c: 85be mv a1,a5 + 35e: 00000097 auipc ra,0x0 + 362: 000080e7 jalr ra # 35e <.LVL57+0x1c> + +00000366 <.LVL58>: + 366: ed19 bnez a0,384 <.L18> + 368: 4742 lw a4,16(sp) + 36a: 47e2 lw a5,24(sp) + 36c: 5632 lw a2,44(sp) + 36e: 56c2 lw a3,48(sp) + 370: 853a mv a0,a4 + 372: 85be mv a1,a5 + 374: 00000097 auipc ra,0x0 + 378: 000080e7 jalr ra # 374 <.LVL58+0xe> + +0000037c <.LVL59>: + 37c: 00a05463 blez a0,384 <.L18> + 380: 02010223 sb zero,36(sp) + +00000384 <.L18>: + 384: 5792 lw a5,36(sp) + 386: 0017c513 xor a0,a5,1 + 38a: 8905 and a0,a0,1 + 38c: 00000097 auipc ra,0x0 + 390: 000080e7 jalr ra # 38c <.L18+0x8> + +00000394 <.LVL60>: + 394: 800007b7 lui a5,0x80000 + 398: fff7c713 not a4,a5 + 39c: 8df9 and a1,a1,a4 + 39e: 4752 lw a4,20(sp) + 3a0: c82a sw a0,16(sp) + +000003a2 <.LVL61>: + 3a2: 8526 mv a0,s1 + 3a4: 8ff9 and a5,a5,a4 + 3a6: 8fcd or a5,a5,a1 + 3a8: ca3e sw a5,20(sp) + +000003aa <.LVL62>: + 3aa: 4785 li a5,1 + +000003ac <.LVL63>: + 3ac: 00f10c23 sb a5,24(sp) + 3b0: 000007b7 lui a5,0x0 + 3b4: 0007a703 lw a4,0(a5) # 0 <__muldc3> + 3b8: 0047a783 lw a5,4(a5) + 3bc: 863a mv a2,a4 + 3be: d43e sw a5,40(sp) + 3c0: 86be mv a3,a5 + 3c2: 5782 lw a5,32(sp) + 3c4: d23a sw a4,36(sp) + 3c6: 85be mv a1,a5 + 3c8: 00000097 auipc ra,0x0 + 3cc: 000080e7 jalr ra # 3c8 <.LVL63+0x1c> + +000003d0 <.LVL64>: + 3d0: ed11 bnez a0,3ec <.L19> + 3d2: 5782 lw a5,32(sp) + 3d4: 5612 lw a2,36(sp) + 3d6: 56a2 lw a3,40(sp) + 3d8: 8526 mv a0,s1 + 3da: 85be mv a1,a5 + 3dc: 00000097 auipc ra,0x0 + 3e0: 000080e7 jalr ra # 3dc <.LVL64+0xc> + +000003e4 <.LVL65>: + 3e4: 00a05463 blez a0,3ec <.L19> + 3e8: 00010c23 sb zero,24(sp) + +000003ec <.L19>: + 3ec: 47e2 lw a5,24(sp) + 3ee: 0017c513 xor a0,a5,1 + 3f2: 8905 and a0,a0,1 + 3f4: 00000097 auipc ra,0x0 + 3f8: 000080e7 jalr ra # 3f4 <.L19+0x8> + +000003fc <.LVL66>: + 3fc: 800007b7 lui a5,0x80000 + 400: fff7c713 not a4,a5 + 404: 8df9 and a1,a1,a4 + 406: 8fe1 and a5,a5,s0 + 408: 4702 lw a4,0(sp) + 40a: 00f5e433 or s0,a1,a5 + +0000040e <.LVL67>: + 40e: 4792 lw a5,4(sp) + 410: 84aa mv s1,a0 + 412: 863a mv a2,a4 + 414: 86be mv a3,a5 + 416: 853a mv a0,a4 + +00000418 <.LVL68>: + 418: 85be mv a1,a5 + 41a: 00000097 auipc ra,0x0 + 41e: 000080e7 jalr ra # 41a <.LVL68+0x2> + +00000422 <.LVL69>: + 422: cd11 beqz a0,43e <.L20> + 424: 4692 lw a3,4(sp) + 426: 4701 li a4,0 + 428: 4781 li a5,0 + 42a: 0006d863 bgez a3,43a <.L22> + 42e: 000007b7 lui a5,0x0 + 432: 0007a703 lw a4,0(a5) # 0 <__muldc3> + 436: 0047a783 lw a5,4(a5) + +0000043a <.L22>: + 43a: c03a sw a4,0(sp) + +0000043c <.LVL70>: + 43c: c23e sw a5,4(sp) + +0000043e <.L20>: + 43e: 4722 lw a4,8(sp) + 440: 47b2 lw a5,12(sp) + 442: 863a mv a2,a4 + 444: 86be mv a3,a5 + 446: 853a mv a0,a4 + 448: 85be mv a1,a5 + 44a: 00000097 auipc ra,0x0 + 44e: 000080e7 jalr ra # 44a <.L20+0xc> + +00000452 <.LVL72>: + 452: cd11 beqz a0,46e <.L23> + 454: 46b2 lw a3,12(sp) + 456: 4701 li a4,0 + 458: 4781 li a5,0 + 45a: 0006d863 bgez a3,46a <.L25> + 45e: 000007b7 lui a5,0x0 + 462: 0007a703 lw a4,0(a5) # 0 <__muldc3> + 466: 0047a783 lw a5,4(a5) + +0000046a <.L25>: + 46a: c43a sw a4,8(sp) + +0000046c <.LVL73>: + 46c: c63e sw a5,12(sp) + +0000046e <.L23>: + 46e: 47c2 lw a5,16(sp) + 470: 43d2 lw t2,20(sp) + 472: 4712 lw a4,4(sp) + 474: 863e mv a2,a5 + 476: cc3e sw a5,24(sp) + 478: 4782 lw a5,0(sp) + 47a: 869e mv a3,t2 + 47c: 85ba mv a1,a4 + 47e: 853e mv a0,a5 + 480: dc1e sw t2,56(sp) + +00000482 <.LVL75>: + 482: c83a sw a4,16(sp) + 484: da3e sw a5,52(sp) + 486: 00000097 auipc ra,0x0 + 48a: 000080e7 jalr ra # 486 <.LVL75+0x4> + +0000048e <.LVL76>: + 48e: 8626 mv a2,s1 + 490: 86a2 mv a3,s0 + 492: ca26 sw s1,20(sp) + 494: c222 sw s0,4(sp) + 496: 44a2 lw s1,8(sp) + 498: 4432 lw s0,12(sp) + 49a: c02a sw a0,0(sp) + 49c: d02e sw a1,32(sp) + 49e: 8526 mv a0,s1 + 4a0: 85a2 mv a1,s0 + 4a2: 00000097 auipc ra,0x0 + 4a6: 000080e7 jalr ra # 4a2 <.LVL76+0x14> + +000004aa <.LVL77>: + 4aa: 5282 lw t0,32(sp) + 4ac: 862a mv a2,a0 + 4ae: 4502 lw a0,0(sp) + 4b0: 86ae mv a3,a1 + 4b2: 8596 mv a1,t0 + 4b4: 00000097 auipc ra,0x0 + 4b8: 000080e7 jalr ra # 4b4 <.LVL77+0xa> + +000004bc <.LVL78>: + 4bc: 000002b7 lui t0,0x0 + 4c0: 0002a603 lw a2,0(t0) # 0 <__muldc3> + 4c4: 0042a683 lw a3,4(t0) + 4c8: 00000097 auipc ra,0x0 + 4cc: 000080e7 jalr ra # 4c8 <.LVL78+0xc> + +000004d0 <.LVL79>: + 4d0: 4712 lw a4,4(sp) + 4d2: 4352 lw t1,20(sp) + 4d4: 57d2 lw a5,52(sp) + 4d6: 86ba mv a3,a4 + 4d8: 4742 lw a4,16(sp) + 4da: 861a mv a2,t1 + 4dc: d22a sw a0,36(sp) + 4de: d62e sw a1,44(sp) + +000004e0 <.LVL80>: + 4e0: 853e mv a0,a5 + +000004e2 <.LVL81>: + 4e2: 85ba mv a1,a4 + +000004e4 <.LVL82>: + 4e4: 00000097 auipc ra,0x0 + 4e8: 000080e7 jalr ra # 4e4 <.LVL82> + +000004ec <.LVL83>: + 4ec: 53e2 lw t2,56(sp) + 4ee: c22a sw a0,4(sp) + 4f0: 4562 lw a0,24(sp) + 4f2: 869e mv a3,t2 + 4f4: c02e sw a1,0(sp) + 4f6: 862a mv a2,a0 + 4f8: 85a2 mv a1,s0 + 4fa: 8526 mv a0,s1 + 4fc: 00000097 auipc ra,0x0 + 500: 000080e7 jalr ra # 4fc <.LVL83+0x10> + +00000504 <.LVL84>: + 504: 4712 lw a4,4(sp) + 506: 4782 lw a5,0(sp) + 508: 862a mv a2,a0 + 50a: 86ae mv a3,a1 + 50c: 853a mv a0,a4 + 50e: 85be mv a1,a5 + 510: 00000097 auipc ra,0x0 + 514: 000080e7 jalr ra # 510 <.LVL84+0xc> + +00000518 <.LVL85>: + 518: 000002b7 lui t0,0x0 + 51c: 0002a603 lw a2,0(t0) # 0 <__muldc3> + 520: 0042a683 lw a3,4(t0) + 524: 00000097 auipc ra,0x0 + 528: 000080e7 jalr ra # 524 <.LVL85+0xc> + +0000052c <.LVL86>: + 52c: da2a sw a0,52(sp) + 52e: dc2e sw a1,56(sp) + +00000530 <.L2>: + 530: 4696 lw a3,68(sp) + 532: 5712 lw a4,36(sp) + 534: 57b2 lw a5,44(sp) + 536: 50e6 lw ra,120(sp) + 538: c298 sw a4,0(a3) + 53a: c2dc sw a5,4(a3) + 53c: 5752 lw a4,52(sp) + 53e: 57e2 lw a5,56(sp) + 540: 5456 lw s0,116(sp) + 542: c698 sw a4,8(a3) + 544: c6dc sw a5,12(a3) + 546: 54c6 lw s1,112(sp) + 548: 8536 mv a0,a3 + 54a: 6109 add sp,sp,128 + 54c: 8082 ret + +0000054e <.L17>: + 54e: 57f2 lw a5,60(sp) + 550: ff99 bnez a5,46e <.L23> + 552: 5786 lw a5,96(sp) + 554: 00000737 lui a4,0x0 + 558: 00072683 lw a3,0(a4) # 0 <__muldc3> + 55c: 4326 lw t1,72(sp) + 55e: 00472703 lw a4,4(a4) + 562: 0786 sll a5,a5,0x1 + 564: 8385 srl a5,a5,0x1 + 566: cc36 sw a3,24(sp) + 568: 8636 mv a2,a3 + 56a: 851a mv a0,t1 + 56c: 86ba mv a3,a4 + 56e: 85be mv a1,a5 + 570: ce3a sw a4,28(sp) + 572: d03e sw a5,32(sp) + 574: 00000097 auipc ra,0x0 + 578: 000080e7 jalr ra # 574 <.L17+0x26> + +0000057c <.LVL89>: + 57c: ed09 bnez a0,596 <.L51> + 57e: 4326 lw t1,72(sp) + 580: 5782 lw a5,32(sp) + 582: 4662 lw a2,24(sp) + 584: 46f2 lw a3,28(sp) + 586: 851a mv a0,t1 + 588: 85be mv a1,a5 + 58a: 00000097 auipc ra,0x0 + 58e: 000080e7 jalr ra # 58a <.LVL89+0xe> + +00000592 <.LVL90>: + 592: 0ca04963 bgtz a0,664 <.L26> + +00000596 <.L51>: + 596: 5796 lw a5,100(sp) + 598: 00000737 lui a4,0x0 + 59c: 00072683 lw a3,0(a4) # 0 <__muldc3> + 5a0: 4336 lw t1,76(sp) + 5a2: 00472703 lw a4,4(a4) + 5a6: 0786 sll a5,a5,0x1 + 5a8: 8385 srl a5,a5,0x1 + 5aa: cc36 sw a3,24(sp) + 5ac: 8636 mv a2,a3 + 5ae: 851a mv a0,t1 + 5b0: 86ba mv a3,a4 + 5b2: 85be mv a1,a5 + 5b4: ce3a sw a4,28(sp) + 5b6: d03e sw a5,32(sp) + 5b8: 00000097 auipc ra,0x0 + 5bc: 000080e7 jalr ra # 5b8 <.L51+0x22> + +000005c0 <.LVL91>: + 5c0: ed09 bnez a0,5da <.L52> + 5c2: 4336 lw t1,76(sp) + 5c4: 5782 lw a5,32(sp) + 5c6: 4662 lw a2,24(sp) + 5c8: 46f2 lw a3,28(sp) + 5ca: 851a mv a0,t1 + 5cc: 85be mv a1,a5 + 5ce: 00000097 auipc ra,0x0 + 5d2: 000080e7 jalr ra # 5ce <.LVL91+0xe> + +000005d6 <.LVL92>: + 5d6: 08a04763 bgtz a0,664 <.L26> + +000005da <.L52>: + 5da: 57a6 lw a5,104(sp) + 5dc: 00000737 lui a4,0x0 + 5e0: 00072683 lw a3,0(a4) # 0 <__muldc3> + 5e4: 4346 lw t1,80(sp) + 5e6: 00472703 lw a4,4(a4) + 5ea: 0786 sll a5,a5,0x1 + 5ec: 8385 srl a5,a5,0x1 + 5ee: cc36 sw a3,24(sp) + 5f0: 8636 mv a2,a3 + 5f2: 851a mv a0,t1 + 5f4: 86ba mv a3,a4 + 5f6: 85be mv a1,a5 + 5f8: ce3a sw a4,28(sp) + 5fa: d03e sw a5,32(sp) + 5fc: 00000097 auipc ra,0x0 + 600: 000080e7 jalr ra # 5fc <.L52+0x22> + +00000604 <.LVL93>: + 604: ed09 bnez a0,61e <.L53> + 606: 4346 lw t1,80(sp) + 608: 5782 lw a5,32(sp) + 60a: 4662 lw a2,24(sp) + 60c: 46f2 lw a3,28(sp) + 60e: 851a mv a0,t1 + 610: 85be mv a1,a5 + 612: 00000097 auipc ra,0x0 + 616: 000080e7 jalr ra # 612 <.LVL93+0xe> + +0000061a <.LVL94>: + 61a: 04a04563 bgtz a0,664 <.L26> + +0000061e <.L53>: + 61e: 57b6 lw a5,108(sp) + 620: 00000737 lui a4,0x0 + 624: 00072683 lw a3,0(a4) # 0 <__muldc3> + 628: 4356 lw t1,84(sp) + 62a: 00472703 lw a4,4(a4) + 62e: 0786 sll a5,a5,0x1 + 630: 8385 srl a5,a5,0x1 + 632: cc36 sw a3,24(sp) + 634: 8636 mv a2,a3 + 636: 851a mv a0,t1 + 638: 86ba mv a3,a4 + 63a: 85be mv a1,a5 + 63c: ce3a sw a4,28(sp) + 63e: d03e sw a5,32(sp) + 640: 00000097 auipc ra,0x0 + 644: 000080e7 jalr ra # 640 <.L53+0x22> + +00000648 <.LVL95>: + 648: ee0514e3 bnez a0,530 <.L2> + 64c: 4356 lw t1,84(sp) + 64e: 5782 lw a5,32(sp) + 650: 4662 lw a2,24(sp) + 652: 46f2 lw a3,28(sp) + 654: 851a mv a0,t1 + 656: 85be mv a1,a5 + 658: 00000097 auipc ra,0x0 + 65c: 000080e7 jalr ra # 658 <.LVL95+0x10> + +00000660 <.LVL96>: + 660: eca058e3 blez a0,530 <.L2> + +00000664 <.L26>: + 664: 4702 lw a4,0(sp) + 666: 4792 lw a5,4(sp) + 668: 863a mv a2,a4 + 66a: 86be mv a3,a5 + 66c: 853a mv a0,a4 + 66e: 85be mv a1,a5 + 670: 00000097 auipc ra,0x0 + 674: 000080e7 jalr ra # 670 <.L26+0xc> + +00000678 <.LVL97>: + 678: cd11 beqz a0,694 <.L30> + 67a: 4692 lw a3,4(sp) + 67c: 4701 li a4,0 + 67e: 4781 li a5,0 + 680: 0006d863 bgez a3,690 <.L32> + 684: 000007b7 lui a5,0x0 + 688: 0007a703 lw a4,0(a5) # 0 <__muldc3> + 68c: 0047a783 lw a5,4(a5) + +00000690 <.L32>: + 690: c03a sw a4,0(sp) + +00000692 <.LVL98>: + 692: c23e sw a5,4(sp) + +00000694 <.L30>: + 694: 4722 lw a4,8(sp) + 696: 47b2 lw a5,12(sp) + 698: 863a mv a2,a4 + 69a: 86be mv a3,a5 + 69c: 853a mv a0,a4 + 69e: 85be mv a1,a5 + 6a0: 00000097 auipc ra,0x0 + 6a4: 000080e7 jalr ra # 6a0 <.L30+0xc> + +000006a8 <.LVL100>: + 6a8: cd11 beqz a0,6c4 <.L33> + 6aa: 46b2 lw a3,12(sp) + 6ac: 4701 li a4,0 + 6ae: 4781 li a5,0 + 6b0: 0006d863 bgez a3,6c0 <.L35> + 6b4: 000007b7 lui a5,0x0 + 6b8: 0007a703 lw a4,0(a5) # 0 <__muldc3> + 6bc: 0047a783 lw a5,4(a5) + +000006c0 <.L35>: + 6c0: c43a sw a4,8(sp) + +000006c2 <.LVL101>: + 6c2: c63e sw a5,12(sp) + +000006c4 <.L33>: + 6c4: 4742 lw a4,16(sp) + 6c6: 47d2 lw a5,20(sp) + 6c8: 863a mv a2,a4 + 6ca: 86be mv a3,a5 + 6cc: 853a mv a0,a4 + 6ce: 85be mv a1,a5 + 6d0: 00000097 auipc ra,0x0 + 6d4: 000080e7 jalr ra # 6d0 <.L33+0xc> + +000006d8 <.LVL103>: + 6d8: cd11 beqz a0,6f4 <.L36> + 6da: 46d2 lw a3,20(sp) + 6dc: 4701 li a4,0 + 6de: 4781 li a5,0 + 6e0: 0006d863 bgez a3,6f0 <.L38> + 6e4: 000007b7 lui a5,0x0 + 6e8: 0007a703 lw a4,0(a5) # 0 <__muldc3> + 6ec: 0047a783 lw a5,4(a5) + +000006f0 <.L38>: + 6f0: c83a sw a4,16(sp) + +000006f2 <.LVL104>: + 6f2: ca3e sw a5,20(sp) + +000006f4 <.L36>: + 6f4: 8626 mv a2,s1 + 6f6: 86a2 mv a3,s0 + 6f8: 8526 mv a0,s1 + 6fa: 85a2 mv a1,s0 + 6fc: 00000097 auipc ra,0x0 + 700: 000080e7 jalr ra # 6fc <.L36+0x8> + +00000704 <.LVL106>: + 704: d60505e3 beqz a0,46e <.L23> + 708: 4701 li a4,0 + 70a: 4781 li a5,0 + 70c: 00045863 bgez s0,71c <.L40> + 710: 000007b7 lui a5,0x0 + 714: 0007a703 lw a4,0(a5) # 0 <__muldc3> + 718: 0047a783 lw a5,4(a5) + +0000071c <.L40>: + 71c: 84ba mv s1,a4 + +0000071e <.LVL107>: + 71e: 843e mv s0,a5 + +00000720 <.LVL108>: + 720: b3b9 j 46e <.L23> + +_mulxc3.o: file format elf32-littleriscv + + +_multc3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__multc3>: + 0: 419c lw a5,0(a1) + 2: ee810113 add sp,sp,-280 + 6: 10112a23 sw ra,276(sp) + a: c03e sw a5,0(sp) + c: 41dc lw a5,4(a1) + e: 10812823 sw s0,272(sp) + 12: 10912623 sw s1,268(sp) + 16: c23e sw a5,4(sp) + 18: 459c lw a5,8(a1) + 1a: c0aa sw a0,64(sp) + 1c: 19e8 add a0,sp,252 + 1e: c43e sw a5,8(sp) + 20: 45dc lw a5,12(a1) + 22: 11ec add a1,sp,236 + 24: c63e sw a5,12(sp) + 26: 421c lw a5,0(a2) + 28: c83e sw a5,16(sp) + 2a: 425c lw a5,4(a2) + 2c: ca3e sw a5,20(sp) + 2e: 461c lw a5,8(a2) + 30: cc3e sw a5,24(sp) + 32: 465c lw a5,12(a2) + 34: 09f0 add a2,sp,220 + 36: ce3e sw a5,28(sp) + 38: 429c lw a5,0(a3) + 3a: d03e sw a5,32(sp) + 3c: 42dc lw a5,4(a3) + 3e: d23e sw a5,36(sp) + 40: 469c lw a5,8(a3) + 42: d43e sw a5,40(sp) + 44: 46dc lw a5,12(a3) + 46: d63e sw a5,44(sp) + 48: 431c lw a5,0(a4) + 4a: d83e sw a5,48(sp) + 4c: 435c lw a5,4(a4) + 4e: da3e sw a5,52(sp) + 50: 471c lw a5,8(a4) + 52: dc3e sw a5,56(sp) + 54: 475c lw a5,12(a4) + 56: de3e sw a5,60(sp) + 58: 4782 lw a5,0(sp) + 5a: d7be sw a5,236(sp) + 5c: 4792 lw a5,4(sp) + 5e: d9be sw a5,240(sp) + 60: 47a2 lw a5,8(sp) + 62: dbbe sw a5,244(sp) + 64: 47b2 lw a5,12(sp) + 66: ddbe sw a5,248(sp) + 68: 5782 lw a5,32(sp) + 6a: cfbe sw a5,220(sp) + 6c: 5792 lw a5,36(sp) + 6e: d1be sw a5,224(sp) + 70: 57a2 lw a5,40(sp) + 72: d3be sw a5,228(sp) + 74: 57b2 lw a5,44(sp) + 76: d5be sw a5,232(sp) + 78: 00000097 auipc ra,0x0 + 7c: 000080e7 jalr ra # 78 <__multc3+0x78> + +00000080 <.LVL2>: + 80: 57fe lw a5,252(sp) + 82: 09f0 add a2,sp,220 + 84: 11ec add a1,sp,236 + 86: d4be sw a5,104(sp) + 88: 10012783 lw a5,256(sp) + 8c: 19e8 add a0,sp,252 + 8e: d6be sw a5,108(sp) + 90: 10412783 lw a5,260(sp) + 94: d8be sw a5,112(sp) + 96: 10812783 lw a5,264(sp) + 9a: cd3e sw a5,152(sp) + +0000009c <.LVL3>: + 9c: 47c2 lw a5,16(sp) + +0000009e <.LVL4>: + 9e: d7be sw a5,236(sp) + a0: 47d2 lw a5,20(sp) + a2: d9be sw a5,240(sp) + a4: 47e2 lw a5,24(sp) + a6: dbbe sw a5,244(sp) + a8: 47f2 lw a5,28(sp) + aa: ddbe sw a5,248(sp) + ac: 57c2 lw a5,48(sp) + ae: cfbe sw a5,220(sp) + b0: 57d2 lw a5,52(sp) + b2: d1be sw a5,224(sp) + b4: 57e2 lw a5,56(sp) + b6: d3be sw a5,228(sp) + b8: 57f2 lw a5,60(sp) + ba: d5be sw a5,232(sp) + bc: 00000097 auipc ra,0x0 + c0: 000080e7 jalr ra # bc <.LVL4+0x1e> + +000000c4 <.LVL5>: + c4: 57fe lw a5,252(sp) + c6: 09f0 add a2,sp,220 + c8: 11ec add a1,sp,236 + ca: dabe sw a5,116(sp) + cc: 10012783 lw a5,256(sp) + d0: 19e8 add a0,sp,252 + d2: dcbe sw a5,120(sp) + d4: 10412783 lw a5,260(sp) + d8: debe sw a5,124(sp) + da: 10812783 lw a5,264(sp) + de: cf3e sw a5,156(sp) + +000000e0 <.LVL6>: + e0: 4782 lw a5,0(sp) + +000000e2 <.LVL7>: + e2: d7be sw a5,236(sp) + e4: 4792 lw a5,4(sp) + e6: d9be sw a5,240(sp) + e8: 47a2 lw a5,8(sp) + ea: dbbe sw a5,244(sp) + ec: 47b2 lw a5,12(sp) + ee: ddbe sw a5,248(sp) + f0: 57c2 lw a5,48(sp) + f2: cfbe sw a5,220(sp) + f4: 57d2 lw a5,52(sp) + f6: d1be sw a5,224(sp) + f8: 57e2 lw a5,56(sp) + fa: d3be sw a5,228(sp) + fc: 57f2 lw a5,60(sp) + fe: d5be sw a5,232(sp) + 100: 00000097 auipc ra,0x0 + 104: 000080e7 jalr ra # 100 <.LVL7+0x1e> + +00000108 <.LVL8>: + 108: 57fe lw a5,252(sp) + 10a: 09f0 add a2,sp,220 + 10c: 11ec add a1,sp,236 + 10e: c13e sw a5,128(sp) + 110: 10012783 lw a5,256(sp) + 114: 19e8 add a0,sp,252 + 116: c33e sw a5,132(sp) + 118: 10412783 lw a5,260(sp) + 11c: c53e sw a5,136(sp) + 11e: 10812783 lw a5,264(sp) + 122: d13e sw a5,160(sp) + +00000124 <.LVL9>: + 124: 5782 lw a5,32(sp) + +00000126 <.LVL10>: + 126: d7be sw a5,236(sp) + 128: 5792 lw a5,36(sp) + 12a: d9be sw a5,240(sp) + 12c: 57a2 lw a5,40(sp) + 12e: dbbe sw a5,244(sp) + 130: 57b2 lw a5,44(sp) + 132: ddbe sw a5,248(sp) + 134: 47c2 lw a5,16(sp) + 136: cfbe sw a5,220(sp) + 138: 47d2 lw a5,20(sp) + 13a: d1be sw a5,224(sp) + 13c: 47e2 lw a5,24(sp) + 13e: d3be sw a5,228(sp) + 140: 47f2 lw a5,28(sp) + 142: d5be sw a5,232(sp) + 144: 00000097 auipc ra,0x0 + 148: 000080e7 jalr ra # 144 <.LVL10+0x1e> + +0000014c <.LVL11>: + 14c: 57fe lw a5,252(sp) + 14e: 09f0 add a2,sp,220 + 150: 11ec add a1,sp,236 + 152: c73e sw a5,140(sp) + 154: 10012783 lw a5,256(sp) + 158: 19e8 add a0,sp,252 + 15a: c93e sw a5,144(sp) + 15c: 10412783 lw a5,260(sp) + 160: cb3e sw a5,148(sp) + 162: 10812783 lw a5,264(sp) + 166: d33e sw a5,164(sp) + +00000168 <.LVL12>: + 168: 57a6 lw a5,104(sp) + +0000016a <.LVL13>: + 16a: d7be sw a5,236(sp) + 16c: 57b6 lw a5,108(sp) + 16e: d9be sw a5,240(sp) + 170: 57c6 lw a5,112(sp) + 172: dbbe sw a5,244(sp) + 174: 47ea lw a5,152(sp) + 176: ddbe sw a5,248(sp) + 178: 57d6 lw a5,116(sp) + 17a: cfbe sw a5,220(sp) + 17c: 57e6 lw a5,120(sp) + 17e: d1be sw a5,224(sp) + 180: 57f6 lw a5,124(sp) + 182: d3be sw a5,228(sp) + 184: 47fa lw a5,156(sp) + 186: d5be sw a5,232(sp) + 188: 00000097 auipc ra,0x0 + 18c: 000080e7 jalr ra # 188 <.LVL13+0x1e> + +00000190 <.LVL14>: + 190: 57fe lw a5,252(sp) + 192: 11ec add a1,sp,236 + 194: 19e8 add a0,sp,252 + 196: c2be sw a5,68(sp) + 198: 10012783 lw a5,256(sp) + 19c: 09f0 add a2,sp,220 + 19e: c4be sw a5,72(sp) + 1a0: 10412783 lw a5,260(sp) + 1a4: c6be sw a5,76(sp) + 1a6: 10812783 lw a5,264(sp) + 1aa: c8be sw a5,80(sp) + +000001ac <.LVL15>: + 1ac: 478a lw a5,128(sp) + +000001ae <.LVL16>: + 1ae: d7be sw a5,236(sp) + 1b0: 479a lw a5,132(sp) + 1b2: d9be sw a5,240(sp) + 1b4: 47aa lw a5,136(sp) + 1b6: dbbe sw a5,244(sp) + 1b8: 578a lw a5,160(sp) + 1ba: ddbe sw a5,248(sp) + 1bc: 47ba lw a5,140(sp) + 1be: cfbe sw a5,220(sp) + 1c0: 47ca lw a5,144(sp) + 1c2: d1be sw a5,224(sp) + 1c4: 47da lw a5,148(sp) + 1c6: d3be sw a5,228(sp) + 1c8: 579a lw a5,164(sp) + 1ca: d5be sw a5,232(sp) + 1cc: 00000097 auipc ra,0x0 + 1d0: 000080e7 jalr ra # 1cc <.LVL16+0x1e> + +000001d4 <.LVL17>: + 1d4: 57fe lw a5,252(sp) + 1d6: 11ec add a1,sp,236 + 1d8: 19e8 add a0,sp,252 + 1da: cabe sw a5,84(sp) + 1dc: 10012783 lw a5,256(sp) + 1e0: ccbe sw a5,88(sp) + 1e2: 10412783 lw a5,260(sp) + 1e6: cebe sw a5,92(sp) + 1e8: 10812783 lw a5,264(sp) + 1ec: d0be sw a5,96(sp) + +000001ee <.LVL18>: + 1ee: 4796 lw a5,68(sp) + +000001f0 <.LVL19>: + 1f0: dfbe sw a5,252(sp) + +000001f2 <.LVL20>: + 1f2: 47a6 lw a5,72(sp) + 1f4: 10f12023 sw a5,256(sp) + +000001f8 <.LVL21>: + 1f8: 47b6 lw a5,76(sp) + 1fa: 10f12223 sw a5,260(sp) + +000001fe <.LVL22>: + 1fe: 47c6 lw a5,80(sp) + 200: 10f12423 sw a5,264(sp) + +00000204 <.LVL23>: + 204: 4796 lw a5,68(sp) + 206: d7be sw a5,236(sp) + 208: 47a6 lw a5,72(sp) + 20a: d9be sw a5,240(sp) + 20c: 47b6 lw a5,76(sp) + 20e: dbbe sw a5,244(sp) + 210: 47c6 lw a5,80(sp) + 212: ddbe sw a5,248(sp) + 214: 00000097 auipc ra,0x0 + 218: 000080e7 jalr ra # 214 <.LVL23+0x10> + +0000021c <.LVL24>: + 21c: 66050063 beqz a0,87c <.L2> + 220: 47d6 lw a5,84(sp) + 222: 11ec add a1,sp,236 + 224: 19e8 add a0,sp,252 + 226: dfbe sw a5,252(sp) + 228: 47e6 lw a5,88(sp) + 22a: 10f12023 sw a5,256(sp) + 22e: 47f6 lw a5,92(sp) + 230: 10f12223 sw a5,260(sp) + 234: 5786 lw a5,96(sp) + 236: 10f12423 sw a5,264(sp) + 23a: 47d6 lw a5,84(sp) + 23c: d7be sw a5,236(sp) + 23e: 47e6 lw a5,88(sp) + 240: d9be sw a5,240(sp) + 242: 47f6 lw a5,92(sp) + 244: dbbe sw a5,244(sp) + 246: 5786 lw a5,96(sp) + 248: ddbe sw a5,248(sp) + 24a: 00000097 auipc ra,0x0 + 24e: 000080e7 jalr ra # 24a <.LVL24+0x2e> + +00000252 <.LVL25>: + 252: 62050563 beqz a0,87c <.L2> + +00000256 <.LBB2>: + 256: 4732 lw a4,12(sp) + 258: 800007b7 lui a5,0x80000 + 25c: fff7c793 not a5,a5 + 260: 00f774b3 and s1,a4,a5 + 264: 4772 lw a4,28(sp) + 266: 547d li s0,-1 + 268: 11ec add a1,sp,236 + 26a: 8ff9 and a5,a5,a4 + 26c: 00000737 lui a4,0x0 + 270: d2be sw a5,100(sp) + 272: 00c72783 lw a5,12(a4) # c <__multc3+0xc> + 276: 19e8 add a0,sp,252 + 278: 10912423 sw s1,264(sp) + 27c: d53e sw a5,168(sp) + 27e: 4782 lw a5,0(sp) + 280: d7a2 sw s0,236(sp) + 282: d9a2 sw s0,240(sp) + 284: dfbe sw a5,252(sp) + 286: 4792 lw a5,4(sp) + 288: dba2 sw s0,244(sp) + 28a: 10f12023 sw a5,256(sp) + 28e: 47a2 lw a5,8(sp) + 290: 10f12223 sw a5,260(sp) + 294: 57aa lw a5,168(sp) + 296: ddbe sw a5,248(sp) + 298: 00000097 auipc ra,0x0 + 29c: 000080e7 jalr ra # 298 <.LBB2+0x42> + +000002a0 <.LVL27>: + 2a0: e909 bnez a0,2b2 <.L45> + 2a2: 11ec add a1,sp,236 + 2a4: 19e8 add a0,sp,252 + 2a6: 00000097 auipc ra,0x0 + 2aa: 000080e7 jalr ra # 2a6 <.LVL27+0x6> + +000002ae <.LVL28>: + 2ae: 04a04863 bgtz a0,2fe <.L5> + +000002b2 <.L45>: + 2b2: 00000737 lui a4,0x0 + 2b6: 00c72783 lw a5,12(a4) # c <__multc3+0xc> + 2ba: 547d li s0,-1 + 2bc: 11ec add a1,sp,236 + 2be: d53e sw a5,168(sp) + 2c0: 47c2 lw a5,16(sp) + 2c2: 19e8 add a0,sp,252 + 2c4: d7a2 sw s0,236(sp) + 2c6: dfbe sw a5,252(sp) + 2c8: 47d2 lw a5,20(sp) + 2ca: d9a2 sw s0,240(sp) + 2cc: dba2 sw s0,244(sp) + 2ce: 10f12023 sw a5,256(sp) + 2d2: 47e2 lw a5,24(sp) + 2d4: 10f12223 sw a5,260(sp) + 2d8: 5796 lw a5,100(sp) + 2da: 10f12423 sw a5,264(sp) + 2de: 57aa lw a5,168(sp) + 2e0: ddbe sw a5,248(sp) + 2e2: 00000097 auipc ra,0x0 + 2e6: 000080e7 jalr ra # 2e2 <.L45+0x30> + +000002ea <.LVL29>: + 2ea: 1a051763 bnez a0,498 <.L41> + 2ee: 11ec add a1,sp,236 + 2f0: 19e8 add a0,sp,252 + 2f2: 00000097 auipc ra,0x0 + 2f6: 000080e7 jalr ra # 2f2 <.LVL29+0x8> + +000002fa <.LVL30>: + 2fa: 18a05f63 blez a0,498 <.L41> + +000002fe <.L5>: + 2fe: 00000737 lui a4,0x0 + 302: 00c72703 lw a4,12(a4) # c <__multc3+0xc> + 306: 57fd li a5,-1 + 308: d7be sw a5,236(sp) + 30a: d53a sw a4,168(sp) + 30c: 4702 lw a4,0(sp) + 30e: d9be sw a5,240(sp) + 310: dbbe sw a5,244(sp) + 312: dfba sw a4,252(sp) + 314: 4712 lw a4,4(sp) + 316: 57aa lw a5,168(sp) + 318: 11ec add a1,sp,236 + 31a: 10e12023 sw a4,256(sp) + 31e: 4722 lw a4,8(sp) + 320: 19e8 add a0,sp,252 + 322: 4405 li s0,1 + 324: 10e12223 sw a4,260(sp) + 328: 10912423 sw s1,264(sp) + 32c: ddbe sw a5,248(sp) + 32e: 00000097 auipc ra,0x0 + 332: 000080e7 jalr ra # 32e <.L5+0x30> + +00000336 <.LVL31>: + 336: e911 bnez a0,34a <.L8> + 338: 11ec add a1,sp,236 + 33a: 19e8 add a0,sp,252 + 33c: 00000097 auipc ra,0x0 + 340: 000080e7 jalr ra # 33c <.LVL31+0x6> + +00000344 <.LVL32>: + 344: 00a05363 blez a0,34a <.L8> + 348: 4401 li s0,0 + +0000034a <.L8>: + 34a: 00144593 xor a1,s0,1 + 34e: 8985 and a1,a1,1 + 350: 19e8 add a0,sp,252 + 352: 00000097 auipc ra,0x0 + 356: 000080e7 jalr ra # 352 <.L8+0x8> + +0000035a <.LVL33>: + 35a: 10812703 lw a4,264(sp) + 35e: 800007b7 lui a5,0x80000 + 362: fff7c693 not a3,a5 + 366: 8f75 and a4,a4,a3 + 368: 46b2 lw a3,12(sp) + 36a: 54fd li s1,-1 + 36c: 11ec add a1,sp,236 + 36e: 8ff5 and a5,a5,a3 + 370: 8fd9 or a5,a5,a4 + 372: 00000737 lui a4,0x0 + 376: c63e sw a5,12(sp) + +00000378 <.LVL34>: + 378: 00c72783 lw a5,12(a4) # c <__multc3+0xc> + +0000037c <.LVL35>: + 37c: 56fe lw a3,252(sp) + 37e: 19e8 add a0,sp,252 + +00000380 <.LVL36>: + 380: d53e sw a5,168(sp) + 382: 47c2 lw a5,16(sp) + 384: c036 sw a3,0(sp) + 386: 10012683 lw a3,256(sp) + +0000038a <.LVL37>: + 38a: dfbe sw a5,252(sp) + 38c: 47d2 lw a5,20(sp) + 38e: c236 sw a3,4(sp) + 390: 10412683 lw a3,260(sp) + 394: 10f12023 sw a5,256(sp) + +00000398 <.LVL38>: + 398: 47e2 lw a5,24(sp) + 39a: c436 sw a3,8(sp) + 39c: 4405 li s0,1 + 39e: 10f12223 sw a5,260(sp) + +000003a2 <.LVL39>: + 3a2: 5796 lw a5,100(sp) + 3a4: d7a6 sw s1,236(sp) + 3a6: d9a6 sw s1,240(sp) + 3a8: 10f12423 sw a5,264(sp) + 3ac: 57aa lw a5,168(sp) + 3ae: dba6 sw s1,244(sp) + 3b0: ddbe sw a5,248(sp) + 3b2: 00000097 auipc ra,0x0 + 3b6: 000080e7 jalr ra # 3b2 <.LVL39+0x10> + +000003ba <.LVL40>: + 3ba: e911 bnez a0,3ce <.L9> + 3bc: 11ec add a1,sp,236 + 3be: 19e8 add a0,sp,252 + 3c0: 00000097 auipc ra,0x0 + 3c4: 000080e7 jalr ra # 3c0 <.LVL40+0x6> + +000003c8 <.LVL41>: + 3c8: 00a05363 blez a0,3ce <.L9> + 3cc: 4401 li s0,0 + +000003ce <.L9>: + 3ce: 00144593 xor a1,s0,1 + 3d2: 8985 and a1,a1,1 + 3d4: 19e8 add a0,sp,252 + 3d6: 00000097 auipc ra,0x0 + 3da: 000080e7 jalr ra # 3d6 <.L9+0x8> + +000003de <.LVL42>: + 3de: 10812703 lw a4,264(sp) + 3e2: 800007b7 lui a5,0x80000 + 3e6: fff7c693 not a3,a5 + 3ea: 8f75 and a4,a4,a3 + 3ec: 46f2 lw a3,28(sp) + 3ee: 11ec add a1,sp,236 + 3f0: 19e8 add a0,sp,252 + 3f2: 8ff5 and a5,a5,a3 + 3f4: 8fd9 or a5,a5,a4 + 3f6: ce3e sw a5,28(sp) + +000003f8 <.LVL43>: + 3f8: 5782 lw a5,32(sp) + +000003fa <.LVL44>: + 3fa: 56fe lw a3,252(sp) + 3fc: dfbe sw a5,252(sp) + +000003fe <.LVL45>: + 3fe: 5792 lw a5,36(sp) + 400: c836 sw a3,16(sp) + 402: 10012683 lw a3,256(sp) + +00000406 <.LVL46>: + 406: 10f12023 sw a5,256(sp) + +0000040a <.LVL47>: + 40a: 57a2 lw a5,40(sp) + 40c: ca36 sw a3,20(sp) + 40e: 10412683 lw a3,260(sp) + +00000412 <.LVL48>: + 412: 10f12223 sw a5,260(sp) + +00000416 <.LVL49>: + 416: 57b2 lw a5,44(sp) + 418: cc36 sw a3,24(sp) + 41a: 10f12423 sw a5,264(sp) + 41e: 5782 lw a5,32(sp) + 420: d7be sw a5,236(sp) + 422: 5792 lw a5,36(sp) + 424: d9be sw a5,240(sp) + 426: 57a2 lw a5,40(sp) + 428: dbbe sw a5,244(sp) + 42a: 57b2 lw a5,44(sp) + 42c: ddbe sw a5,248(sp) + 42e: 00000097 auipc ra,0x0 + 432: 000080e7 jalr ra # 42e <.LVL49+0x18> + +00000436 <.LVL50>: + 436: c919 beqz a0,44c <.L10> + 438: 5732 lw a4,44(sp) + 43a: 4781 li a5,0 + 43c: 00075463 bgez a4,444 <.L12> + 440: 800007b7 lui a5,0x80000 + +00000444 <.L12>: + 444: d002 sw zero,32(sp) + 446: d202 sw zero,36(sp) + 448: d402 sw zero,40(sp) + 44a: d63e sw a5,44(sp) + +0000044c <.L10>: + 44c: 57c2 lw a5,48(sp) + 44e: 11ec add a1,sp,236 + 450: 19e8 add a0,sp,252 + 452: dfbe sw a5,252(sp) + 454: 57d2 lw a5,52(sp) + 456: 10f12023 sw a5,256(sp) + 45a: 57e2 lw a5,56(sp) + 45c: 10f12223 sw a5,260(sp) + 460: 57f2 lw a5,60(sp) + 462: 10f12423 sw a5,264(sp) + 466: 57c2 lw a5,48(sp) + 468: d7be sw a5,236(sp) + 46a: 57d2 lw a5,52(sp) + 46c: d9be sw a5,240(sp) + 46e: 57e2 lw a5,56(sp) + 470: dbbe sw a5,244(sp) + 472: 57f2 lw a5,60(sp) + 474: ddbe sw a5,248(sp) + 476: 00000097 auipc ra,0x0 + 47a: 000080e7 jalr ra # 476 <.L10+0x2a> + +0000047e <.LVL52>: + 47e: c919 beqz a0,494 <.L82> + 480: 5772 lw a4,60(sp) + 482: 4781 li a5,0 + 484: 00075463 bgez a4,48c <.L14> + 488: 800007b7 lui a5,0x80000 + +0000048c <.L14>: + 48c: d802 sw zero,48(sp) + 48e: da02 sw zero,52(sp) + 490: dc02 sw zero,56(sp) + 492: de3e sw a5,60(sp) + +00000494 <.L82>: + 494: 4485 li s1,1 + 496: a011 j 49a <.L7> + +00000498 <.L41>: + 498: 4481 li s1,0 + +0000049a <.L7>: + 49a: 5732 lw a4,44(sp) + 49c: 800007b7 lui a5,0x80000 + 4a0: fff7c793 not a5,a5 + 4a4: 00f77433 and s0,a4,a5 + 4a8: 5772 lw a4,60(sp) + 4aa: 11ec add a1,sp,236 + 4ac: 19e8 add a0,sp,252 + 4ae: 8ff9 and a5,a5,a4 + 4b0: 00000737 lui a4,0x0 + 4b4: 00c72703 lw a4,12(a4) # c <__multc3+0xc> + 4b8: d2be sw a5,100(sp) + 4ba: 57fd li a5,-1 + 4bc: d53a sw a4,168(sp) + 4be: 5702 lw a4,32(sp) + 4c0: d7be sw a5,236(sp) + 4c2: d9be sw a5,240(sp) + 4c4: dfba sw a4,252(sp) + 4c6: 5712 lw a4,36(sp) + 4c8: dbbe sw a5,244(sp) + 4ca: 57aa lw a5,168(sp) + 4cc: 10e12023 sw a4,256(sp) + 4d0: 5722 lw a4,40(sp) + 4d2: 10812423 sw s0,264(sp) + 4d6: ddbe sw a5,248(sp) + 4d8: 10e12223 sw a4,260(sp) + 4dc: 00000097 auipc ra,0x0 + 4e0: 000080e7 jalr ra # 4dc <.L7+0x42> + +000004e4 <.LVL56>: + 4e4: e909 bnez a0,4f6 <.L48> + 4e6: 11ec add a1,sp,236 + 4e8: 19e8 add a0,sp,252 + 4ea: 00000097 auipc ra,0x0 + 4ee: 000080e7 jalr ra # 4ea <.LVL56+0x6> + +000004f2 <.LVL57>: + 4f2: 04a04863 bgtz a0,542 <.L15> + +000004f6 <.L48>: + 4f6: 00000737 lui a4,0x0 + 4fa: 00c72703 lw a4,12(a4) # c <__multc3+0xc> + 4fe: 57fd li a5,-1 + 500: d7be sw a5,236(sp) + 502: d53a sw a4,168(sp) + 504: 5742 lw a4,48(sp) + 506: d9be sw a5,240(sp) + 508: dbbe sw a5,244(sp) + 50a: dfba sw a4,252(sp) + 50c: 5752 lw a4,52(sp) + 50e: 57aa lw a5,168(sp) + 510: 11ec add a1,sp,236 + 512: 10e12023 sw a4,256(sp) + 516: 5762 lw a4,56(sp) + 518: 19e8 add a0,sp,252 + 51a: ddbe sw a5,248(sp) + 51c: 10e12223 sw a4,260(sp) + 520: 5716 lw a4,100(sp) + 522: 10e12423 sw a4,264(sp) + 526: 00000097 auipc ra,0x0 + 52a: 000080e7 jalr ra # 526 <.L48+0x30> + +0000052e <.LVL58>: + 52e: 38051263 bnez a0,8b2 <.L17> + 532: 11ec add a1,sp,236 + 534: 19e8 add a0,sp,252 + 536: 00000097 auipc ra,0x0 + 53a: 000080e7 jalr ra # 536 <.LVL58+0x8> + +0000053e <.LVL59>: + 53e: 36a05a63 blez a0,8b2 <.L17> + +00000542 <.L15>: + 542: 00000737 lui a4,0x0 + 546: 00c72703 lw a4,12(a4) # c <__multc3+0xc> + 54a: 57fd li a5,-1 + 54c: d7be sw a5,236(sp) + 54e: c2ba sw a4,68(sp) + +00000550 <.LVL60>: + 550: 5702 lw a4,32(sp) + 552: d9be sw a5,240(sp) + 554: dbbe sw a5,244(sp) + 556: dfba sw a4,252(sp) + 558: 5712 lw a4,36(sp) + 55a: 4796 lw a5,68(sp) + 55c: 11ec add a1,sp,236 + 55e: 10e12023 sw a4,256(sp) + 562: 5722 lw a4,40(sp) + 564: 19e8 add a0,sp,252 + 566: 4485 li s1,1 + +00000568 <.LVL61>: + 568: 10e12223 sw a4,260(sp) + 56c: 10812423 sw s0,264(sp) + 570: ddbe sw a5,248(sp) + 572: 00000097 auipc ra,0x0 + 576: 000080e7 jalr ra # 572 <.LVL61+0xa> + +0000057a <.LVL62>: + 57a: e911 bnez a0,58e <.L18> + 57c: 11ec add a1,sp,236 + 57e: 19e8 add a0,sp,252 + 580: 00000097 auipc ra,0x0 + 584: 000080e7 jalr ra # 580 <.LVL62+0x6> + +00000588 <.LVL63>: + 588: 00a05363 blez a0,58e <.L18> + 58c: 4481 li s1,0 + +0000058e <.L18>: + 58e: 0014c593 xor a1,s1,1 + 592: 8985 and a1,a1,1 + 594: 19e8 add a0,sp,252 + 596: 00000097 auipc ra,0x0 + 59a: 000080e7 jalr ra # 596 <.L18+0x8> + +0000059e <.LVL64>: + 59e: 10812703 lw a4,264(sp) + 5a2: 800007b7 lui a5,0x80000 + 5a6: fff7c693 not a3,a5 + 5aa: 8f75 and a4,a4,a3 + 5ac: 56b2 lw a3,44(sp) + 5ae: 54fd li s1,-1 + 5b0: 11ec add a1,sp,236 + 5b2: 8ff5 and a5,a5,a3 + 5b4: 8fd9 or a5,a5,a4 + 5b6: 00000737 lui a4,0x0 + 5ba: d63e sw a5,44(sp) + +000005bc <.LVL65>: + 5bc: 00c72783 lw a5,12(a4) # c <__multc3+0xc> + +000005c0 <.LVL66>: + 5c0: 56fe lw a3,252(sp) + 5c2: 19e8 add a0,sp,252 + +000005c4 <.LVL67>: + 5c4: c2be sw a5,68(sp) + 5c6: 57c2 lw a5,48(sp) + 5c8: d036 sw a3,32(sp) + 5ca: 10012683 lw a3,256(sp) + +000005ce <.LVL68>: + 5ce: dfbe sw a5,252(sp) + +000005d0 <.LVL69>: + 5d0: 57d2 lw a5,52(sp) + 5d2: d236 sw a3,36(sp) + 5d4: 10412683 lw a3,260(sp) + 5d8: 10f12023 sw a5,256(sp) + +000005dc <.LVL70>: + 5dc: 57e2 lw a5,56(sp) + 5de: d436 sw a3,40(sp) + 5e0: 4405 li s0,1 + 5e2: 10f12223 sw a5,260(sp) + +000005e6 <.LVL71>: + 5e6: 5796 lw a5,100(sp) + 5e8: d7a6 sw s1,236(sp) + 5ea: d9a6 sw s1,240(sp) + 5ec: 10f12423 sw a5,264(sp) + 5f0: 4796 lw a5,68(sp) + 5f2: dba6 sw s1,244(sp) + 5f4: ddbe sw a5,248(sp) + 5f6: 00000097 auipc ra,0x0 + 5fa: 000080e7 jalr ra # 5f6 <.LVL71+0x10> + +000005fe <.LVL72>: + 5fe: e911 bnez a0,612 <.L19> + 600: 11ec add a1,sp,236 + 602: 19e8 add a0,sp,252 + 604: 00000097 auipc ra,0x0 + 608: 000080e7 jalr ra # 604 <.LVL72+0x6> + +0000060c <.LVL73>: + 60c: 00a05363 blez a0,612 <.L19> + 610: 4401 li s0,0 + +00000612 <.L19>: + 612: 00144593 xor a1,s0,1 + 616: 8985 and a1,a1,1 + 618: 19e8 add a0,sp,252 + 61a: 00000097 auipc ra,0x0 + 61e: 000080e7 jalr ra # 61a <.L19+0x8> + +00000622 <.LVL74>: + 622: 10812703 lw a4,264(sp) + 626: 800007b7 lui a5,0x80000 + 62a: fff7c693 not a3,a5 + 62e: 8f75 and a4,a4,a3 + 630: 56f2 lw a3,60(sp) + 632: 11ec add a1,sp,236 + 634: 19e8 add a0,sp,252 + 636: 8ff5 and a5,a5,a3 + 638: 8fd9 or a5,a5,a4 + 63a: de3e sw a5,60(sp) + +0000063c <.LVL75>: + 63c: 4782 lw a5,0(sp) + +0000063e <.LVL76>: + 63e: 56fe lw a3,252(sp) + 640: dfbe sw a5,252(sp) + +00000642 <.LVL77>: + 642: 4792 lw a5,4(sp) + 644: d836 sw a3,48(sp) + 646: 10012683 lw a3,256(sp) + +0000064a <.LVL78>: + 64a: 10f12023 sw a5,256(sp) + +0000064e <.LVL79>: + 64e: 47a2 lw a5,8(sp) + 650: da36 sw a3,52(sp) + 652: 10412683 lw a3,260(sp) + +00000656 <.LVL80>: + 656: 10f12223 sw a5,260(sp) + +0000065a <.LVL81>: + 65a: 47b2 lw a5,12(sp) + 65c: dc36 sw a3,56(sp) + 65e: 10f12423 sw a5,264(sp) + 662: 4782 lw a5,0(sp) + 664: d7be sw a5,236(sp) + 666: 4792 lw a5,4(sp) + 668: d9be sw a5,240(sp) + 66a: 47a2 lw a5,8(sp) + 66c: dbbe sw a5,244(sp) + 66e: 47b2 lw a5,12(sp) + 670: ddbe sw a5,248(sp) + 672: 00000097 auipc ra,0x0 + 676: 000080e7 jalr ra # 672 <.LVL81+0x18> + +0000067a <.LVL82>: + 67a: c919 beqz a0,690 <.L20> + 67c: 4732 lw a4,12(sp) + 67e: 4781 li a5,0 + 680: 00075463 bgez a4,688 <.L22> + 684: 800007b7 lui a5,0x80000 + +00000688 <.L22>: + 688: c002 sw zero,0(sp) + +0000068a <.LVL83>: + 68a: c202 sw zero,4(sp) + 68c: c402 sw zero,8(sp) + 68e: c63e sw a5,12(sp) + +00000690 <.L20>: + 690: 47c2 lw a5,16(sp) + 692: 11ec add a1,sp,236 + 694: 19e8 add a0,sp,252 + 696: dfbe sw a5,252(sp) + 698: 47d2 lw a5,20(sp) + 69a: 10f12023 sw a5,256(sp) + 69e: 47e2 lw a5,24(sp) + 6a0: 10f12223 sw a5,260(sp) + 6a4: 47f2 lw a5,28(sp) + 6a6: 10f12423 sw a5,264(sp) + 6aa: 47c2 lw a5,16(sp) + 6ac: d7be sw a5,236(sp) + 6ae: 47d2 lw a5,20(sp) + 6b0: d9be sw a5,240(sp) + 6b2: 47e2 lw a5,24(sp) + 6b4: dbbe sw a5,244(sp) + 6b6: 47f2 lw a5,28(sp) + 6b8: ddbe sw a5,248(sp) + 6ba: 00000097 auipc ra,0x0 + 6be: 000080e7 jalr ra # 6ba <.L20+0x2a> + +000006c2 <.LVL85>: + 6c2: c919 beqz a0,6d8 <.L23> + 6c4: 4772 lw a4,28(sp) + 6c6: 4781 li a5,0 + 6c8: 00075463 bgez a4,6d0 <.L25> + 6cc: 800007b7 lui a5,0x80000 + +000006d0 <.L25>: + 6d0: c802 sw zero,16(sp) + +000006d2 <.LVL86>: + 6d2: ca02 sw zero,20(sp) + 6d4: cc02 sw zero,24(sp) + 6d6: ce3e sw a5,28(sp) + +000006d8 <.L23>: + 6d8: 4782 lw a5,0(sp) + 6da: 09f0 add a2,sp,220 + 6dc: 11ec add a1,sp,236 + 6de: d7be sw a5,236(sp) + 6e0: 4792 lw a5,4(sp) + 6e2: 19e8 add a0,sp,252 + 6e4: d9be sw a5,240(sp) + 6e6: 47a2 lw a5,8(sp) + 6e8: dbbe sw a5,244(sp) + 6ea: 47b2 lw a5,12(sp) + 6ec: ddbe sw a5,248(sp) + 6ee: 5782 lw a5,32(sp) + 6f0: cfbe sw a5,220(sp) + 6f2: 5792 lw a5,36(sp) + 6f4: d1be sw a5,224(sp) + 6f6: 57a2 lw a5,40(sp) + 6f8: d3be sw a5,228(sp) + 6fa: 57b2 lw a5,44(sp) + 6fc: d5be sw a5,232(sp) + 6fe: 00000097 auipc ra,0x0 + 702: 000080e7 jalr ra # 6fe <.L23+0x26> + +00000706 <.LVL88>: + 706: 47c2 lw a5,16(sp) + 708: 537e lw t1,252(sp) + 70a: 10012683 lw a3,256(sp) + 70e: cfbe sw a5,220(sp) + 710: 47d2 lw a5,20(sp) + 712: 01f0 add a2,sp,204 + 714: 09ec add a1,sp,220 + 716: d1be sw a5,224(sp) + 718: 47e2 lw a5,24(sp) + 71a: 11e8 add a0,sp,236 + 71c: 10412483 lw s1,260(sp) + 720: d3be sw a5,228(sp) + 722: 47f2 lw a5,28(sp) + 724: 10812403 lw s0,264(sp) + 728: c49a sw t1,72(sp) + 72a: d5be sw a5,232(sp) + 72c: 57c2 lw a5,48(sp) + 72e: c2b6 sw a3,68(sp) + 730: c7be sw a5,204(sp) + 732: 57d2 lw a5,52(sp) + 734: c9be sw a5,208(sp) + 736: 57e2 lw a5,56(sp) + 738: cbbe sw a5,212(sp) + 73a: 57f2 lw a5,60(sp) + 73c: cdbe sw a5,216(sp) + 73e: 00000097 auipc ra,0x0 + 742: 000080e7 jalr ra # 73e <.LVL88+0x38> + +00000746 <.LVL89>: + 746: 55be lw a1,236(sp) + 748: 564e lw a2,240(sp) + 74a: 4326 lw t1,72(sp) + 74c: 575e lw a4,244(sp) + 74e: 57ee lw a5,248(sp) + 750: 4696 lw a3,68(sp) + 752: df2e sw a1,188(sp) + 754: c1b2 sw a2,192(sp) + 756: 01ec add a1,sp,204 + 758: 1970 add a2,sp,188 + 75a: 09e8 add a0,sp,220 + 75c: c79a sw t1,204(sp) + 75e: c9b6 sw a3,208(sp) + 760: cba6 sw s1,212(sp) + 762: cda2 sw s0,216(sp) + 764: c3ba sw a4,196(sp) + 766: c5be sw a5,200(sp) + 768: 00000097 auipc ra,0x0 + 76c: 000080e7 jalr ra # 768 <.LVL89+0x22> + +00000770 <.LVL90>: + 770: 467e lw a2,220(sp) + 772: 568e lw a3,224(sp) + 774: 571e lw a4,228(sp) + 776: 57ae lw a5,232(sp) + 778: 7fff0437 lui s0,0x7fff0 + 77c: df32 sw a2,188(sp) + 77e: 196c add a1,sp,188 + 780: 1170 add a2,sp,172 + 782: 01e8 add a0,sp,204 + 784: c1b6 sw a3,192(sp) + 786: c3ba sw a4,196(sp) + 788: c5be sw a5,200(sp) + 78a: d702 sw zero,172(sp) + 78c: d902 sw zero,176(sp) + 78e: db02 sw zero,180(sp) + 790: dd22 sw s0,184(sp) + 792: 00000097 auipc ra,0x0 + 796: 000080e7 jalr ra # 792 <.LVL90+0x22> + +0000079a <.LVL91>: + 79a: 47be lw a5,204(sp) + 79c: 09f0 add a2,sp,220 + 79e: 11ec add a1,sp,236 + 7a0: c2be sw a5,68(sp) + 7a2: 47ce lw a5,208(sp) + 7a4: 19e8 add a0,sp,252 + 7a6: c4be sw a5,72(sp) + 7a8: 47de lw a5,212(sp) + 7aa: c6be sw a5,76(sp) + 7ac: 47ee lw a5,216(sp) + 7ae: c8be sw a5,80(sp) + +000007b0 <.LVL92>: + 7b0: 4782 lw a5,0(sp) + +000007b2 <.LVL93>: + 7b2: d7be sw a5,236(sp) + 7b4: 4792 lw a5,4(sp) + 7b6: d9be sw a5,240(sp) + 7b8: 47a2 lw a5,8(sp) + 7ba: dbbe sw a5,244(sp) + 7bc: 47b2 lw a5,12(sp) + 7be: ddbe sw a5,248(sp) + 7c0: 57c2 lw a5,48(sp) + 7c2: cfbe sw a5,220(sp) + 7c4: 57d2 lw a5,52(sp) + 7c6: d1be sw a5,224(sp) + 7c8: 57e2 lw a5,56(sp) + 7ca: d3be sw a5,228(sp) + 7cc: 57f2 lw a5,60(sp) + 7ce: d5be sw a5,232(sp) + 7d0: 00000097 auipc ra,0x0 + 7d4: 000080e7 jalr ra # 7d0 <.LVL93+0x1e> + +000007d8 <.LVL94>: + 7d8: 47c2 lw a5,16(sp) + 7da: 537e lw t1,252(sp) + 7dc: 10012683 lw a3,256(sp) + 7e0: cfbe sw a5,220(sp) + 7e2: 47d2 lw a5,20(sp) + 7e4: 10412703 lw a4,260(sp) + 7e8: 01f0 add a2,sp,204 + 7ea: d1be sw a5,224(sp) + 7ec: 47e2 lw a5,24(sp) + 7ee: 09ec add a1,sp,220 + 7f0: 11e8 add a0,sp,236 + 7f2: d3be sw a5,228(sp) + 7f4: 47f2 lw a5,28(sp) + 7f6: 10812483 lw s1,264(sp) + 7fa: c41a sw t1,8(sp) + 7fc: d5be sw a5,232(sp) + 7fe: 5782 lw a5,32(sp) + 800: c236 sw a3,4(sp) + 802: c03a sw a4,0(sp) + 804: c7be sw a5,204(sp) + 806: 5792 lw a5,36(sp) + 808: c9be sw a5,208(sp) + 80a: 57a2 lw a5,40(sp) + 80c: cbbe sw a5,212(sp) + 80e: 57b2 lw a5,44(sp) + 810: cdbe sw a5,216(sp) + 812: 00000097 auipc ra,0x0 + 816: 000080e7 jalr ra # 812 <.LVL94+0x3a> + +0000081a <.LVL95>: + 81a: 553e lw a0,236(sp) + 81c: 55ce lw a1,240(sp) + 81e: 565e lw a2,244(sp) + 820: 57ee lw a5,248(sp) + 822: 4322 lw t1,8(sp) + 824: 4692 lw a3,4(sp) + 826: 4702 lw a4,0(sp) + 828: df2a sw a0,188(sp) + 82a: c1ae sw a1,192(sp) + 82c: c3b2 sw a2,196(sp) + 82e: 01ec add a1,sp,204 + 830: 1970 add a2,sp,188 + 832: 09e8 add a0,sp,220 + 834: c79a sw t1,204(sp) + 836: c9b6 sw a3,208(sp) + 838: cbba sw a4,212(sp) + 83a: c5be sw a5,200(sp) + 83c: cda6 sw s1,216(sp) + 83e: 00000097 auipc ra,0x0 + 842: 000080e7 jalr ra # 83e <.LVL95+0x24> + +00000846 <.LVL96>: + 846: 467e lw a2,220(sp) + 848: 57ae lw a5,232(sp) + 84a: 568e lw a3,224(sp) + 84c: 571e lw a4,228(sp) + 84e: df32 sw a2,188(sp) + 850: 196c add a1,sp,188 + 852: 1170 add a2,sp,172 + 854: 01e8 add a0,sp,204 + 856: c5be sw a5,200(sp) + 858: c1b6 sw a3,192(sp) + 85a: c3ba sw a4,196(sp) + 85c: d702 sw zero,172(sp) + 85e: d902 sw zero,176(sp) + 860: db02 sw zero,180(sp) + 862: dd22 sw s0,184(sp) + 864: 00000097 auipc ra,0x0 + 868: 000080e7 jalr ra # 864 <.LVL96+0x1e> + +0000086c <.LVL97>: + 86c: 47be lw a5,204(sp) + 86e: cabe sw a5,84(sp) + +00000870 <.LVL98>: + 870: 47ce lw a5,208(sp) + 872: ccbe sw a5,88(sp) + 874: 47de lw a5,212(sp) + 876: cebe sw a5,92(sp) + 878: 47ee lw a5,216(sp) + 87a: d0be sw a5,96(sp) + +0000087c <.L2>: + 87c: 4786 lw a5,64(sp) + 87e: 4716 lw a4,68(sp) + 880: 11412083 lw ra,276(sp) + 884: 11012403 lw s0,272(sp) + 888: c398 sw a4,0(a5) + 88a: 4726 lw a4,72(sp) + 88c: 10c12483 lw s1,268(sp) + 890: 853e mv a0,a5 + 892: c3d8 sw a4,4(a5) + 894: 4736 lw a4,76(sp) + 896: c798 sw a4,8(a5) + 898: 4746 lw a4,80(sp) + 89a: c7d8 sw a4,12(a5) + 89c: 4756 lw a4,84(sp) + 89e: cb98 sw a4,16(a5) + 8a0: 4766 lw a4,88(sp) + 8a2: cbd8 sw a4,20(a5) + 8a4: 4776 lw a4,92(sp) + 8a6: cf98 sw a4,24(a5) + 8a8: 5706 lw a4,96(sp) + 8aa: cfd8 sw a4,28(a5) + 8ac: 11810113 add sp,sp,280 + +000008b0 <.LVL100>: + 8b0: 8082 ret + +000008b2 <.L17>: + 8b2: e20493e3 bnez s1,6d8 <.L23> + 8b6: 47ea lw a5,152(sp) + 8b8: 00000737 lui a4,0x0 + 8bc: 547d li s0,-1 + 8be: 00179493 sll s1,a5,0x1 + +000008c2 <.LVL102>: + 8c2: 00c72783 lw a5,12(a4) # c <__multc3+0xc> + 8c6: 8085 srl s1,s1,0x1 + 8c8: 11ec add a1,sp,236 + 8ca: d2be sw a5,100(sp) + 8cc: 57a6 lw a5,104(sp) + 8ce: 19e8 add a0,sp,252 + 8d0: 10912423 sw s1,264(sp) + 8d4: dfbe sw a5,252(sp) + 8d6: 57b6 lw a5,108(sp) + 8d8: d7a2 sw s0,236(sp) + 8da: d9a2 sw s0,240(sp) + 8dc: 10f12023 sw a5,256(sp) + 8e0: 57c6 lw a5,112(sp) + 8e2: dba2 sw s0,244(sp) + 8e4: 10f12223 sw a5,260(sp) + 8e8: 5796 lw a5,100(sp) + 8ea: ddbe sw a5,248(sp) + 8ec: 00000097 auipc ra,0x0 + 8f0: 000080e7 jalr ra # 8ec <.LVL102+0x2a> + +000008f4 <.LVL103>: + 8f4: e909 bnez a0,906 <.L51> + 8f6: 11ec add a1,sp,236 + 8f8: 19e8 add a0,sp,252 + 8fa: 00000097 auipc ra,0x0 + 8fe: 000080e7 jalr ra # 8fa <.LVL103+0x6> + +00000902 <.LVL104>: + 902: 0ea04b63 bgtz a0,9f8 <.L26> + +00000906 <.L51>: + 906: 47fa lw a5,156(sp) + 908: 00000737 lui a4,0x0 + 90c: 547d li s0,-1 + 90e: 00179493 sll s1,a5,0x1 + 912: 00c72783 lw a5,12(a4) # c <__multc3+0xc> + 916: 8085 srl s1,s1,0x1 + 918: 11ec add a1,sp,236 + 91a: d2be sw a5,100(sp) + 91c: 57d6 lw a5,116(sp) + 91e: 19e8 add a0,sp,252 + 920: 10912423 sw s1,264(sp) + 924: dfbe sw a5,252(sp) + 926: 57e6 lw a5,120(sp) + 928: d7a2 sw s0,236(sp) + 92a: d9a2 sw s0,240(sp) + 92c: 10f12023 sw a5,256(sp) + 930: 57f6 lw a5,124(sp) + 932: dba2 sw s0,244(sp) + 934: 10f12223 sw a5,260(sp) + 938: 5796 lw a5,100(sp) + 93a: ddbe sw a5,248(sp) + 93c: 00000097 auipc ra,0x0 + 940: 000080e7 jalr ra # 93c <.L51+0x36> + +00000944 <.LVL105>: + 944: e909 bnez a0,956 <.L52> + 946: 11ec add a1,sp,236 + 948: 19e8 add a0,sp,252 + 94a: 00000097 auipc ra,0x0 + 94e: 000080e7 jalr ra # 94a <.LVL105+0x6> + +00000952 <.LVL106>: + 952: 0aa04363 bgtz a0,9f8 <.L26> + +00000956 <.L52>: + 956: 578a lw a5,160(sp) + 958: 00000737 lui a4,0x0 + 95c: 547d li s0,-1 + 95e: 00179493 sll s1,a5,0x1 + 962: 00c72783 lw a5,12(a4) # c <__multc3+0xc> + 966: 8085 srl s1,s1,0x1 + 968: 11ec add a1,sp,236 + 96a: d2be sw a5,100(sp) + 96c: 478a lw a5,128(sp) + 96e: 19e8 add a0,sp,252 + 970: 10912423 sw s1,264(sp) + 974: dfbe sw a5,252(sp) + 976: 479a lw a5,132(sp) + 978: d7a2 sw s0,236(sp) + 97a: d9a2 sw s0,240(sp) + 97c: 10f12023 sw a5,256(sp) + 980: 47aa lw a5,136(sp) + 982: dba2 sw s0,244(sp) + 984: 10f12223 sw a5,260(sp) + 988: 5796 lw a5,100(sp) + 98a: ddbe sw a5,248(sp) + 98c: 00000097 auipc ra,0x0 + 990: 000080e7 jalr ra # 98c <.L52+0x36> + +00000994 <.LVL107>: + 994: e909 bnez a0,9a6 <.L53> + 996: 11ec add a1,sp,236 + 998: 19e8 add a0,sp,252 + 99a: 00000097 auipc ra,0x0 + 99e: 000080e7 jalr ra # 99a <.LVL107+0x6> + +000009a2 <.LVL108>: + 9a2: 04a04b63 bgtz a0,9f8 <.L26> + +000009a6 <.L53>: + 9a6: 579a lw a5,164(sp) + 9a8: 00000737 lui a4,0x0 + 9ac: 547d li s0,-1 + 9ae: 00179493 sll s1,a5,0x1 + 9b2: 00c72783 lw a5,12(a4) # c <__multc3+0xc> + 9b6: 8085 srl s1,s1,0x1 + 9b8: 11ec add a1,sp,236 + 9ba: d2be sw a5,100(sp) + 9bc: 47ba lw a5,140(sp) + 9be: 19e8 add a0,sp,252 + 9c0: 10912423 sw s1,264(sp) + 9c4: dfbe sw a5,252(sp) + 9c6: 47ca lw a5,144(sp) + 9c8: d7a2 sw s0,236(sp) + 9ca: d9a2 sw s0,240(sp) + 9cc: 10f12023 sw a5,256(sp) + 9d0: 47da lw a5,148(sp) + 9d2: dba2 sw s0,244(sp) + 9d4: 10f12223 sw a5,260(sp) + 9d8: 5796 lw a5,100(sp) + 9da: ddbe sw a5,248(sp) + 9dc: 00000097 auipc ra,0x0 + 9e0: 000080e7 jalr ra # 9dc <.L53+0x36> + +000009e4 <.LVL109>: + 9e4: e8051ce3 bnez a0,87c <.L2> + 9e8: 11ec add a1,sp,236 + 9ea: 19e8 add a0,sp,252 + 9ec: 00000097 auipc ra,0x0 + 9f0: 000080e7 jalr ra # 9ec <.LVL109+0x8> + +000009f4 <.LVL110>: + 9f4: e8a054e3 blez a0,87c <.L2> + +000009f8 <.L26>: + 9f8: 4782 lw a5,0(sp) + 9fa: 11ec add a1,sp,236 + 9fc: 19e8 add a0,sp,252 + 9fe: dfbe sw a5,252(sp) + a00: 4792 lw a5,4(sp) + a02: 10f12023 sw a5,256(sp) + a06: 47a2 lw a5,8(sp) + a08: 10f12223 sw a5,260(sp) + a0c: 47b2 lw a5,12(sp) + a0e: 10f12423 sw a5,264(sp) + a12: 4782 lw a5,0(sp) + a14: d7be sw a5,236(sp) + a16: 4792 lw a5,4(sp) + a18: d9be sw a5,240(sp) + a1a: 47a2 lw a5,8(sp) + a1c: dbbe sw a5,244(sp) + a1e: 47b2 lw a5,12(sp) + a20: ddbe sw a5,248(sp) + a22: 00000097 auipc ra,0x0 + a26: 000080e7 jalr ra # a22 <.L26+0x2a> + +00000a2a <.LVL111>: + a2a: c919 beqz a0,a40 <.L30> + a2c: 4732 lw a4,12(sp) + a2e: 4781 li a5,0 + a30: 00075463 bgez a4,a38 <.L32> + a34: 800007b7 lui a5,0x80000 + +00000a38 <.L32>: + a38: c002 sw zero,0(sp) + +00000a3a <.LVL112>: + a3a: c202 sw zero,4(sp) + a3c: c402 sw zero,8(sp) + a3e: c63e sw a5,12(sp) + +00000a40 <.L30>: + a40: 47c2 lw a5,16(sp) + a42: 11ec add a1,sp,236 + a44: 19e8 add a0,sp,252 + a46: dfbe sw a5,252(sp) + a48: 47d2 lw a5,20(sp) + a4a: 10f12023 sw a5,256(sp) + a4e: 47e2 lw a5,24(sp) + a50: 10f12223 sw a5,260(sp) + a54: 47f2 lw a5,28(sp) + a56: 10f12423 sw a5,264(sp) + a5a: 47c2 lw a5,16(sp) + a5c: d7be sw a5,236(sp) + a5e: 47d2 lw a5,20(sp) + a60: d9be sw a5,240(sp) + a62: 47e2 lw a5,24(sp) + a64: dbbe sw a5,244(sp) + a66: 47f2 lw a5,28(sp) + a68: ddbe sw a5,248(sp) + a6a: 00000097 auipc ra,0x0 + a6e: 000080e7 jalr ra # a6a <.L30+0x2a> + +00000a72 <.LVL114>: + a72: c919 beqz a0,a88 <.L33> + a74: 4772 lw a4,28(sp) + a76: 4781 li a5,0 + a78: 00075463 bgez a4,a80 <.L35> + a7c: 800007b7 lui a5,0x80000 + +00000a80 <.L35>: + a80: c802 sw zero,16(sp) + +00000a82 <.LVL115>: + a82: ca02 sw zero,20(sp) + a84: cc02 sw zero,24(sp) + a86: ce3e sw a5,28(sp) + +00000a88 <.L33>: + a88: 5782 lw a5,32(sp) + a8a: 11ec add a1,sp,236 + a8c: 19e8 add a0,sp,252 + a8e: dfbe sw a5,252(sp) + a90: 5792 lw a5,36(sp) + a92: 10f12023 sw a5,256(sp) + a96: 57a2 lw a5,40(sp) + a98: 10f12223 sw a5,260(sp) + a9c: 57b2 lw a5,44(sp) + a9e: 10f12423 sw a5,264(sp) + aa2: 5782 lw a5,32(sp) + aa4: d7be sw a5,236(sp) + aa6: 5792 lw a5,36(sp) + aa8: d9be sw a5,240(sp) + aaa: 57a2 lw a5,40(sp) + aac: dbbe sw a5,244(sp) + aae: 57b2 lw a5,44(sp) + ab0: ddbe sw a5,248(sp) + ab2: 00000097 auipc ra,0x0 + ab6: 000080e7 jalr ra # ab2 <.L33+0x2a> + +00000aba <.LVL117>: + aba: c919 beqz a0,ad0 <.L36> + abc: 5732 lw a4,44(sp) + abe: 4781 li a5,0 + ac0: 00075463 bgez a4,ac8 <.L38> + ac4: 800007b7 lui a5,0x80000 + +00000ac8 <.L38>: + ac8: d002 sw zero,32(sp) + +00000aca <.LVL118>: + aca: d202 sw zero,36(sp) + acc: d402 sw zero,40(sp) + ace: d63e sw a5,44(sp) + +00000ad0 <.L36>: + ad0: 57c2 lw a5,48(sp) + ad2: 11ec add a1,sp,236 + ad4: 19e8 add a0,sp,252 + ad6: dfbe sw a5,252(sp) + ad8: 57d2 lw a5,52(sp) + ada: 10f12023 sw a5,256(sp) + ade: 57e2 lw a5,56(sp) + ae0: 10f12223 sw a5,260(sp) + ae4: 57f2 lw a5,60(sp) + ae6: 10f12423 sw a5,264(sp) + aea: 57c2 lw a5,48(sp) + aec: d7be sw a5,236(sp) + aee: 57d2 lw a5,52(sp) + af0: d9be sw a5,240(sp) + af2: 57e2 lw a5,56(sp) + af4: dbbe sw a5,244(sp) + af6: 57f2 lw a5,60(sp) + af8: ddbe sw a5,248(sp) + afa: 00000097 auipc ra,0x0 + afe: 000080e7 jalr ra # afa <.L36+0x2a> + +00000b02 <.LVL120>: + b02: bc050be3 beqz a0,6d8 <.L23> + b06: 5772 lw a4,60(sp) + b08: 4781 li a5,0 + b0a: 00075463 bgez a4,b12 <.L40> + b0e: 800007b7 lui a5,0x80000 + +00000b12 <.L40>: + b12: d802 sw zero,48(sp) + +00000b14 <.LVL121>: + b14: da02 sw zero,52(sp) + b16: dc02 sw zero,56(sp) + b18: de3e sw a5,60(sp) + +00000b1a <.LVL122>: + b1a: be7d j 6d8 <.L23> + +_divhc3.o: file format elf32-littleriscv + + +_divsc3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__divsc3>: + 0: fbc10113 add sp,sp,-68 + 4: c086 sw ra,64(sp) + 6: c232 sw a2,4(sp) + 8: c436 sw a3,8(sp) + a: de22 sw s0,60(sp) + c: dc26 sw s1,56(sp) + e: c62a sw a0,12(sp) + 10: c02e sw a1,0(sp) + 12: 00000097 auipc ra,0x0 + 16: 000080e7 jalr ra # 12 <__divsc3+0x12> + +0000001a <.LVL1>: + 1a: ce2a sw a0,28(sp) + 1c: 4502 lw a0,0(sp) + 1e: d02e sw a1,32(sp) + +00000020 <.LVL2>: + 20: 00000097 auipc ra,0x0 + 24: 000080e7 jalr ra # 20 <.LVL2> + +00000028 <.LVL3>: + 28: d22a sw a0,36(sp) + 2a: 4512 lw a0,4(sp) + 2c: d42e sw a1,40(sp) + +0000002e <.LVL4>: + 2e: 00000097 auipc ra,0x0 + 32: 000080e7 jalr ra # 2e <.LVL4> + +00000036 <.LVL5>: + 36: 842a mv s0,a0 + 38: 4522 lw a0,8(sp) + 3a: 84ae mv s1,a1 + +0000003c <.LVL6>: + 3c: 00000097 auipc ra,0x0 + 40: 000080e7 jalr ra # 3c <.LVL6> + +00000044 <.LVL7>: + 44: 8622 mv a2,s0 + 46: 86a6 mv a3,s1 + 48: ca2a sw a0,20(sp) + 4a: cc2e sw a1,24(sp) + +0000004c <.LVL8>: + 4c: 8522 mv a0,s0 + +0000004e <.LVL9>: + 4e: 85a6 mv a1,s1 + +00000050 <.LVL10>: + 50: 00000097 auipc ra,0x0 + 54: 000080e7 jalr ra # 50 <.LVL10> + +00000058 <.LVL11>: + 58: 4652 lw a2,20(sp) + 5a: 46e2 lw a3,24(sp) + 5c: d62a sw a0,44(sp) + 5e: c82e sw a1,16(sp) + 60: 8532 mv a0,a2 + 62: 85b6 mv a1,a3 + 64: 00000097 auipc ra,0x0 + 68: 000080e7 jalr ra # 64 <.LVL11+0xc> + +0000006c <.LVL12>: + 6c: 47c2 lw a5,16(sp) + 6e: 5732 lw a4,44(sp) + 70: 862a mv a2,a0 + 72: 86ae mv a3,a1 + 74: 853a mv a0,a4 + 76: 85be mv a1,a5 + 78: 00000097 auipc ra,0x0 + 7c: 000080e7 jalr ra # 78 <.LVL12+0xc> + +00000080 <.LVL13>: + 80: d62a sw a0,44(sp) + 82: d82e sw a1,48(sp) + +00000084 <.LVL14>: + 84: 4572 lw a0,28(sp) + +00000086 <.LVL15>: + 86: 5582 lw a1,32(sp) + +00000088 <.LVL16>: + 88: 8622 mv a2,s0 + 8a: 86a6 mv a3,s1 + 8c: 00000097 auipc ra,0x0 + 90: 000080e7 jalr ra # 8c <.LVL16+0x4> + +00000094 <.LVL17>: + 94: 4652 lw a2,20(sp) + 96: 46e2 lw a3,24(sp) + 98: da2a sw a0,52(sp) + 9a: c82e sw a1,16(sp) + 9c: 5512 lw a0,36(sp) + 9e: 55a2 lw a1,40(sp) + a0: 00000097 auipc ra,0x0 + a4: 000080e7 jalr ra # a0 <.LVL17+0xc> + +000000a8 <.LVL18>: + a8: 47c2 lw a5,16(sp) + aa: 5752 lw a4,52(sp) + ac: 862a mv a2,a0 + ae: 86ae mv a3,a1 + b0: 853a mv a0,a4 + b2: 85be mv a1,a5 + b4: 00000097 auipc ra,0x0 + b8: 000080e7 jalr ra # b4 <.LVL18+0xc> + +000000bc <.LVL19>: + bc: 5632 lw a2,44(sp) + be: 56c2 lw a3,48(sp) + c0: 00000097 auipc ra,0x0 + c4: 000080e7 jalr ra # c0 <.LVL19+0x4> + +000000c8 <.LVL20>: + c8: 00000097 auipc ra,0x0 + cc: 000080e7 jalr ra # c8 <.LVL20> + +000000d0 <.LVL21>: + d0: c82a sw a0,16(sp) + +000000d2 <.LVL22>: + d2: 55a2 lw a1,40(sp) + d4: 5512 lw a0,36(sp) + +000000d6 <.LVL23>: + d6: 8622 mv a2,s0 + d8: 86a6 mv a3,s1 + da: 00000097 auipc ra,0x0 + de: 000080e7 jalr ra # da <.LVL23+0x4> + +000000e2 <.LVL24>: + e2: 4652 lw a2,20(sp) + e4: 46e2 lw a3,24(sp) + e6: 84aa mv s1,a0 + +000000e8 <.LVL25>: + e8: 842e mv s0,a1 + ea: 4572 lw a0,28(sp) + ec: 5582 lw a1,32(sp) + ee: 00000097 auipc ra,0x0 + f2: 000080e7 jalr ra # ee <.LVL25+0x6> + +000000f6 <.LVL26>: + f6: 862a mv a2,a0 + f8: 86ae mv a3,a1 + fa: 8526 mv a0,s1 + fc: 85a2 mv a1,s0 + fe: 00000097 auipc ra,0x0 + 102: 000080e7 jalr ra # fe <.LVL26+0x8> + +00000106 <.LVL27>: + 106: 5632 lw a2,44(sp) + 108: 56c2 lw a3,48(sp) + 10a: 00000097 auipc ra,0x0 + 10e: 000080e7 jalr ra # 10a <.LVL27+0x4> + +00000112 <.LVL28>: + 112: 00000097 auipc ra,0x0 + 116: 000080e7 jalr ra # 112 <.LVL28> + +0000011a <.LVL29>: + 11a: 45c2 lw a1,16(sp) + 11c: ca2a sw a0,20(sp) + +0000011e <.LVL30>: + 11e: 852e mv a0,a1 + +00000120 <.LVL31>: + 120: 00000097 auipc ra,0x0 + 124: 000080e7 jalr ra # 120 <.LVL31> + +00000128 <.LVL32>: + 128: cd3d beqz a0,1a6 <.L2> + 12a: 45d2 lw a1,20(sp) + 12c: 852e mv a0,a1 + 12e: 00000097 auipc ra,0x0 + 132: 000080e7 jalr ra # 12e <.LVL32+0x6> + +00000136 <.LVL33>: + 136: c925 beqz a0,1a6 <.L2> + 138: 4512 lw a0,4(sp) + 13a: 00000593 li a1,0 + 13e: 00000097 auipc ra,0x0 + 142: 000080e7 jalr ra # 13e <.LVL33+0x8> + +00000146 <.LVL34>: + 146: e925 bnez a0,1b6 <.L5> + 148: 4522 lw a0,8(sp) + 14a: 00000593 li a1,0 + 14e: 00000097 auipc ra,0x0 + 152: 000080e7 jalr ra # 14e <.LVL34+0x8> + +00000156 <.LVL35>: + 156: e125 bnez a0,1b6 <.L5> + 158: 45b2 lw a1,12(sp) + 15a: 852e mv a0,a1 + 15c: 00000097 auipc ra,0x0 + 160: 000080e7 jalr ra # 15c <.LVL35+0x6> + +00000164 <.LVL36>: + 164: c901 beqz a0,174 <.L8> + 166: 4582 lw a1,0(sp) + 168: 852e mv a0,a1 + 16a: 00000097 auipc ra,0x0 + 16e: 000080e7 jalr ra # 16a <.LVL36+0x6> + +00000172 <.LVL37>: + 172: e131 bnez a0,1b6 <.L5> + +00000174 <.L8>: + 174: 000007b7 lui a5,0x0 + 178: 0007a403 lw s0,0(a5) # 0 <__divsc3> + 17c: 4792 lw a5,4(sp) + 17e: 0007d663 bgez a5,18a <.L10> + 182: 000007b7 lui a5,0x0 + 186: 0007a403 lw s0,0(a5) # 0 <__divsc3> + +0000018a <.L10>: + 18a: 45b2 lw a1,12(sp) + 18c: 8522 mv a0,s0 + 18e: 00000097 auipc ra,0x0 + 192: 000080e7 jalr ra # 18e <.L10+0x4> + +00000196 <.LVL38>: + 196: 4582 lw a1,0(sp) + 198: c82a sw a0,16(sp) + +0000019a <.LVL39>: + 19a: 8522 mv a0,s0 + +0000019c <.L31>: + 19c: 00000097 auipc ra,0x0 + 1a0: 000080e7 jalr ra # 19c <.L31> + +000001a4 <.LVL41>: + 1a4: ca2a sw a0,20(sp) + +000001a6 <.L2>: + 1a6: 4086 lw ra,64(sp) + 1a8: 5472 lw s0,60(sp) + 1aa: 4542 lw a0,16(sp) + 1ac: 45d2 lw a1,20(sp) + 1ae: 54e2 lw s1,56(sp) + 1b0: 04410113 add sp,sp,68 + +000001b4 <.LVL43>: + 1b4: 8082 ret + +000001b6 <.L5>: + 1b6: 47b2 lw a5,12(sp) + 1b8: 00179413 sll s0,a5,0x1 + 1bc: 000007b7 lui a5,0x0 + 1c0: 0007a583 lw a1,0(a5) # 0 <__divsc3> + 1c4: 8005 srl s0,s0,0x1 + 1c6: 8522 mv a0,s0 + 1c8: 84be mv s1,a5 + 1ca: 00000097 auipc ra,0x0 + 1ce: 000080e7 jalr ra # 1ca <.L5+0x14> + +000001d2 <.LVL45>: + 1d2: e911 bnez a0,1e6 <.L25> + 1d4: 0004a583 lw a1,0(s1) + 1d8: 8522 mv a0,s0 + 1da: 00000097 auipc ra,0x0 + 1de: 000080e7 jalr ra # 1da <.LVL45+0x8> + +000001e2 <.LVL46>: + 1e2: 02a04c63 bgtz a0,21a <.L11> + +000001e6 <.L25>: + 1e6: 4782 lw a5,0(sp) + 1e8: 00179493 sll s1,a5,0x1 + 1ec: 000007b7 lui a5,0x0 + 1f0: 0007a583 lw a1,0(a5) # 0 <__divsc3> + 1f4: 8085 srl s1,s1,0x1 + 1f6: 8526 mv a0,s1 + 1f8: 00000097 auipc ra,0x0 + 1fc: 000080e7 jalr ra # 1f8 <.L25+0x12> + +00000200 <.LVL47>: + 200: 18051463 bnez a0,388 <.L13> + 204: 000007b7 lui a5,0x0 + 208: 0007a583 lw a1,0(a5) # 0 <__divsc3> + 20c: 8526 mv a0,s1 + 20e: 00000097 auipc ra,0x0 + 212: 000080e7 jalr ra # 20e <.LVL47+0xe> + +00000216 <.LVL48>: + 216: 16a05963 blez a0,388 <.L13> + +0000021a <.L11>: + 21a: 800007b7 lui a5,0x80000 + 21e: fff7c493 not s1,a5 + 222: 4792 lw a5,4(sp) + 224: 8fe5 and a5,a5,s1 + 226: cc3e sw a5,24(sp) + 228: 000007b7 lui a5,0x0 + 22c: 0007a583 lw a1,0(a5) # 0 <__divsc3> + 230: 4562 lw a0,24(sp) + 232: 00000097 auipc ra,0x0 + 236: 000080e7 jalr ra # 232 <.L11+0x18> + +0000023a <.LVL49>: + 23a: 14051763 bnez a0,388 <.L13> + 23e: 000007b7 lui a5,0x0 + 242: 0007a583 lw a1,0(a5) # 0 <__divsc3> + 246: 4562 lw a0,24(sp) + 248: 00000097 auipc ra,0x0 + 24c: 000080e7 jalr ra # 248 <.LVL49+0xe> + +00000250 <.LVL50>: + 250: 12a04c63 bgtz a0,388 <.L13> + 254: 4722 lw a4,8(sp) + 256: 000007b7 lui a5,0x0 + 25a: 0007a583 lw a1,0(a5) # 0 <__divsc3> + 25e: 8cf9 and s1,s1,a4 + 260: 8526 mv a0,s1 + 262: 00000097 auipc ra,0x0 + 266: 000080e7 jalr ra # 262 <.LVL50+0x12> + +0000026a <.LVL51>: + 26a: 10051f63 bnez a0,388 <.L13> + 26e: 000007b7 lui a5,0x0 + 272: 0007a583 lw a1,0(a5) # 0 <__divsc3> + 276: 8526 mv a0,s1 + 278: 00000097 auipc ra,0x0 + 27c: 000080e7 jalr ra # 278 <.LVL51+0xe> + +00000280 <.LVL52>: + 280: 10a04463 bgtz a0,388 <.L13> + 284: 000007b7 lui a5,0x0 + 288: 0007a583 lw a1,0(a5) # 0 <__divsc3> + 28c: 8522 mv a0,s0 + 28e: 4485 li s1,1 + 290: 00000097 auipc ra,0x0 + 294: 000080e7 jalr ra # 290 <.LVL52+0x10> + +00000298 <.LVL53>: + 298: ed09 bnez a0,2b2 <.L14> + 29a: 000007b7 lui a5,0x0 + 29e: 0007a583 lw a1,0(a5) # 0 <__divsc3> + 2a2: 8522 mv a0,s0 + 2a4: 00000097 auipc ra,0x0 + 2a8: 000080e7 jalr ra # 2a4 <.LVL53+0xc> + +000002ac <.LVL54>: + 2ac: 00a05363 blez a0,2b2 <.L14> + 2b0: 4481 li s1,0 + +000002b2 <.L14>: + 2b2: 0014c513 xor a0,s1,1 + 2b6: 8905 and a0,a0,1 + 2b8: 00000097 auipc ra,0x0 + 2bc: 000080e7 jalr ra # 2b8 <.L14+0x6> + +000002c0 <.LVL55>: + 2c0: 47b2 lw a5,12(sp) + 2c2: 80000437 lui s0,0x80000 + 2c6: 8fe1 and a5,a5,s0 + 2c8: fff44413 not s0,s0 + 2cc: 00a474b3 and s1,s0,a0 + 2d0: 8fc5 or a5,a5,s1 + 2d2: c63e sw a5,12(sp) + 2d4: 4782 lw a5,0(sp) + 2d6: 4485 li s1,1 + 2d8: 8c7d and s0,s0,a5 + 2da: 000007b7 lui a5,0x0 + 2de: 0007a583 lw a1,0(a5) # 0 <__divsc3> + 2e2: 8522 mv a0,s0 + 2e4: 00000097 auipc ra,0x0 + 2e8: 000080e7 jalr ra # 2e4 <.LVL55+0x24> + +000002ec <.LVL57>: + 2ec: ed09 bnez a0,306 <.L15> + 2ee: 000007b7 lui a5,0x0 + 2f2: 0007a583 lw a1,0(a5) # 0 <__divsc3> + 2f6: 8522 mv a0,s0 + 2f8: 00000097 auipc ra,0x0 + 2fc: 000080e7 jalr ra # 2f8 <.LVL57+0xc> + +00000300 <.LVL58>: + 300: 00a05363 blez a0,306 <.L15> + 304: 4481 li s1,0 + +00000306 <.L15>: + 306: 0014c513 xor a0,s1,1 + 30a: 8905 and a0,a0,1 + 30c: 00000097 auipc ra,0x0 + 310: 000080e7 jalr ra # 30c <.L15+0x6> + +00000314 <.LVL59>: + 314: 4782 lw a5,0(sp) + 316: 80000437 lui s0,0x80000 + 31a: 45b2 lw a1,12(sp) + 31c: 8fe1 and a5,a5,s0 + 31e: fff44413 not s0,s0 + 322: 8c69 and s0,s0,a0 + 324: 4512 lw a0,4(sp) + 326: 8c5d or s0,s0,a5 + +00000328 <.LVL60>: + 328: 00000097 auipc ra,0x0 + 32c: 000080e7 jalr ra # 328 <.LVL60> + +00000330 <.LVL61>: + 330: 84aa mv s1,a0 + 332: 4522 lw a0,8(sp) + 334: 85a2 mv a1,s0 + 336: 00000097 auipc ra,0x0 + 33a: 000080e7 jalr ra # 336 <.LVL61+0x6> + +0000033e <.LVL62>: + 33e: 85aa mv a1,a0 + 340: 8526 mv a0,s1 + 342: 00000097 auipc ra,0x0 + 346: 000080e7 jalr ra # 342 <.LVL62+0x4> + +0000034a <.LVL63>: + 34a: 000004b7 lui s1,0x0 + 34e: 0004a583 lw a1,0(s1) # 0 <__divsc3> + 352: 00000097 auipc ra,0x0 + 356: 000080e7 jalr ra # 352 <.LVL63+0x8> + +0000035a <.LVL64>: + 35a: c82a sw a0,16(sp) + +0000035c <.LVL65>: + 35c: 4512 lw a0,4(sp) + +0000035e <.LVL66>: + 35e: 85a2 mv a1,s0 + 360: 00000097 auipc ra,0x0 + 364: 000080e7 jalr ra # 360 <.LVL66+0x2> + +00000368 <.LVL67>: + 368: 45b2 lw a1,12(sp) + 36a: 842a mv s0,a0 + +0000036c <.LVL68>: + 36c: 4522 lw a0,8(sp) + 36e: 00000097 auipc ra,0x0 + 372: 000080e7 jalr ra # 36e <.LVL68+0x2> + +00000376 <.LVL69>: + 376: 85aa mv a1,a0 + 378: 8522 mv a0,s0 + 37a: 00000097 auipc ra,0x0 + 37e: 000080e7 jalr ra # 37a <.LVL69+0x4> + +00000382 <.LVL70>: + 382: 0004a583 lw a1,0(s1) + 386: bd19 j 19c <.L31> + +00000388 <.L13>: + 388: 4792 lw a5,4(sp) + 38a: 0786 sll a5,a5,0x1 + 38c: 8385 srl a5,a5,0x1 + 38e: cc3e sw a5,24(sp) + 390: 000007b7 lui a5,0x0 + 394: 0007a583 lw a1,0(a5) # 0 <__divsc3> + 398: 4562 lw a0,24(sp) + 39a: 84be mv s1,a5 + 39c: 00000097 auipc ra,0x0 + 3a0: 000080e7 jalr ra # 39c <.L13+0x14> + +000003a4 <.LVL72>: + 3a4: e911 bnez a0,3b8 <.L26> + 3a6: 0004a583 lw a1,0(s1) + 3aa: 4562 lw a0,24(sp) + 3ac: 00000097 auipc ra,0x0 + 3b0: 000080e7 jalr ra # 3ac <.LVL72+0x8> + +000003b4 <.LVL73>: + 3b4: 02a04c63 bgtz a0,3ec <.L16> + +000003b8 <.L26>: + 3b8: 47a2 lw a5,8(sp) + 3ba: 00179493 sll s1,a5,0x1 + 3be: 000007b7 lui a5,0x0 + 3c2: 0007a583 lw a1,0(a5) # 0 <__divsc3> + 3c6: 8085 srl s1,s1,0x1 + 3c8: 8526 mv a0,s1 + 3ca: 00000097 auipc ra,0x0 + 3ce: 000080e7 jalr ra # 3ca <.L26+0x12> + +000003d2 <.LVL74>: + 3d2: dc051ae3 bnez a0,1a6 <.L2> + 3d6: 000007b7 lui a5,0x0 + 3da: 0007a583 lw a1,0(a5) # 0 <__divsc3> + 3de: 8526 mv a0,s1 + 3e0: 00000097 auipc ra,0x0 + 3e4: 000080e7 jalr ra # 3e0 <.LVL74+0xe> + +000003e8 <.LVL75>: + 3e8: daa05fe3 blez a0,1a6 <.L2> + +000003ec <.L16>: + 3ec: 000007b7 lui a5,0x0 + 3f0: 0007a483 lw s1,0(a5) # 0 <__divsc3> + 3f4: 8522 mv a0,s0 + 3f6: 85a6 mv a1,s1 + 3f8: 00000097 auipc ra,0x0 + 3fc: 000080e7 jalr ra # 3f8 <.L16+0xc> + +00000400 <.LVL76>: + 400: da0513e3 bnez a0,1a6 <.L2> + 404: 85a6 mv a1,s1 + 406: 8522 mv a0,s0 + 408: 00000097 auipc ra,0x0 + 40c: 000080e7 jalr ra # 408 <.LVL76+0x8> + +00000410 <.LVL77>: + 410: d8a04be3 bgtz a0,1a6 <.L2> + 414: 4782 lw a5,0(sp) + 416: 85a6 mv a1,s1 + 418: 00179413 sll s0,a5,0x1 + 41c: 8005 srl s0,s0,0x1 + 41e: 8522 mv a0,s0 + 420: 00000097 auipc ra,0x0 + 424: 000080e7 jalr ra # 420 <.LVL77+0x10> + +00000428 <.LVL78>: + 428: d6051fe3 bnez a0,1a6 <.L2> + 42c: 85a6 mv a1,s1 + 42e: 8522 mv a0,s0 + 430: 00000097 auipc ra,0x0 + 434: 000080e7 jalr ra # 430 <.LVL78+0x8> + +00000438 <.LVL79>: + 438: d6a047e3 bgtz a0,1a6 <.L2> + 43c: 4562 lw a0,24(sp) + 43e: 85a6 mv a1,s1 + 440: 4405 li s0,1 + 442: 00000097 auipc ra,0x0 + 446: 000080e7 jalr ra # 442 <.LVL79+0xa> + +0000044a <.LVL80>: + 44a: e911 bnez a0,45e <.L18> + 44c: 4562 lw a0,24(sp) + 44e: 85a6 mv a1,s1 + 450: 00000097 auipc ra,0x0 + 454: 000080e7 jalr ra # 450 <.LVL80+0x6> + +00000458 <.LVL81>: + 458: 00a05363 blez a0,45e <.L18> + 45c: 4401 li s0,0 + +0000045e <.L18>: + 45e: 00144513 xor a0,s0,1 + 462: 8905 and a0,a0,1 + 464: 00000097 auipc ra,0x0 + 468: 000080e7 jalr ra # 464 <.L18+0x6> + +0000046c <.LVL82>: + 46c: 4792 lw a5,4(sp) + 46e: 80000437 lui s0,0x80000 + 472: 8fe1 and a5,a5,s0 + 474: fff44413 not s0,s0 + 478: 00a474b3 and s1,s0,a0 + 47c: 8cdd or s1,s1,a5 + +0000047e <.LVL83>: + 47e: 47a2 lw a5,8(sp) + 480: 8fe1 and a5,a5,s0 + 482: c23e sw a5,4(sp) + 484: 000007b7 lui a5,0x0 + 488: 0007a583 lw a1,0(a5) # 0 <__divsc3> + 48c: 4512 lw a0,4(sp) + 48e: 4405 li s0,1 + 490: 00000097 auipc ra,0x0 + 494: 000080e7 jalr ra # 490 <.LVL83+0x12> + +00000498 <.LVL84>: + 498: ed09 bnez a0,4b2 <.L19> + 49a: 000007b7 lui a5,0x0 + 49e: 0007a583 lw a1,0(a5) # 0 <__divsc3> + 4a2: 4512 lw a0,4(sp) + 4a4: 00000097 auipc ra,0x0 + 4a8: 000080e7 jalr ra # 4a4 <.LVL84+0xc> + +000004ac <.LVL85>: + 4ac: 00a05363 blez a0,4b2 <.L19> + 4b0: 4401 li s0,0 + +000004b2 <.L19>: + 4b2: 00144513 xor a0,s0,1 + 4b6: 8905 and a0,a0,1 + 4b8: 00000097 auipc ra,0x0 + 4bc: 000080e7 jalr ra # 4b8 <.L19+0x6> + +000004c0 <.LVL86>: + 4c0: 47a2 lw a5,8(sp) + 4c2: 80000437 lui s0,0x80000 + 4c6: 85a6 mv a1,s1 + 4c8: 8fe1 and a5,a5,s0 + 4ca: fff44413 not s0,s0 + 4ce: 8c69 and s0,s0,a0 + 4d0: 4532 lw a0,12(sp) + 4d2: 8c5d or s0,s0,a5 + +000004d4 <.LVL87>: + 4d4: 00000097 auipc ra,0x0 + 4d8: 000080e7 jalr ra # 4d4 <.LVL87> + +000004dc <.LVL88>: + 4dc: c22a sw a0,4(sp) + 4de: 4502 lw a0,0(sp) + 4e0: 85a2 mv a1,s0 + 4e2: 00000097 auipc ra,0x0 + 4e6: 000080e7 jalr ra # 4e2 <.LVL88+0x6> + +000004ea <.LVL89>: + 4ea: 85aa mv a1,a0 + 4ec: 4512 lw a0,4(sp) + 4ee: 00000097 auipc ra,0x0 + 4f2: 000080e7 jalr ra # 4ee <.LVL89+0x4> + +000004f6 <.LVL90>: + 4f6: 00000593 li a1,0 + 4fa: 00000097 auipc ra,0x0 + 4fe: 000080e7 jalr ra # 4fa <.LVL90+0x4> + +00000502 <.LVL91>: + 502: c82a sw a0,16(sp) + +00000504 <.LVL92>: + 504: 4502 lw a0,0(sp) + +00000506 <.LVL93>: + 506: 85a6 mv a1,s1 + 508: 00000097 auipc ra,0x0 + 50c: 000080e7 jalr ra # 508 <.LVL93+0x2> + +00000510 <.LVL94>: + 510: 84aa mv s1,a0 + +00000512 <.LVL95>: + 512: 4532 lw a0,12(sp) + 514: 85a2 mv a1,s0 + 516: 00000097 auipc ra,0x0 + 51a: 000080e7 jalr ra # 516 <.LVL95+0x4> + +0000051e <.LVL96>: + 51e: 85aa mv a1,a0 + 520: 8526 mv a0,s1 + 522: 00000097 auipc ra,0x0 + 526: 000080e7 jalr ra # 522 <.LVL96+0x4> + +0000052a <.LVL97>: + 52a: 00000593 li a1,0 + 52e: b1bd j 19c <.L31> + +_divdc3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__divdc3>: + 0: fa810113 add sp,sp,-88 + 4: c23e sw a5,4(sp) + 6: cabe sw a5,84(sp) + 8: 47e6 lw a5,88(sp) + a: c6a2 sw s0,76(sp) + c: c83a sw a4,16(sp) + e: ce3e sw a5,28(sp) + 10: 47f6 lw a5,92(sp) + 12: 80000437 lui s0,0x80000 + 16: fff44413 not s0,s0 + 1a: c63e sw a5,12(sp) + 1c: 5786 lw a5,96(sp) + 1e: 4732 lw a4,12(sp) + 20: ca32 sw a2,20(sp) + 22: d03e sw a5,32(sp) + 24: 47f2 lw a5,28(sp) + 26: 863a mv a2,a4 + 28: 4712 lw a4,4(sp) + 2a: 0087f333 and t1,a5,s0 + 2e: 5782 lw a5,32(sp) + 30: c4a6 sw s1,72(sp) + 32: c2aa sw a0,68(sp) + 34: 8c7d and s0,s0,a5 + 36: c036 sw a3,0(sp) + 38: 84ae mv s1,a1 + 3a: 86a2 mv a3,s0 + +0000003c <.LVL1>: + 3c: 859a mv a1,t1 + +0000003e <.LVL2>: + 3e: 853a mv a0,a4 + 40: d21a sw t1,36(sp) + 42: c886 sw ra,80(sp) + 44: 00000097 auipc ra,0x0 + 48: 000080e7 jalr ra # 44 <.LVL2+0x6> + +0000004c <.LVL4>: + 4c: 000007b7 lui a5,0x0 + 50: 5312 lw t1,36(sp) + 52: 0007a603 lw a2,0(a5) # 0 <__divdc3> + 56: 0047a683 lw a3,4(a5) + 5a: 3e055d63 bgez a0,454 <.L72> + 5e: 4732 lw a4,12(sp) + 60: 85a2 mv a1,s0 + 62: 853a mv a0,a4 + 64: 00000097 auipc ra,0x0 + 68: 000080e7 jalr ra # 64 <.LVL4+0x18> + +0000006c <.LVL5>: + 6c: 06054b63 bltz a0,e2 <.L4> + 70: 00000437 lui s0,0x0 + 74: 47d2 lw a5,20(sp) + 76: 00042603 lw a2,0(s0) # 0 <__divdc3> + 7a: 00442683 lw a3,4(s0) + 7e: 8526 mv a0,s1 + 80: 85be mv a1,a5 + 82: 00000097 auipc ra,0x0 + 86: 000080e7 jalr ra # 82 <.LVL5+0x16> + +0000008a <.LVL6>: + 8a: 4702 lw a4,0(sp) + 8c: 47c2 lw a5,16(sp) + 8e: 00042603 lw a2,0(s0) + 92: 00442683 lw a3,4(s0) + 96: ca2e sw a1,20(sp) + +00000098 <.LVL7>: + 98: 84aa mv s1,a0 + 9a: 85be mv a1,a5 + 9c: 853a mv a0,a4 + 9e: 00000097 auipc ra,0x0 + a2: 000080e7 jalr ra # 9e <.LVL7+0x6> + +000000a6 <.LVL10>: + a6: 4712 lw a4,4(sp) + a8: 47f2 lw a5,28(sp) + aa: 00042603 lw a2,0(s0) + ae: 00442683 lw a3,4(s0) + b2: c02a sw a0,0(sp) + b4: c82e sw a1,16(sp) + +000000b6 <.LVL11>: + b6: 853a mv a0,a4 + b8: 85be mv a1,a5 + ba: 00000097 auipc ra,0x0 + be: 000080e7 jalr ra # ba <.LVL11+0x4> + +000000c2 <.LVL14>: + c2: 4732 lw a4,12(sp) + c4: 5782 lw a5,32(sp) + c6: 00042603 lw a2,0(s0) + ca: 00442683 lw a3,4(s0) + ce: c22a sw a0,4(sp) + d0: ce2e sw a1,28(sp) + +000000d2 <.LVL15>: + d2: 853a mv a0,a4 + d4: 85be mv a1,a5 + d6: 00000097 auipc ra,0x0 + da: 000080e7 jalr ra # d6 <.LVL15+0x4> + +000000de <.LVL18>: + de: c62a sw a0,12(sp) + e0: d02e sw a1,32(sp) + +000000e2 <.L4>: + e2: 5782 lw a5,32(sp) + e4: 80000437 lui s0,0x80000 + e8: fff44413 not s0,s0 + ec: 8fe1 and a5,a5,s0 + ee: d23e sw a5,36(sp) + f0: 000007b7 lui a5,0x0 + f4: 0007a603 lw a2,0(a5) # 0 <__divdc3> + f8: 0047a683 lw a3,4(a5) + fc: 4732 lw a4,12(sp) + fe: 5792 lw a5,36(sp) + 100: 853a mv a0,a4 + 102: 85be mv a1,a5 + 104: 00000097 auipc ra,0x0 + 108: 000080e7 jalr ra # 104 <.L4+0x22> + +0000010c <.LVL20>: + 10c: 06055c63 bgez a0,184 <.L73> + +00000110 <.L78>: + 110: 00000437 lui s0,0x0 + 114: 47d2 lw a5,20(sp) + 116: 00042603 lw a2,0(s0) # 0 <__divdc3> + 11a: 00442683 lw a3,4(s0) + 11e: 8526 mv a0,s1 + 120: 85be mv a1,a5 + 122: 00000097 auipc ra,0x0 + 126: 000080e7 jalr ra # 122 <.L78+0x12> + +0000012a <.LVL21>: + 12a: 4702 lw a4,0(sp) + 12c: 47c2 lw a5,16(sp) + 12e: 00042603 lw a2,0(s0) + 132: 00442683 lw a3,4(s0) + 136: ca2e sw a1,20(sp) + +00000138 <.LVL22>: + 138: 84aa mv s1,a0 + 13a: 85be mv a1,a5 + 13c: 853a mv a0,a4 + 13e: 00000097 auipc ra,0x0 + 142: 000080e7 jalr ra # 13e <.LVL22+0x6> + +00000146 <.LVL25>: + 146: 4712 lw a4,4(sp) + 148: 47f2 lw a5,28(sp) + 14a: 00042603 lw a2,0(s0) + 14e: 00442683 lw a3,4(s0) + 152: c02a sw a0,0(sp) + +00000154 <.LVL26>: + 154: c82e sw a1,16(sp) + 156: 853a mv a0,a4 + 158: 85be mv a1,a5 + 15a: 00000097 auipc ra,0x0 + 15e: 000080e7 jalr ra # 15a <.LVL26+0x6> + +00000162 <.LVL30>: + 162: 4732 lw a4,12(sp) + 164: 5782 lw a5,32(sp) + 166: 00042603 lw a2,0(s0) + 16a: 00442683 lw a3,4(s0) + 16e: c22a sw a0,4(sp) + +00000170 <.LVL31>: + 170: ce2e sw a1,28(sp) + 172: 853a mv a0,a4 + 174: 85be mv a1,a5 + 176: 00000097 auipc ra,0x0 + 17a: 000080e7 jalr ra # 176 <.LVL31+0x6> + +0000017e <.LVL35>: + 17e: c62a sw a0,12(sp) + +00000180 <.LVL36>: + 180: d02e sw a1,32(sp) + 182: a055 j 226 <.L8> + +00000184 <.L73>: + 184: 47d2 lw a5,20(sp) + 186: 8526 mv a0,s1 + 188: 8fe1 and a5,a5,s0 + 18a: d43e sw a5,40(sp) + 18c: 47c2 lw a5,16(sp) + 18e: 8c7d and s0,s0,a5 + 190: 000007b7 lui a5,0x0 + 194: 0007a603 lw a2,0(a5) # 0 <__divdc3> + 198: 0047a683 lw a3,4(a5) + 19c: 57a2 lw a5,40(sp) + 19e: 85be mv a1,a5 + 1a0: 00000097 auipc ra,0x0 + 1a4: 000080e7 jalr ra # 1a0 <.L73+0x1c> + +000001a8 <.LVL39>: + 1a8: 02055163 bgez a0,1ca <.L9> + 1ac: 000007b7 lui a5,0x0 + 1b0: 4702 lw a4,0(sp) + 1b2: 0007a603 lw a2,0(a5) # 0 <__divdc3> + 1b6: 0047a683 lw a3,4(a5) + 1ba: 853a mv a0,a4 + 1bc: 85a2 mv a1,s0 + 1be: 00000097 auipc ra,0x0 + 1c2: 000080e7 jalr ra # 1be <.LVL39+0x16> + +000001c6 <.LVL40>: + 1c6: 04054063 bltz a0,206 <.L11> + +000001ca <.L9>: + 1ca: 000007b7 lui a5,0x0 + 1ce: 4702 lw a4,0(sp) + 1d0: 0007a603 lw a2,0(a5) # 0 <__divdc3> + 1d4: 0047a683 lw a3,4(a5) + 1d8: 853a mv a0,a4 + 1da: 85a2 mv a1,s0 + 1dc: 00000097 auipc ra,0x0 + 1e0: 000080e7 jalr ra # 1dc <.L9+0x12> + +000001e4 <.LVL41>: + 1e4: 04055163 bgez a0,226 <.L8> + 1e8: 000007b7 lui a5,0x0 + 1ec: 0007a603 lw a2,0(a5) # 0 <__divdc3> + 1f0: 0047a683 lw a3,4(a5) + 1f4: 57a2 lw a5,40(sp) + 1f6: 8526 mv a0,s1 + 1f8: 85be mv a1,a5 + 1fa: 00000097 auipc ra,0x0 + 1fe: 000080e7 jalr ra # 1fa <.LVL41+0x16> + +00000202 <.LVL42>: + 202: 02055263 bgez a0,226 <.L8> + +00000206 <.L11>: + 206: 000007b7 lui a5,0x0 + 20a: 0007a603 lw a2,0(a5) # 0 <__divdc3> + 20e: 0047a683 lw a3,4(a5) + 212: 4732 lw a4,12(sp) + 214: 5792 lw a5,36(sp) + 216: 853a mv a0,a4 + 218: 85be mv a1,a5 + 21a: 00000097 auipc ra,0x0 + 21e: 000080e7 jalr ra # 21a <.L11+0x14> + +00000222 <.LVL43>: + 222: ee0547e3 bltz a0,110 <.L78> + +00000226 <.L8>: + 226: 4732 lw a4,12(sp) + 228: 5782 lw a5,32(sp) + 22a: 863a mv a2,a4 + 22c: 86be mv a3,a5 + 22e: 4712 lw a4,4(sp) + 230: 47f2 lw a5,28(sp) + 232: 853a mv a0,a4 + 234: 85be mv a1,a5 + 236: 00000097 auipc ra,0x0 + 23a: 000080e7 jalr ra # 236 <.L8+0x10> + +0000023e <.LVL45>: + 23e: 4712 lw a4,4(sp) + 240: 47f2 lw a5,28(sp) + 242: 862a mv a2,a0 + 244: 86ae mv a3,a1 + 246: d62a sw a0,44(sp) + 248: 842e mv s0,a1 + +0000024a <.LVL46>: + 24a: 853a mv a0,a4 + +0000024c <.LVL47>: + 24c: 85be mv a1,a5 + 24e: 00000097 auipc ra,0x0 + 252: 000080e7 jalr ra # 24e <.LVL47+0x2> + +00000256 <.LVL48>: + 256: 4732 lw a4,12(sp) + 258: 5782 lw a5,32(sp) + 25a: 863a mv a2,a4 + 25c: 86be mv a3,a5 + 25e: 00000097 auipc ra,0x0 + 262: 000080e7 jalr ra # 25e <.LVL48+0x8> + +00000266 <.LVL49>: + 266: 000007b7 lui a5,0x0 + 26a: 5732 lw a4,44(sp) + 26c: 0007a603 lw a2,0(a5) # 0 <__divdc3> + 270: 0047a683 lw a3,4(a5) + 274: da2e sw a1,52(sp) + +00000276 <.LVL50>: + 276: 00141593 sll a1,s0,0x1 + +0000027a <.LVL51>: + 27a: 0015d793 srl a5,a1,0x1 + 27e: d82a sw a0,48(sp) + +00000280 <.LVL52>: + 280: 85be mv a1,a5 + 282: 853a mv a0,a4 + 284: 00000097 auipc ra,0x0 + 288: 000080e7 jalr ra # 284 <.LVL52+0x4> + +0000028c <.LVL53>: + 28c: 16a05063 blez a0,3ec <.L74> + 290: 5732 lw a4,44(sp) + 292: 47d2 lw a5,20(sp) + 294: 86a2 mv a3,s0 + 296: 863a mv a2,a4 + 298: 85be mv a1,a5 + 29a: 8526 mv a0,s1 + 29c: 00000097 auipc ra,0x0 + 2a0: 000080e7 jalr ra # 29c <.LVL53+0x10> + +000002a4 <.LVL54>: + 2a4: 4702 lw a4,0(sp) + 2a6: 47c2 lw a5,16(sp) + 2a8: 863a mv a2,a4 + 2aa: 86be mv a3,a5 + 2ac: 00000097 auipc ra,0x0 + 2b0: 000080e7 jalr ra # 2ac <.LVL54+0x8> + +000002b4 <.LVL55>: + 2b4: 5642 lw a2,48(sp) + 2b6: 56d2 lw a3,52(sp) + 2b8: 00000097 auipc ra,0x0 + 2bc: 000080e7 jalr ra # 2b8 <.LVL55+0x4> + +000002c0 <.LVL56>: + 2c0: 5732 lw a4,44(sp) + 2c2: 47c2 lw a5,16(sp) + 2c4: d22a sw a0,36(sp) + 2c6: 863a mv a2,a4 + 2c8: 4702 lw a4,0(sp) + 2ca: d42e sw a1,40(sp) + +000002cc <.LVL57>: + 2cc: 86a2 mv a3,s0 + 2ce: 853a mv a0,a4 + +000002d0 <.LVL58>: + 2d0: 85be mv a1,a5 + +000002d2 <.L83>: + 2d2: 00000097 auipc ra,0x0 + 2d6: 000080e7 jalr ra # 2d2 <.L83> + +000002da <.LVL60>: + 2da: 47d2 lw a5,20(sp) + 2dc: 8626 mv a2,s1 + 2de: 86be mv a3,a5 + +000002e0 <.L80>: + 2e0: 00000097 auipc ra,0x0 + 2e4: 000080e7 jalr ra # 2e0 <.L80> + +000002e8 <.LVL62>: + 2e8: 5642 lw a2,48(sp) + 2ea: 56d2 lw a3,52(sp) + 2ec: 00000097 auipc ra,0x0 + 2f0: 000080e7 jalr ra # 2ec <.LVL62+0x4> + +000002f4 <.LVL63>: + 2f4: 5612 lw a2,36(sp) + 2f6: 56a2 lw a3,40(sp) + 2f8: d62a sw a0,44(sp) + 2fa: d82e sw a1,48(sp) + +000002fc <.LVL64>: + 2fc: 8532 mv a0,a2 + +000002fe <.LVL65>: + 2fe: 85b6 mv a1,a3 + +00000300 <.LVL66>: + 300: 00000097 auipc ra,0x0 + 304: 000080e7 jalr ra # 300 <.LVL66> + +00000308 <.LVL67>: + 308: c171 beqz a0,3cc <.L31> + 30a: 5632 lw a2,44(sp) + 30c: 56c2 lw a3,48(sp) + 30e: 8532 mv a0,a2 + 310: 85b6 mv a1,a3 + 312: 00000097 auipc ra,0x0 + 316: 000080e7 jalr ra # 312 <.LVL67+0xa> + +0000031a <.LVL68>: + 31a: c94d beqz a0,3cc <.L31> + 31c: 4712 lw a4,4(sp) + 31e: 47f2 lw a5,28(sp) + 320: 4601 li a2,0 + 322: 4681 li a3,0 + 324: 853a mv a0,a4 + 326: 85be mv a1,a5 + 328: 00000097 auipc ra,0x0 + 32c: 000080e7 jalr ra # 328 <.LVL68+0xe> + +00000330 <.LVL69>: + 330: 40051963 bnez a0,742 <.L34> + 334: 4732 lw a4,12(sp) + 336: 5782 lw a5,32(sp) + 338: 4601 li a2,0 + 33a: 4681 li a3,0 + 33c: 853a mv a0,a4 + 33e: 85be mv a1,a5 + 340: 00000097 auipc ra,0x0 + 344: 000080e7 jalr ra # 340 <.LVL69+0x10> + +00000348 <.LVL70>: + 348: 3e051d63 bnez a0,742 <.L34> + 34c: 47d2 lw a5,20(sp) + 34e: 8626 mv a2,s1 + 350: 8526 mv a0,s1 + 352: 86be mv a3,a5 + 354: 85be mv a1,a5 + 356: 00000097 auipc ra,0x0 + 35a: 000080e7 jalr ra # 356 <.LVL70+0xe> + +0000035e <.LVL71>: + 35e: cd09 beqz a0,378 <.L37> + 360: 4702 lw a4,0(sp) + 362: 47c2 lw a5,16(sp) + 364: 863a mv a2,a4 + 366: 86be mv a3,a5 + 368: 853a mv a0,a4 + 36a: 85be mv a1,a5 + 36c: 00000097 auipc ra,0x0 + 370: 000080e7 jalr ra # 36c <.LVL71+0xe> + +00000374 <.LVL72>: + 374: 3c051763 bnez a0,742 <.L34> + +00000378 <.L37>: + 378: 000007b7 lui a5,0x0 + 37c: 0007a303 lw t1,0(a5) # 0 <__divdc3> + 380: 0047a383 lw t2,4(a5) + 384: 47f2 lw a5,28(sp) + 386: 0007d863 bgez a5,396 <.L39> + 38a: 000007b7 lui a5,0x0 + 38e: 0007a303 lw t1,0(a5) # 0 <__divdc3> + 392: 0047a383 lw t2,4(a5) + +00000396 <.L39>: + 396: 47d2 lw a5,20(sp) + 398: 8626 mv a2,s1 + 39a: 851a mv a0,t1 + 39c: 86be mv a3,a5 + 39e: 859e mv a1,t2 + 3a0: c21a sw t1,4(sp) + +000003a2 <.LVL73>: + 3a2: c41e sw t2,8(sp) + 3a4: 00000097 auipc ra,0x0 + 3a8: 000080e7 jalr ra # 3a4 <.LVL73+0x2> + +000003ac <.LVL74>: + 3ac: 4702 lw a4,0(sp) + 3ae: 47c2 lw a5,16(sp) + 3b0: 4312 lw t1,4(sp) + 3b2: 43a2 lw t2,8(sp) + 3b4: d22a sw a0,36(sp) + +000003b6 <.LVL75>: + 3b6: d42e sw a1,40(sp) + +000003b8 <.LVL76>: + 3b8: 863a mv a2,a4 + 3ba: 86be mv a3,a5 + 3bc: 851a mv a0,t1 + +000003be <.LVL77>: + 3be: 859e mv a1,t2 + +000003c0 <.L82>: + 3c0: 00000097 auipc ra,0x0 + 3c4: 000080e7 jalr ra # 3c0 <.L82> + +000003c8 <.LVL79>: + 3c8: d62a sw a0,44(sp) + 3ca: d82e sw a1,48(sp) + +000003cc <.L31>: + 3cc: 4696 lw a3,68(sp) + 3ce: 5712 lw a4,36(sp) + 3d0: 57a2 lw a5,40(sp) + 3d2: 40c6 lw ra,80(sp) + 3d4: c298 sw a4,0(a3) + 3d6: c2dc sw a5,4(a3) + 3d8: 5732 lw a4,44(sp) + 3da: 57c2 lw a5,48(sp) + 3dc: 4436 lw s0,76(sp) + 3de: c698 sw a4,8(a3) + 3e0: c6dc sw a5,12(a3) + 3e2: 44a6 lw s1,72(sp) + 3e4: 8536 mv a0,a3 + 3e6: 05810113 add sp,sp,88 + 3ea: 8082 ret + +000003ec <.L74>: + 3ec: 5782 lw a5,32(sp) + 3ee: 4732 lw a4,12(sp) + 3f0: 8526 mv a0,s1 + 3f2: 86be mv a3,a5 + 3f4: 47d2 lw a5,20(sp) + 3f6: 863a mv a2,a4 + 3f8: 85be mv a1,a5 + 3fa: 00000097 auipc ra,0x0 + 3fe: 000080e7 jalr ra # 3fa <.L74+0xe> + +00000402 <.LVL82>: + 402: 4712 lw a4,4(sp) + 404: 47f2 lw a5,28(sp) + 406: 863a mv a2,a4 + 408: 86be mv a3,a5 + 40a: 00000097 auipc ra,0x0 + 40e: 000080e7 jalr ra # 40a <.LVL82+0x8> + +00000412 <.LVL83>: + 412: 4702 lw a4,0(sp) + 414: 47c2 lw a5,16(sp) + 416: 863a mv a2,a4 + 418: 86be mv a3,a5 + 41a: 00000097 auipc ra,0x0 + 41e: 000080e7 jalr ra # 41a <.LVL83+0x8> + +00000422 <.LVL84>: + 422: 5642 lw a2,48(sp) + 424: 56d2 lw a3,52(sp) + 426: 00000097 auipc ra,0x0 + 42a: 000080e7 jalr ra # 426 <.LVL84+0x4> + +0000042e <.LVL85>: + 42e: 4732 lw a4,12(sp) + 430: 5782 lw a5,32(sp) + 432: d22a sw a0,36(sp) + 434: 863a mv a2,a4 + 436: 86be mv a3,a5 + 438: 4702 lw a4,0(sp) + 43a: 47c2 lw a5,16(sp) + 43c: d42e sw a1,40(sp) + +0000043e <.LVL86>: + 43e: 853a mv a0,a4 + +00000440 <.LVL87>: + 440: 85be mv a1,a5 + +00000442 <.LVL88>: + 442: 00000097 auipc ra,0x0 + 446: 000080e7 jalr ra # 442 <.LVL88> + +0000044a <.LVL89>: + 44a: 4712 lw a4,4(sp) + 44c: 47f2 lw a5,28(sp) + 44e: 863a mv a2,a4 + 450: 86be mv a3,a5 + 452: b541 j 2d2 <.L83> + +00000454 <.L72>: + 454: 4712 lw a4,4(sp) + 456: 859a mv a1,t1 + 458: 853a mv a0,a4 + 45a: 00000097 auipc ra,0x0 + 45e: 000080e7 jalr ra # 45a <.L72+0x6> + +00000462 <.LVL91>: + 462: 06054b63 bltz a0,4d8 <.L18> + 466: 00000437 lui s0,0x0 + 46a: 47d2 lw a5,20(sp) + 46c: 00042603 lw a2,0(s0) # 0 <__divdc3> + 470: 00442683 lw a3,4(s0) + 474: 8526 mv a0,s1 + 476: 85be mv a1,a5 + 478: 00000097 auipc ra,0x0 + 47c: 000080e7 jalr ra # 478 <.LVL91+0x16> + +00000480 <.LVL92>: + 480: 4702 lw a4,0(sp) + 482: 47c2 lw a5,16(sp) + 484: 00042603 lw a2,0(s0) + 488: 00442683 lw a3,4(s0) + 48c: ca2e sw a1,20(sp) + +0000048e <.LVL93>: + 48e: 84aa mv s1,a0 + 490: 85be mv a1,a5 + 492: 853a mv a0,a4 + 494: 00000097 auipc ra,0x0 + 498: 000080e7 jalr ra # 494 <.LVL93+0x6> + +0000049c <.LVL96>: + 49c: 4712 lw a4,4(sp) + 49e: 47f2 lw a5,28(sp) + 4a0: 00042603 lw a2,0(s0) + 4a4: 00442683 lw a3,4(s0) + 4a8: c02a sw a0,0(sp) + 4aa: c82e sw a1,16(sp) + +000004ac <.LVL97>: + 4ac: 853a mv a0,a4 + 4ae: 85be mv a1,a5 + 4b0: 00000097 auipc ra,0x0 + 4b4: 000080e7 jalr ra # 4b0 <.LVL97+0x4> + +000004b8 <.LVL100>: + 4b8: 4732 lw a4,12(sp) + 4ba: 5782 lw a5,32(sp) + 4bc: 00042603 lw a2,0(s0) + 4c0: 00442683 lw a3,4(s0) + 4c4: c22a sw a0,4(sp) + 4c6: ce2e sw a1,28(sp) + +000004c8 <.LVL101>: + 4c8: 853a mv a0,a4 + 4ca: 85be mv a1,a5 + 4cc: 00000097 auipc ra,0x0 + 4d0: 000080e7 jalr ra # 4cc <.LVL101+0x4> + +000004d4 <.LVL104>: + 4d4: c62a sw a0,12(sp) + 4d6: d02e sw a1,32(sp) + +000004d8 <.L18>: + 4d8: 47f2 lw a5,28(sp) + 4da: 80000437 lui s0,0x80000 + 4de: fff44413 not s0,s0 + 4e2: 8fe1 and a5,a5,s0 + 4e4: d23e sw a5,36(sp) + 4e6: 000007b7 lui a5,0x0 + 4ea: 0007a603 lw a2,0(a5) # 0 <__divdc3> + 4ee: 0047a683 lw a3,4(a5) + 4f2: 4712 lw a4,4(sp) + 4f4: 5792 lw a5,36(sp) + 4f6: 853a mv a0,a4 + 4f8: 85be mv a1,a5 + 4fa: 00000097 auipc ra,0x0 + 4fe: 000080e7 jalr ra # 4fa <.L18+0x22> + +00000502 <.LVL106>: + 502: 06055c63 bgez a0,57a <.L75> + +00000506 <.L79>: + 506: 00000437 lui s0,0x0 + 50a: 47d2 lw a5,20(sp) + 50c: 00042603 lw a2,0(s0) # 0 <__divdc3> + 510: 00442683 lw a3,4(s0) + 514: 8526 mv a0,s1 + 516: 85be mv a1,a5 + 518: 00000097 auipc ra,0x0 + 51c: 000080e7 jalr ra # 518 <.L79+0x12> + +00000520 <.LVL107>: + 520: 4702 lw a4,0(sp) + 522: 47c2 lw a5,16(sp) + 524: 00042603 lw a2,0(s0) + 528: 00442683 lw a3,4(s0) + 52c: ca2e sw a1,20(sp) + +0000052e <.LVL108>: + 52e: 84aa mv s1,a0 + 530: 85be mv a1,a5 + 532: 853a mv a0,a4 + 534: 00000097 auipc ra,0x0 + 538: 000080e7 jalr ra # 534 <.LVL108+0x6> + +0000053c <.LVL111>: + 53c: 4712 lw a4,4(sp) + 53e: 47f2 lw a5,28(sp) + 540: 00042603 lw a2,0(s0) + 544: 00442683 lw a3,4(s0) + 548: c02a sw a0,0(sp) + +0000054a <.LVL112>: + 54a: c82e sw a1,16(sp) + 54c: 853a mv a0,a4 + 54e: 85be mv a1,a5 + 550: 00000097 auipc ra,0x0 + 554: 000080e7 jalr ra # 550 <.LVL112+0x6> + +00000558 <.LVL116>: + 558: 4732 lw a4,12(sp) + 55a: 5782 lw a5,32(sp) + 55c: 00042603 lw a2,0(s0) + 560: 00442683 lw a3,4(s0) + 564: c22a sw a0,4(sp) + +00000566 <.LVL117>: + 566: ce2e sw a1,28(sp) + 568: 853a mv a0,a4 + 56a: 85be mv a1,a5 + 56c: 00000097 auipc ra,0x0 + 570: 000080e7 jalr ra # 56c <.LVL117+0x6> + +00000574 <.LVL121>: + 574: c62a sw a0,12(sp) + +00000576 <.LVL122>: + 576: d02e sw a1,32(sp) + 578: a055 j 61c <.L22> + +0000057a <.L75>: + 57a: 47d2 lw a5,20(sp) + 57c: 8526 mv a0,s1 + 57e: 8fe1 and a5,a5,s0 + 580: d43e sw a5,40(sp) + 582: 47c2 lw a5,16(sp) + 584: 8c7d and s0,s0,a5 + 586: 000007b7 lui a5,0x0 + 58a: 0007a603 lw a2,0(a5) # 0 <__divdc3> + 58e: 0047a683 lw a3,4(a5) + 592: 57a2 lw a5,40(sp) + 594: 85be mv a1,a5 + 596: 00000097 auipc ra,0x0 + 59a: 000080e7 jalr ra # 596 <.L75+0x1c> + +0000059e <.LVL125>: + 59e: 02055163 bgez a0,5c0 <.L23> + 5a2: 000007b7 lui a5,0x0 + 5a6: 4702 lw a4,0(sp) + 5a8: 0007a603 lw a2,0(a5) # 0 <__divdc3> + 5ac: 0047a683 lw a3,4(a5) + 5b0: 853a mv a0,a4 + 5b2: 85a2 mv a1,s0 + 5b4: 00000097 auipc ra,0x0 + 5b8: 000080e7 jalr ra # 5b4 <.LVL125+0x16> + +000005bc <.LVL126>: + 5bc: 04054063 bltz a0,5fc <.L25> + +000005c0 <.L23>: + 5c0: 000007b7 lui a5,0x0 + 5c4: 4702 lw a4,0(sp) + 5c6: 0007a603 lw a2,0(a5) # 0 <__divdc3> + 5ca: 0047a683 lw a3,4(a5) + 5ce: 853a mv a0,a4 + 5d0: 85a2 mv a1,s0 + 5d2: 00000097 auipc ra,0x0 + 5d6: 000080e7 jalr ra # 5d2 <.L23+0x12> + +000005da <.LVL127>: + 5da: 04055163 bgez a0,61c <.L22> + 5de: 000007b7 lui a5,0x0 + 5e2: 0007a603 lw a2,0(a5) # 0 <__divdc3> + 5e6: 0047a683 lw a3,4(a5) + 5ea: 57a2 lw a5,40(sp) + 5ec: 8526 mv a0,s1 + 5ee: 85be mv a1,a5 + 5f0: 00000097 auipc ra,0x0 + 5f4: 000080e7 jalr ra # 5f0 <.LVL127+0x16> + +000005f8 <.LVL128>: + 5f8: 02055263 bgez a0,61c <.L22> + +000005fc <.L25>: + 5fc: 000007b7 lui a5,0x0 + 600: 0007a603 lw a2,0(a5) # 0 <__divdc3> + 604: 0047a683 lw a3,4(a5) + 608: 4712 lw a4,4(sp) + 60a: 5792 lw a5,36(sp) + 60c: 853a mv a0,a4 + 60e: 85be mv a1,a5 + 610: 00000097 auipc ra,0x0 + 614: 000080e7 jalr ra # 610 <.L25+0x14> + +00000618 <.LVL129>: + 618: ee0547e3 bltz a0,506 <.L79> + +0000061c <.L22>: + 61c: 4712 lw a4,4(sp) + 61e: 47f2 lw a5,28(sp) + 620: 863a mv a2,a4 + 622: 86be mv a3,a5 + 624: 4732 lw a4,12(sp) + 626: 5782 lw a5,32(sp) + 628: 853a mv a0,a4 + 62a: 85be mv a1,a5 + 62c: 00000097 auipc ra,0x0 + 630: 000080e7 jalr ra # 62c <.L22+0x10> + +00000634 <.LVL131>: + 634: 4732 lw a4,12(sp) + 636: 5782 lw a5,32(sp) + 638: 862a mv a2,a0 + 63a: 86ae mv a3,a1 + 63c: d62a sw a0,44(sp) + 63e: 842e mv s0,a1 + +00000640 <.LVL132>: + 640: 853a mv a0,a4 + +00000642 <.LVL133>: + 642: 85be mv a1,a5 + 644: 00000097 auipc ra,0x0 + 648: 000080e7 jalr ra # 644 <.LVL133+0x2> + +0000064c <.LVL134>: + 64c: 4712 lw a4,4(sp) + 64e: 47f2 lw a5,28(sp) + 650: 863a mv a2,a4 + 652: 86be mv a3,a5 + 654: 00000097 auipc ra,0x0 + 658: 000080e7 jalr ra # 654 <.LVL134+0x8> + +0000065c <.LVL135>: + 65c: 000007b7 lui a5,0x0 + 660: 5732 lw a4,44(sp) + 662: 0007a603 lw a2,0(a5) # 0 <__divdc3> + 666: 0047a683 lw a3,4(a5) + 66a: da2e sw a1,52(sp) + +0000066c <.LVL136>: + 66c: 00141593 sll a1,s0,0x1 + +00000670 <.LVL137>: + 670: 0015d793 srl a5,a1,0x1 + 674: d82a sw a0,48(sp) + +00000676 <.LVL138>: + 676: 85be mv a1,a5 + 678: 853a mv a0,a4 + 67a: 00000097 auipc ra,0x0 + 67e: 000080e7 jalr ra # 67a <.LVL138+0x4> + +00000682 <.LVL139>: + 682: 04a05d63 blez a0,6dc <.L76> + 686: 5732 lw a4,44(sp) + 688: 47c2 lw a5,16(sp) + 68a: 86a2 mv a3,s0 + 68c: 863a mv a2,a4 + 68e: 4702 lw a4,0(sp) + 690: 85be mv a1,a5 + 692: 853a mv a0,a4 + 694: 00000097 auipc ra,0x0 + 698: 000080e7 jalr ra # 694 <.LVL139+0x12> + +0000069c <.LVL140>: + 69c: 47d2 lw a5,20(sp) + 69e: 8626 mv a2,s1 + 6a0: 86be mv a3,a5 + 6a2: 00000097 auipc ra,0x0 + 6a6: 000080e7 jalr ra # 6a2 <.LVL140+0x6> + +000006aa <.LVL141>: + 6aa: 5642 lw a2,48(sp) + 6ac: 56d2 lw a3,52(sp) + 6ae: 00000097 auipc ra,0x0 + 6b2: 000080e7 jalr ra # 6ae <.LVL141+0x4> + +000006b6 <.LVL142>: + 6b6: 5732 lw a4,44(sp) + 6b8: 47d2 lw a5,20(sp) + 6ba: d22a sw a0,36(sp) + 6bc: d42e sw a1,40(sp) + +000006be <.LVL143>: + 6be: 863a mv a2,a4 + 6c0: 86a2 mv a3,s0 + 6c2: 8526 mv a0,s1 + +000006c4 <.LVL144>: + 6c4: 85be mv a1,a5 + +000006c6 <.L81>: + 6c6: 00000097 auipc ra,0x0 + 6ca: 000080e7 jalr ra # 6c6 <.L81> + +000006ce <.LVL146>: + 6ce: 4702 lw a4,0(sp) + 6d0: 47c2 lw a5,16(sp) + 6d2: 862a mv a2,a0 + 6d4: 86ae mv a3,a1 + 6d6: 853a mv a0,a4 + 6d8: 85be mv a1,a5 + 6da: b119 j 2e0 <.L80> + +000006dc <.L76>: + 6dc: 4712 lw a4,4(sp) + 6de: 47f2 lw a5,28(sp) + 6e0: 863a mv a2,a4 + 6e2: 86be mv a3,a5 + 6e4: 4702 lw a4,0(sp) + 6e6: 47c2 lw a5,16(sp) + 6e8: 853a mv a0,a4 + 6ea: 85be mv a1,a5 + 6ec: 00000097 auipc ra,0x0 + 6f0: 000080e7 jalr ra # 6ec <.L76+0x10> + +000006f4 <.LVL147>: + 6f4: 4732 lw a4,12(sp) + 6f6: 5782 lw a5,32(sp) + 6f8: 863a mv a2,a4 + 6fa: 86be mv a3,a5 + 6fc: 00000097 auipc ra,0x0 + 700: 000080e7 jalr ra # 6fc <.LVL147+0x8> + +00000704 <.LVL148>: + 704: 47d2 lw a5,20(sp) + 706: 8626 mv a2,s1 + 708: 86be mv a3,a5 + 70a: 00000097 auipc ra,0x0 + 70e: 000080e7 jalr ra # 70a <.LVL148+0x6> + +00000712 <.LVL149>: + 712: 5642 lw a2,48(sp) + 714: 56d2 lw a3,52(sp) + 716: 00000097 auipc ra,0x0 + 71a: 000080e7 jalr ra # 716 <.LVL149+0x4> + +0000071e <.LVL150>: + 71e: 47f2 lw a5,28(sp) + 720: 4712 lw a4,4(sp) + 722: d22a sw a0,36(sp) + 724: 86be mv a3,a5 + 726: 47d2 lw a5,20(sp) + 728: 863a mv a2,a4 + 72a: d42e sw a1,40(sp) + +0000072c <.LVL151>: + 72c: 8526 mv a0,s1 + +0000072e <.LVL152>: + 72e: 85be mv a1,a5 + +00000730 <.LVL153>: + 730: 00000097 auipc ra,0x0 + 734: 000080e7 jalr ra # 730 <.LVL153> + +00000738 <.LVL154>: + 738: 4732 lw a4,12(sp) + 73a: 5782 lw a5,32(sp) + 73c: 863a mv a2,a4 + 73e: 86be mv a3,a5 + 740: b759 j 6c6 <.L81> + +00000742 <.L34>: + 742: 47d2 lw a5,20(sp) + 744: 8526 mv a0,s1 + 746: 0786 sll a5,a5,0x1 + 748: 8385 srl a5,a5,0x1 + 74a: de3e sw a5,60(sp) + 74c: 000007b7 lui a5,0x0 + 750: 0007a703 lw a4,0(a5) # 0 <__divdc3> + 754: 0047a783 lw a5,4(a5) + 758: 863a mv a2,a4 + 75a: dc3e sw a5,56(sp) + 75c: 86be mv a3,a5 + 75e: 57f2 lw a5,60(sp) + 760: da3a sw a4,52(sp) + 762: 85be mv a1,a5 + 764: 00000097 auipc ra,0x0 + 768: 000080e7 jalr ra # 764 <.L34+0x22> + +0000076c <.LVL156>: + 76c: ed01 bnez a0,784 <.L67> + 76e: 57f2 lw a5,60(sp) + 770: 5652 lw a2,52(sp) + 772: 56e2 lw a3,56(sp) + 774: 8526 mv a0,s1 + 776: 85be mv a1,a5 + 778: 00000097 auipc ra,0x0 + 77c: 000080e7 jalr ra # 778 <.LVL156+0xc> + +00000780 <.LVL157>: + 780: 04a04463 bgtz a0,7c8 <.L40> + +00000784 <.L67>: + 784: 47c2 lw a5,16(sp) + 786: 00000737 lui a4,0x0 + 78a: 4302 lw t1,0(sp) + 78c: 0786 sll a5,a5,0x1 + 78e: 0017d413 srl s0,a5,0x1 + 792: 00472783 lw a5,4(a4) # 4 <__divdc3+0x4> + 796: 00072703 lw a4,0(a4) + 79a: 851a mv a0,t1 + 79c: 86be mv a3,a5 + 79e: 863a mv a2,a4 + 7a0: 85a2 mv a1,s0 + 7a2: da3a sw a4,52(sp) + 7a4: dc3e sw a5,56(sp) + 7a6: 00000097 auipc ra,0x0 + 7aa: 000080e7 jalr ra # 7a6 <.L67+0x22> + +000007ae <.LVL158>: + 7ae: 20051263 bnez a0,9b2 <.L42> + 7b2: 4302 lw t1,0(sp) + 7b4: 5652 lw a2,52(sp) + 7b6: 56e2 lw a3,56(sp) + 7b8: 851a mv a0,t1 + 7ba: 85a2 mv a1,s0 + 7bc: 00000097 auipc ra,0x0 + 7c0: 000080e7 jalr ra # 7bc <.LVL158+0xe> + +000007c4 <.LVL159>: + 7c4: 1ea05763 blez a0,9b2 <.L42> + +000007c8 <.L40>: + 7c8: 47f2 lw a5,28(sp) + 7ca: 80000437 lui s0,0x80000 + 7ce: fff44413 not s0,s0 + 7d2: 0087f333 and t1,a5,s0 + 7d6: 000007b7 lui a5,0x0 + 7da: 0007a703 lw a4,0(a5) # 0 <__divdc3> + 7de: 0047a783 lw a5,4(a5) + 7e2: 859a mv a1,t1 + 7e4: da3a sw a4,52(sp) + 7e6: 863a mv a2,a4 + 7e8: 4712 lw a4,4(sp) + 7ea: 86be mv a3,a5 + 7ec: dc3e sw a5,56(sp) + 7ee: 853a mv a0,a4 + 7f0: c09a sw t1,64(sp) + 7f2: 00000097 auipc ra,0x0 + 7f6: 000080e7 jalr ra # 7f2 <.L40+0x2a> + +000007fa <.LVL160>: + 7fa: 1a051c63 bnez a0,9b2 <.L42> + 7fe: 4712 lw a4,4(sp) + 800: 4306 lw t1,64(sp) + 802: 5652 lw a2,52(sp) + 804: 56e2 lw a3,56(sp) + 806: 853a mv a0,a4 + 808: 859a mv a1,t1 + 80a: 00000097 auipc ra,0x0 + 80e: 000080e7 jalr ra # 80a <.LVL160+0x10> + +00000812 <.LVL161>: + 812: 1aa04063 bgtz a0,9b2 <.L42> + 816: 5782 lw a5,32(sp) + 818: 4732 lw a4,12(sp) + 81a: 5652 lw a2,52(sp) + 81c: 56e2 lw a3,56(sp) + 81e: 8c7d and s0,s0,a5 + 820: 853a mv a0,a4 + 822: 85a2 mv a1,s0 + 824: 00000097 auipc ra,0x0 + 828: 000080e7 jalr ra # 824 <.LVL161+0x12> + +0000082c <.LVL162>: + 82c: 18051363 bnez a0,9b2 <.L42> + 830: 4732 lw a4,12(sp) + 832: 5652 lw a2,52(sp) + 834: 56e2 lw a3,56(sp) + 836: 853a mv a0,a4 + 838: 85a2 mv a1,s0 + 83a: 00000097 auipc ra,0x0 + 83e: 000080e7 jalr ra # 83a <.LVL162+0xe> + +00000842 <.LVL163>: + 842: 16a04863 bgtz a0,9b2 <.L42> + 846: 57f2 lw a5,60(sp) + 848: 5652 lw a2,52(sp) + 84a: 56e2 lw a3,56(sp) + 84c: 8526 mv a0,s1 + 84e: 85be mv a1,a5 + 850: 4405 li s0,1 + 852: 00000097 auipc ra,0x0 + 856: 000080e7 jalr ra # 852 <.LVL163+0x10> + +0000085a <.LVL164>: + 85a: ed09 bnez a0,874 <.L43> + 85c: 57f2 lw a5,60(sp) + 85e: 5652 lw a2,52(sp) + 860: 56e2 lw a3,56(sp) + 862: 8526 mv a0,s1 + 864: 85be mv a1,a5 + 866: 00000097 auipc ra,0x0 + 86a: 000080e7 jalr ra # 866 <.LVL164+0xc> + +0000086e <.LVL165>: + 86e: 00a05363 blez a0,874 <.L43> + 872: 4401 li s0,0 + +00000874 <.L43>: + 874: 00144513 xor a0,s0,1 + 878: 8905 and a0,a0,1 + 87a: 00000097 auipc ra,0x0 + 87e: 000080e7 jalr ra # 87a <.L43+0x6> + +00000882 <.LVL166>: + 882: 46d2 lw a3,20(sp) + 884: 80000737 lui a4,0x80000 + 888: fff74793 not a5,a4 + 88c: 8dfd and a1,a1,a5 + 88e: 8f75 and a4,a4,a3 + 890: 8f4d or a4,a4,a1 + 892: d23a sw a4,36(sp) + +00000894 <.LVL167>: + 894: 4742 lw a4,16(sp) + 896: 4302 lw t1,0(sp) + 898: 84aa mv s1,a0 + +0000089a <.LVL168>: + 89a: 8ff9 and a5,a5,a4 + 89c: 00000737 lui a4,0x0 + 8a0: 00072683 lw a3,0(a4) # 0 <__divdc3> + 8a4: 00472703 lw a4,4(a4) + 8a8: 851a mv a0,t1 + 8aa: ca36 sw a3,20(sp) + 8ac: 8636 mv a2,a3 + 8ae: 85be mv a1,a5 + 8b0: 86ba mv a3,a4 + 8b2: 4405 li s0,1 + 8b4: cc3a sw a4,24(sp) + 8b6: d43e sw a5,40(sp) + 8b8: 00000097 auipc ra,0x0 + 8bc: 000080e7 jalr ra # 8b8 <.LVL168+0x1e> + +000008c0 <.LVL169>: + 8c0: ed11 bnez a0,8dc <.L44> + 8c2: 4302 lw t1,0(sp) + 8c4: 57a2 lw a5,40(sp) + 8c6: 4652 lw a2,20(sp) + 8c8: 46e2 lw a3,24(sp) + 8ca: 851a mv a0,t1 + 8cc: 85be mv a1,a5 + 8ce: 00000097 auipc ra,0x0 + 8d2: 000080e7 jalr ra # 8ce <.LVL169+0xe> + +000008d6 <.LVL170>: + 8d6: 00a05363 blez a0,8dc <.L44> + 8da: 4401 li s0,0 + +000008dc <.L44>: + 8dc: 00144513 xor a0,s0,1 + 8e0: 8905 and a0,a0,1 + 8e2: 00000097 auipc ra,0x0 + 8e6: 000080e7 jalr ra # 8e2 <.L44+0x6> + +000008ea <.LVL171>: + 8ea: 800007b7 lui a5,0x80000 + 8ee: fff7c713 not a4,a5 + 8f2: 00e5f433 and s0,a1,a4 + 8f6: 4742 lw a4,16(sp) + 8f8: 5292 lw t0,36(sp) + 8fa: 8626 mv a2,s1 + 8fc: 8ff9 and a5,a5,a4 + 8fe: 8c5d or s0,s0,a5 + +00000900 <.LVL172>: + 900: c026 sw s1,0(sp) + 902: 47f2 lw a5,28(sp) + 904: 4492 lw s1,4(sp) + +00000906 <.LVL173>: + 906: 8696 mv a3,t0 + 908: 85be mv a1,a5 + 90a: ca2a sw a0,20(sp) + +0000090c <.LVL174>: + 90c: 8526 mv a0,s1 + 90e: d616 sw t0,44(sp) + +00000910 <.LVL175>: + 910: c83e sw a5,16(sp) + 912: 00000097 auipc ra,0x0 + 916: 000080e7 jalr ra # 912 <.LVL175+0x2> + +0000091a <.LVL176>: + 91a: 43d2 lw t2,20(sp) + 91c: 86a2 mv a3,s0 + 91e: ca22 sw s0,20(sp) + 920: 861e mv a2,t2 + 922: 5402 lw s0,32(sp) + 924: ce1e sw t2,28(sp) + +00000926 <.LVL177>: + 926: 43b2 lw t2,12(sp) + 928: c22a sw a0,4(sp) + 92a: d22e sw a1,36(sp) + +0000092c <.LVL178>: + 92c: 851e mv a0,t2 + 92e: 85a2 mv a1,s0 + 930: 00000097 auipc ra,0x0 + 934: 000080e7 jalr ra # 930 <.LVL178+0x4> + +00000938 <.LVL179>: + 938: 5312 lw t1,36(sp) + 93a: 862a mv a2,a0 + 93c: 4512 lw a0,4(sp) + 93e: 86ae mv a3,a1 + 940: 859a mv a1,t1 + 942: 00000097 auipc ra,0x0 + 946: 000080e7 jalr ra # 942 <.LVL179+0xa> + +0000094a <.LVL180>: + 94a: 00000337 lui t1,0x0 + 94e: 00032603 lw a2,0(t1) # 0 <__divdc3> + 952: 00432683 lw a3,4(t1) + 956: 00000097 auipc ra,0x0 + 95a: 000080e7 jalr ra # 956 <.LVL180+0xc> + +0000095e <.LVL181>: + 95e: 47d2 lw a5,20(sp) + 960: 4772 lw a4,28(sp) + 962: d22a sw a0,36(sp) + 964: 86be mv a3,a5 + 966: 47c2 lw a5,16(sp) + 968: 863a mv a2,a4 + 96a: d42e sw a1,40(sp) + +0000096c <.LVL182>: + 96c: 8526 mv a0,s1 + +0000096e <.LVL183>: + 96e: 85be mv a1,a5 + +00000970 <.LVL184>: + 970: 00000097 auipc ra,0x0 + 974: 000080e7 jalr ra # 970 <.LVL184> + +00000978 <.LVL185>: + 978: 52b2 lw t0,44(sp) + 97a: 43b2 lw t2,12(sp) + 97c: 84ae mv s1,a1 + 97e: 4582 lw a1,0(sp) + 980: 8696 mv a3,t0 + 982: c22a sw a0,4(sp) + 984: 862e mv a2,a1 + 986: 851e mv a0,t2 + 988: 85a2 mv a1,s0 + 98a: 00000097 auipc ra,0x0 + 98e: 000080e7 jalr ra # 98a <.LVL185+0x12> + +00000992 <.LVL186>: + 992: 4792 lw a5,4(sp) + 994: 862a mv a2,a0 + 996: 86ae mv a3,a1 + 998: 853e mv a0,a5 + 99a: 85a6 mv a1,s1 + 99c: 00000097 auipc ra,0x0 + 9a0: 000080e7 jalr ra # 99c <.LVL186+0xa> + +000009a4 <.LVL187>: + 9a4: 00000337 lui t1,0x0 + 9a8: 00032603 lw a2,0(t1) # 0 <__divdc3> + 9ac: 00432683 lw a3,4(t1) + 9b0: bc01 j 3c0 <.L82> + +000009b2 <.L42>: + 9b2: 47f2 lw a5,28(sp) + 9b4: 0786 sll a5,a5,0x1 + 9b6: 8385 srl a5,a5,0x1 + 9b8: c0be sw a5,64(sp) + 9ba: 000007b7 lui a5,0x0 + 9be: 0007a703 lw a4,0(a5) # 0 <__divdc3> + 9c2: 0047a783 lw a5,4(a5) + 9c6: da3a sw a4,52(sp) + 9c8: dc3e sw a5,56(sp) + 9ca: 863a mv a2,a4 + 9cc: 86be mv a3,a5 + 9ce: 4712 lw a4,4(sp) + 9d0: 4786 lw a5,64(sp) + 9d2: 853a mv a0,a4 + 9d4: 85be mv a1,a5 + 9d6: 00000097 auipc ra,0x0 + 9da: 000080e7 jalr ra # 9d6 <.L42+0x24> + +000009de <.LVL189>: + 9de: ed09 bnez a0,9f8 <.L68> + 9e0: 4712 lw a4,4(sp) + 9e2: 4786 lw a5,64(sp) + 9e4: 5652 lw a2,52(sp) + 9e6: 56e2 lw a3,56(sp) + 9e8: 853a mv a0,a4 + 9ea: 85be mv a1,a5 + 9ec: 00000097 auipc ra,0x0 + 9f0: 000080e7 jalr ra # 9ec <.LVL189+0xe> + +000009f4 <.LVL190>: + 9f4: 04a04463 bgtz a0,a3c <.L45> + +000009f8 <.L68>: + 9f8: 5782 lw a5,32(sp) + 9fa: 00000737 lui a4,0x0 + 9fe: 4332 lw t1,12(sp) + a00: 0786 sll a5,a5,0x1 + a02: 0017d413 srl s0,a5,0x1 + a06: 00472783 lw a5,4(a4) # 4 <__divdc3+0x4> + a0a: 00072703 lw a4,0(a4) + a0e: 851a mv a0,t1 + a10: 86be mv a3,a5 + a12: 863a mv a2,a4 + a14: 85a2 mv a1,s0 + a16: da3a sw a4,52(sp) + a18: dc3e sw a5,56(sp) + a1a: 00000097 auipc ra,0x0 + a1e: 000080e7 jalr ra # a1a <.L68+0x22> + +00000a22 <.LVL191>: + a22: 9a0515e3 bnez a0,3cc <.L31> + a26: 4332 lw t1,12(sp) + a28: 5652 lw a2,52(sp) + a2a: 56e2 lw a3,56(sp) + a2c: 851a mv a0,t1 + a2e: 85a2 mv a1,s0 + a30: 00000097 auipc ra,0x0 + a34: 000080e7 jalr ra # a30 <.LVL191+0xe> + +00000a38 <.LVL192>: + a38: 98a05ae3 blez a0,3cc <.L31> + +00000a3c <.L45>: + a3c: 000007b7 lui a5,0x0 + a40: 0007a703 lw a4,0(a5) # 0 <__divdc3> + a44: 0047a783 lw a5,4(a5) + a48: 8526 mv a0,s1 + a4a: 863a mv a2,a4 + a4c: dc3e sw a5,56(sp) + a4e: 86be mv a3,a5 + a50: 57f2 lw a5,60(sp) + a52: da3a sw a4,52(sp) + a54: 85be mv a1,a5 + a56: 00000097 auipc ra,0x0 + a5a: 000080e7 jalr ra # a56 <.L45+0x1a> + +00000a5e <.LVL193>: + a5e: 960517e3 bnez a0,3cc <.L31> + a62: 57f2 lw a5,60(sp) + a64: 5652 lw a2,52(sp) + a66: 56e2 lw a3,56(sp) + a68: 8526 mv a0,s1 + a6a: 85be mv a1,a5 + a6c: 00000097 auipc ra,0x0 + a70: 000080e7 jalr ra # a6c <.LVL193+0xe> + +00000a74 <.LVL194>: + a74: 94a04ce3 bgtz a0,3cc <.L31> + a78: 47c2 lw a5,16(sp) + a7a: 4702 lw a4,0(sp) + a7c: 5652 lw a2,52(sp) + a7e: 00179413 sll s0,a5,0x1 + a82: 56e2 lw a3,56(sp) + a84: 8005 srl s0,s0,0x1 + a86: 853a mv a0,a4 + a88: 85a2 mv a1,s0 + a8a: 00000097 auipc ra,0x0 + a8e: 000080e7 jalr ra # a8a <.LVL194+0x16> + +00000a92 <.LVL195>: + a92: 92051de3 bnez a0,3cc <.L31> + a96: 4702 lw a4,0(sp) + a98: 5652 lw a2,52(sp) + a9a: 56e2 lw a3,56(sp) + a9c: 853a mv a0,a4 + a9e: 85a2 mv a1,s0 + aa0: 00000097 auipc ra,0x0 + aa4: 000080e7 jalr ra # aa0 <.LVL195+0xe> + +00000aa8 <.LVL196>: + aa8: 92a042e3 bgtz a0,3cc <.L31> + aac: 4712 lw a4,4(sp) + aae: 4786 lw a5,64(sp) + ab0: 5652 lw a2,52(sp) + ab2: 56e2 lw a3,56(sp) + ab4: 853a mv a0,a4 + ab6: 85be mv a1,a5 + ab8: 4405 li s0,1 + aba: 00000097 auipc ra,0x0 + abe: 000080e7 jalr ra # aba <.LVL196+0x12> + +00000ac2 <.LVL197>: + ac2: ed11 bnez a0,ade <.L47> + ac4: 4712 lw a4,4(sp) + ac6: 4786 lw a5,64(sp) + ac8: 5652 lw a2,52(sp) + aca: 56e2 lw a3,56(sp) + acc: 853a mv a0,a4 + ace: 85be mv a1,a5 + ad0: 00000097 auipc ra,0x0 + ad4: 000080e7 jalr ra # ad0 <.LVL197+0xe> + +00000ad8 <.LVL198>: + ad8: 00a05363 blez a0,ade <.L47> + adc: 4401 li s0,0 + +00000ade <.L47>: + ade: 00144513 xor a0,s0,1 + ae2: 8905 and a0,a0,1 + ae4: 00000097 auipc ra,0x0 + ae8: 000080e7 jalr ra # ae4 <.L47+0x6> + +00000aec <.LVL199>: + aec: 46f2 lw a3,28(sp) + aee: 80000737 lui a4,0x80000 + af2: fff74793 not a5,a4 + af6: 8dfd and a1,a1,a5 + af8: 8f75 and a4,a4,a3 + afa: 8f4d or a4,a4,a1 + afc: ce3a sw a4,28(sp) + +00000afe <.LVL200>: + afe: 5702 lw a4,32(sp) + +00000b00 <.LVL201>: + b00: 4332 lw t1,12(sp) + b02: d22a sw a0,36(sp) + +00000b04 <.LVL202>: + b04: 8ff9 and a5,a5,a4 + b06: 00000737 lui a4,0x0 + b0a: 00072683 lw a3,0(a4) # 0 <__divdc3> + b0e: 00472703 lw a4,4(a4) + b12: 851a mv a0,t1 + b14: c236 sw a3,4(sp) + b16: 8636 mv a2,a3 + b18: 85be mv a1,a5 + b1a: 86ba mv a3,a4 + b1c: 4405 li s0,1 + b1e: c43a sw a4,8(sp) + b20: d43e sw a5,40(sp) + b22: 00000097 auipc ra,0x0 + b26: 000080e7 jalr ra # b22 <.LVL202+0x1e> + +00000b2a <.LVL203>: + b2a: ed11 bnez a0,b46 <.L48> + b2c: 4332 lw t1,12(sp) + b2e: 57a2 lw a5,40(sp) + b30: 4612 lw a2,4(sp) + b32: 46a2 lw a3,8(sp) + b34: 851a mv a0,t1 + b36: 85be mv a1,a5 + b38: 00000097 auipc ra,0x0 + b3c: 000080e7 jalr ra # b38 <.LVL203+0xe> + +00000b40 <.LVL204>: + b40: 00a05363 blez a0,b46 <.L48> + b44: 4401 li s0,0 + +00000b46 <.L48>: + b46: 00144513 xor a0,s0,1 + b4a: 8905 and a0,a0,1 + b4c: 00000097 auipc ra,0x0 + b50: 000080e7 jalr ra # b4c <.L48+0x6> + +00000b54 <.LVL205>: + b54: 800007b7 lui a5,0x80000 + b58: fff7c713 not a4,a5 + b5c: 00e5f433 and s0,a1,a4 + b60: 5702 lw a4,32(sp) + b62: 42d2 lw t0,20(sp) + b64: 5312 lw t1,36(sp) + b66: 8ff9 and a5,a5,a4 + b68: 4772 lw a4,28(sp) + b6a: 861a mv a2,t1 + b6c: 8596 mv a1,t0 + b6e: 86ba mv a3,a4 + b70: d42a sw a0,40(sp) + b72: 8526 mv a0,s1 + b74: 8c5d or s0,s0,a5 + +00000b76 <.LVL206>: + b76: d016 sw t0,32(sp) + b78: d81a sw t1,48(sp) + +00000b7a <.LVL207>: + b7a: d63a sw a4,44(sp) + b7c: c226 sw s1,4(sp) + b7e: 00000097 auipc ra,0x0 + b82: 000080e7 jalr ra # b7e <.LVL207+0x4> + +00000b86 <.LVL208>: + b86: 53a2 lw t2,40(sp) + b88: 86a2 mv a3,s0 + b8a: 84a2 mv s1,s0 + +00000b8c <.LVL209>: + b8c: 861e mv a2,t2 + b8e: 4442 lw s0,16(sp) + +00000b90 <.LVL210>: + b90: ce1e sw t2,28(sp) + b92: 4382 lw t2,0(sp) + b94: c62a sw a0,12(sp) + b96: ca2e sw a1,20(sp) + +00000b98 <.LVL211>: + b98: 851e mv a0,t2 + b9a: 85a2 mv a1,s0 + b9c: 00000097 auipc ra,0x0 + ba0: 000080e7 jalr ra # b9c <.LVL211+0x4> + +00000ba4 <.LVL212>: + ba4: 862a mv a2,a0 + ba6: 86ae mv a3,a1 + ba8: 4532 lw a0,12(sp) + baa: 45d2 lw a1,20(sp) + bac: 00000097 auipc ra,0x0 + bb0: 000080e7 jalr ra # bac <.LVL212+0x8> + +00000bb4 <.LVL213>: + bb4: 4601 li a2,0 + bb6: 4681 li a3,0 + bb8: 00000097 auipc ra,0x0 + bbc: 000080e7 jalr ra # bb8 <.LVL213+0x4> + +00000bc0 <.LVL214>: + bc0: 4382 lw t2,0(sp) + bc2: 5732 lw a4,44(sp) + bc4: 5342 lw t1,48(sp) + bc6: d22a sw a0,36(sp) + bc8: 86ba mv a3,a4 + bca: 861a mv a2,t1 + bcc: 851e mv a0,t2 + bce: d42e sw a1,40(sp) + +00000bd0 <.LVL215>: + bd0: 85a2 mv a1,s0 + +00000bd2 <.LVL216>: + bd2: 00000097 auipc ra,0x0 + bd6: 000080e7 jalr ra # bd2 <.LVL216> + +00000bda <.LVL217>: + bda: 47f2 lw a5,28(sp) + bdc: 4312 lw t1,4(sp) + bde: 5282 lw t0,32(sp) + be0: 863e mv a2,a5 + be2: c02a sw a0,0(sp) + +00000be4 <.LVL218>: + be4: 842e mv s0,a1 + be6: 86a6 mv a3,s1 + be8: 851a mv a0,t1 + bea: 8596 mv a1,t0 + bec: 00000097 auipc ra,0x0 + bf0: 000080e7 jalr ra # bec <.LVL218+0x8> + +00000bf4 <.LVL219>: + bf4: 4702 lw a4,0(sp) + bf6: 862a mv a2,a0 + bf8: 86ae mv a3,a1 + bfa: 853a mv a0,a4 + bfc: 85a2 mv a1,s0 + bfe: 00000097 auipc ra,0x0 + c02: 000080e7 jalr ra # bfe <.LVL219+0xa> + +00000c06 <.LVL220>: + c06: 4601 li a2,0 + c08: 4681 li a3,0 + c0a: fb6ff06f j 3c0 <.L82> + +_divxc3.o: file format elf32-littleriscv + + +_divtc3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__divtc3>: + 0: 419c lw a5,0(a1) + 2: f2410113 add sp,sp,-220 + 6: cd86 sw ra,216(sp) + 8: c03e sw a5,0(sp) + a: 41dc lw a5,4(a1) + c: cba2 sw s0,212(sp) + e: c9a6 sw s1,208(sp) + 10: c23e sw a5,4(sp) + 12: 459c lw a5,8(a1) + 14: c0aa sw a0,64(sp) + 16: 80000437 lui s0,0x80000 + 1a: c43e sw a5,8(sp) + 1c: 45dc lw a5,12(a1) + 1e: fff44413 not s0,s0 + 22: 190c add a1,sp,176 + 24: da3e sw a5,52(sp) + 26: 421c lw a5,0(a2) + 28: 0188 add a0,sp,192 + 2a: c63e sw a5,12(sp) + 2c: 425c lw a5,4(a2) + 2e: c83e sw a5,16(sp) + 30: 461c lw a5,8(a2) + 32: ca3e sw a5,20(sp) + 34: 465c lw a5,12(a2) + 36: d83e sw a5,48(sp) + 38: 429c lw a5,0(a3) + 3a: cc3e sw a5,24(sp) + 3c: 42dc lw a5,4(a3) + 3e: ce3e sw a5,28(sp) + 40: 469c lw a5,8(a3) + 42: d03e sw a5,32(sp) + 44: 46dc lw a5,12(a3) + 46: dc3e sw a5,56(sp) + 48: 431c lw a5,0(a4) + 4a: d23e sw a5,36(sp) + 4c: 435c lw a5,4(a4) + 4e: d43e sw a5,40(sp) + 50: 471c lw a5,8(a4) + 52: d63e sw a5,44(sp) + 54: 475c lw a5,12(a4) + 56: de3e sw a5,60(sp) + 58: 57e2 lw a5,56(sp) + 5a: 0087f4b3 and s1,a5,s0 + 5e: 57f2 lw a5,60(sp) + 60: c7a6 sw s1,204(sp) + 62: 8c7d and s0,s0,a5 + 64: 47e2 lw a5,24(sp) + 66: df22 sw s0,188(sp) + 68: c1be sw a5,192(sp) + 6a: 47f2 lw a5,28(sp) + 6c: c3be sw a5,196(sp) + 6e: 5782 lw a5,32(sp) + 70: c5be sw a5,200(sp) + 72: 5792 lw a5,36(sp) + 74: d93e sw a5,176(sp) + 76: 57a2 lw a5,40(sp) + 78: db3e sw a5,180(sp) + 7a: 57b2 lw a5,44(sp) + 7c: dd3e sw a5,184(sp) + 7e: 00000097 auipc ra,0x0 + 82: 000080e7 jalr ra # 7e <__divtc3+0x7e> + +00000086 <.LVL2>: + 86: 00000737 lui a4,0x0 + 8a: 00c72703 lw a4,12(a4) # c <__divtc3+0xc> + 8e: 57fd li a5,-1 + 90: 020558e3 bgez a0,8c0 <.L72> + 94: 5692 lw a3,36(sp) + 96: 190c add a1,sp,176 + 98: 0188 add a0,sp,192 + 9a: c1b6 sw a3,192(sp) + 9c: 56a2 lw a3,40(sp) + 9e: c7a2 sw s0,204(sp) + a0: d93e sw a5,176(sp) + a2: c3b6 sw a3,196(sp) + a4: 56b2 lw a3,44(sp) + a6: db3e sw a5,180(sp) + a8: dd3e sw a5,184(sp) + aa: c5b6 sw a3,200(sp) + ac: df3a sw a4,188(sp) + ae: 00000097 auipc ra,0x0 + b2: 000080e7 jalr ra # ae <.LVL2+0x28> + +000000b6 <.LVL3>: + b6: 0e054063 bltz a0,196 <.L4> + ba: 4782 lw a5,0(sp) + bc: 3ffe0437 lui s0,0x3ffe0 + c0: 1110 add a2,sp,160 + c2: d93e sw a5,176(sp) + c4: 4792 lw a5,4(sp) + c6: 190c add a1,sp,176 + c8: 0188 add a0,sp,192 + ca: db3e sw a5,180(sp) + cc: 47a2 lw a5,8(sp) + ce: d102 sw zero,160(sp) + d0: d302 sw zero,164(sp) + d2: dd3e sw a5,184(sp) + d4: 57d2 lw a5,52(sp) + d6: d502 sw zero,168(sp) + d8: d722 sw s0,172(sp) + da: df3e sw a5,188(sp) + dc: 00000097 auipc ra,0x0 + e0: 000080e7 jalr ra # dc <.LVL3+0x26> + +000000e4 <.LVL4>: + e4: 478e lw a5,192(sp) + e6: 1110 add a2,sp,160 + e8: 190c add a1,sp,176 + ea: c03e sw a5,0(sp) + ec: 479e lw a5,196(sp) + ee: 0188 add a0,sp,192 + f0: d102 sw zero,160(sp) + f2: c23e sw a5,4(sp) + f4: 47ae lw a5,200(sp) + f6: d302 sw zero,164(sp) + f8: d502 sw zero,168(sp) + fa: c43e sw a5,8(sp) + fc: 47be lw a5,204(sp) + fe: d722 sw s0,172(sp) + 100: da3e sw a5,52(sp) + +00000102 <.LVL5>: + 102: 47b2 lw a5,12(sp) + +00000104 <.LVL6>: + 104: d93e sw a5,176(sp) + 106: 47c2 lw a5,16(sp) + 108: db3e sw a5,180(sp) + 10a: 47d2 lw a5,20(sp) + 10c: dd3e sw a5,184(sp) + 10e: 57c2 lw a5,48(sp) + 110: df3e sw a5,188(sp) + 112: 00000097 auipc ra,0x0 + 116: 000080e7 jalr ra # 112 <.LVL6+0xe> + +0000011a <.LVL7>: + 11a: 478e lw a5,192(sp) + 11c: 1110 add a2,sp,160 + 11e: 190c add a1,sp,176 + 120: c63e sw a5,12(sp) + 122: 479e lw a5,196(sp) + 124: 0188 add a0,sp,192 + 126: d102 sw zero,160(sp) + 128: c83e sw a5,16(sp) + 12a: 47ae lw a5,200(sp) + 12c: d302 sw zero,164(sp) + 12e: d502 sw zero,168(sp) + 130: ca3e sw a5,20(sp) + 132: 47be lw a5,204(sp) + 134: d722 sw s0,172(sp) + 136: d83e sw a5,48(sp) + +00000138 <.LVL8>: + 138: 47e2 lw a5,24(sp) + +0000013a <.LVL9>: + 13a: d93e sw a5,176(sp) + 13c: 47f2 lw a5,28(sp) + 13e: db3e sw a5,180(sp) + 140: 5782 lw a5,32(sp) + 142: dd3e sw a5,184(sp) + 144: 57e2 lw a5,56(sp) + 146: df3e sw a5,188(sp) + 148: 00000097 auipc ra,0x0 + 14c: 000080e7 jalr ra # 148 <.LVL9+0xe> + +00000150 <.LVL10>: + 150: 478e lw a5,192(sp) + 152: 1110 add a2,sp,160 + 154: 190c add a1,sp,176 + 156: cc3e sw a5,24(sp) + 158: 479e lw a5,196(sp) + 15a: 0188 add a0,sp,192 + 15c: d102 sw zero,160(sp) + 15e: ce3e sw a5,28(sp) + 160: 47ae lw a5,200(sp) + 162: d302 sw zero,164(sp) + 164: d502 sw zero,168(sp) + 166: d03e sw a5,32(sp) + 168: 47be lw a5,204(sp) + 16a: d722 sw s0,172(sp) + 16c: dc3e sw a5,56(sp) + +0000016e <.LVL11>: + 16e: 5792 lw a5,36(sp) + +00000170 <.LVL12>: + 170: d93e sw a5,176(sp) + 172: 57a2 lw a5,40(sp) + 174: db3e sw a5,180(sp) + 176: 57b2 lw a5,44(sp) + 178: dd3e sw a5,184(sp) + 17a: 57f2 lw a5,60(sp) + 17c: df3e sw a5,188(sp) + 17e: 00000097 auipc ra,0x0 + 182: 000080e7 jalr ra # 17e <.LVL12+0xe> + +00000186 <.LVL13>: + 186: 478e lw a5,192(sp) + 188: d23e sw a5,36(sp) + 18a: 479e lw a5,196(sp) + 18c: d43e sw a5,40(sp) + 18e: 47ae lw a5,200(sp) + 190: d63e sw a5,44(sp) + 192: 47be lw a5,204(sp) + 194: de3e sw a5,60(sp) + +00000196 <.L4>: + 196: 57f2 lw a5,60(sp) + 198: 80000437 lui s0,0x80000 + 19c: fff44413 not s0,s0 + 1a0: 8fe1 and a5,a5,s0 + 1a2: c2be sw a5,68(sp) + 1a4: 5792 lw a5,36(sp) + 1a6: 190c add a1,sp,176 + 1a8: 0188 add a0,sp,192 + 1aa: c1be sw a5,192(sp) + 1ac: 57a2 lw a5,40(sp) + 1ae: d902 sw zero,176(sp) + 1b0: db02 sw zero,180(sp) + 1b2: c3be sw a5,196(sp) + 1b4: 57b2 lw a5,44(sp) + 1b6: dd02 sw zero,184(sp) + 1b8: c5be sw a5,200(sp) + 1ba: 4796 lw a5,68(sp) + 1bc: c7be sw a5,204(sp) + 1be: 3f8f07b7 lui a5,0x3f8f0 + 1c2: df3e sw a5,188(sp) + 1c4: 00000097 auipc ra,0x0 + 1c8: 000080e7 jalr ra # 1c4 <.L4+0x2e> + +000001cc <.LVL15>: + 1cc: 0e055163 bgez a0,2ae <.L73> + +000001d0 <.L78>: + 1d0: 4782 lw a5,0(sp) + 1d2: 406f0437 lui s0,0x406f0 + 1d6: 1110 add a2,sp,160 + 1d8: d93e sw a5,176(sp) + 1da: 4792 lw a5,4(sp) + 1dc: 190c add a1,sp,176 + 1de: 0188 add a0,sp,192 + 1e0: db3e sw a5,180(sp) + 1e2: 47a2 lw a5,8(sp) + 1e4: d102 sw zero,160(sp) + 1e6: d302 sw zero,164(sp) + 1e8: dd3e sw a5,184(sp) + 1ea: 57d2 lw a5,52(sp) + 1ec: d502 sw zero,168(sp) + 1ee: d722 sw s0,172(sp) + 1f0: df3e sw a5,188(sp) + 1f2: 00000097 auipc ra,0x0 + 1f6: 000080e7 jalr ra # 1f2 <.L78+0x22> + +000001fa <.LVL16>: + 1fa: 478e lw a5,192(sp) + 1fc: 1110 add a2,sp,160 + 1fe: 190c add a1,sp,176 + 200: c03e sw a5,0(sp) + +00000202 <.LVL17>: + 202: 479e lw a5,196(sp) + 204: 0188 add a0,sp,192 + 206: d102 sw zero,160(sp) + 208: c23e sw a5,4(sp) + 20a: 47ae lw a5,200(sp) + 20c: d302 sw zero,164(sp) + 20e: d502 sw zero,168(sp) + 210: c43e sw a5,8(sp) + 212: 47be lw a5,204(sp) + 214: d722 sw s0,172(sp) + 216: da3e sw a5,52(sp) + +00000218 <.LVL18>: + 218: 47b2 lw a5,12(sp) + +0000021a <.LVL19>: + 21a: d93e sw a5,176(sp) + 21c: 47c2 lw a5,16(sp) + 21e: db3e sw a5,180(sp) + 220: 47d2 lw a5,20(sp) + 222: dd3e sw a5,184(sp) + 224: 57c2 lw a5,48(sp) + 226: df3e sw a5,188(sp) + 228: 00000097 auipc ra,0x0 + 22c: 000080e7 jalr ra # 228 <.LVL19+0xe> + +00000230 <.LVL20>: + 230: 478e lw a5,192(sp) + 232: 1110 add a2,sp,160 + 234: 190c add a1,sp,176 + 236: c63e sw a5,12(sp) + +00000238 <.LVL21>: + 238: 479e lw a5,196(sp) + 23a: 0188 add a0,sp,192 + 23c: d102 sw zero,160(sp) + 23e: c83e sw a5,16(sp) + 240: 47ae lw a5,200(sp) + 242: d302 sw zero,164(sp) + 244: d502 sw zero,168(sp) + 246: ca3e sw a5,20(sp) + 248: 47be lw a5,204(sp) + 24a: d722 sw s0,172(sp) + 24c: d83e sw a5,48(sp) + +0000024e <.LVL22>: + 24e: 47e2 lw a5,24(sp) + +00000250 <.LVL23>: + 250: d93e sw a5,176(sp) + 252: 47f2 lw a5,28(sp) + 254: db3e sw a5,180(sp) + 256: 5782 lw a5,32(sp) + 258: dd3e sw a5,184(sp) + 25a: 57e2 lw a5,56(sp) + 25c: df3e sw a5,188(sp) + 25e: 00000097 auipc ra,0x0 + 262: 000080e7 jalr ra # 25e <.LVL23+0xe> + +00000266 <.LVL24>: + 266: 478e lw a5,192(sp) + 268: 1110 add a2,sp,160 + 26a: 190c add a1,sp,176 + 26c: cc3e sw a5,24(sp) + +0000026e <.LVL25>: + 26e: 479e lw a5,196(sp) + 270: 0188 add a0,sp,192 + 272: d102 sw zero,160(sp) + 274: ce3e sw a5,28(sp) + 276: 47ae lw a5,200(sp) + 278: d302 sw zero,164(sp) + 27a: d502 sw zero,168(sp) + 27c: d03e sw a5,32(sp) + 27e: 47be lw a5,204(sp) + 280: d722 sw s0,172(sp) + 282: dc3e sw a5,56(sp) + +00000284 <.LVL26>: + 284: 5792 lw a5,36(sp) + +00000286 <.LVL27>: + 286: d93e sw a5,176(sp) + 288: 57a2 lw a5,40(sp) + 28a: db3e sw a5,180(sp) + 28c: 57b2 lw a5,44(sp) + 28e: dd3e sw a5,184(sp) + 290: 57f2 lw a5,60(sp) + 292: df3e sw a5,188(sp) + 294: 00000097 auipc ra,0x0 + 298: 000080e7 jalr ra # 294 <.LVL27+0xe> + +0000029c <.LVL28>: + 29c: 478e lw a5,192(sp) + 29e: d23e sw a5,36(sp) + +000002a0 <.LVL29>: + 2a0: 479e lw a5,196(sp) + 2a2: d43e sw a5,40(sp) + 2a4: 47ae lw a5,200(sp) + 2a6: d63e sw a5,44(sp) + 2a8: 47be lw a5,204(sp) + 2aa: de3e sw a5,60(sp) + +000002ac <.LVL30>: + 2ac: a0fd j 39a <.L8> + +000002ae <.L73>: + 2ae: 57d2 lw a5,52(sp) + 2b0: 190c add a1,sp,176 + 2b2: 0188 add a0,sp,192 + 2b4: 0087f4b3 and s1,a5,s0 + 2b8: 57c2 lw a5,48(sp) + 2ba: c7a6 sw s1,204(sp) + 2bc: d902 sw zero,176(sp) + 2be: 8c7d and s0,s0,a5 + 2c0: 4782 lw a5,0(sp) + 2c2: db02 sw zero,180(sp) + 2c4: dd02 sw zero,184(sp) + 2c6: c1be sw a5,192(sp) + 2c8: 4792 lw a5,4(sp) + 2ca: c3be sw a5,196(sp) + 2cc: 47a2 lw a5,8(sp) + 2ce: c5be sw a5,200(sp) + 2d0: 67c1 lui a5,0x10 + 2d2: df3e sw a5,188(sp) + 2d4: 00000097 auipc ra,0x0 + 2d8: 000080e7 jalr ra # 2d4 <.L73+0x26> + +000002dc <.LVL32>: + 2dc: 02055a63 bgez a0,310 <.L9> + 2e0: 46b2 lw a3,12(sp) + 2e2: 57fd li a5,-1 + 2e4: 00000737 lui a4,0x0 + 2e8: c1b6 sw a3,192(sp) + 2ea: 46c2 lw a3,16(sp) + 2ec: d93e sw a5,176(sp) + 2ee: db3e sw a5,180(sp) + 2f0: c3b6 sw a3,196(sp) + 2f2: dd3e sw a5,184(sp) + 2f4: 46d2 lw a3,20(sp) + 2f6: 00c72783 lw a5,12(a4) # c <__divtc3+0xc> + 2fa: 190c add a1,sp,176 + 2fc: 0188 add a0,sp,192 + 2fe: c5b6 sw a3,200(sp) + 300: c7a2 sw s0,204(sp) + 302: df3e sw a5,188(sp) + 304: 00000097 auipc ra,0x0 + 308: 000080e7 jalr ra # 304 <.LVL32+0x28> + +0000030c <.LVL33>: + 30c: 04054e63 bltz a0,368 <.L11> + +00000310 <.L9>: + 310: 47b2 lw a5,12(sp) + 312: 190c add a1,sp,176 + 314: 0188 add a0,sp,192 + 316: c1be sw a5,192(sp) + 318: 47c2 lw a5,16(sp) + 31a: c7a2 sw s0,204(sp) + 31c: d902 sw zero,176(sp) + 31e: c3be sw a5,196(sp) + 320: 47d2 lw a5,20(sp) + 322: db02 sw zero,180(sp) + 324: dd02 sw zero,184(sp) + 326: c5be sw a5,200(sp) + 328: 67c1 lui a5,0x10 + 32a: df3e sw a5,188(sp) + 32c: 00000097 auipc ra,0x0 + 330: 000080e7 jalr ra # 32c <.L9+0x1c> + +00000334 <.LVL34>: + 334: 06055363 bgez a0,39a <.L8> + 338: 4682 lw a3,0(sp) + 33a: 57fd li a5,-1 + 33c: 00000737 lui a4,0x0 + 340: c1b6 sw a3,192(sp) + 342: 4692 lw a3,4(sp) + 344: d93e sw a5,176(sp) + 346: db3e sw a5,180(sp) + 348: c3b6 sw a3,196(sp) + 34a: dd3e sw a5,184(sp) + 34c: 46a2 lw a3,8(sp) + 34e: 00c72783 lw a5,12(a4) # c <__divtc3+0xc> + 352: 190c add a1,sp,176 + 354: 0188 add a0,sp,192 + 356: c5b6 sw a3,200(sp) + 358: c7a6 sw s1,204(sp) + 35a: df3e sw a5,188(sp) + 35c: 00000097 auipc ra,0x0 + 360: 000080e7 jalr ra # 35c <.LVL34+0x28> + +00000364 <.LVL35>: + 364: 02055b63 bgez a0,39a <.L8> + +00000368 <.L11>: + 368: 5692 lw a3,36(sp) + 36a: 57fd li a5,-1 + 36c: 00000737 lui a4,0x0 + 370: c1b6 sw a3,192(sp) + 372: 56a2 lw a3,40(sp) + 374: d93e sw a5,176(sp) + 376: db3e sw a5,180(sp) + 378: c3b6 sw a3,196(sp) + 37a: 56b2 lw a3,44(sp) + 37c: dd3e sw a5,184(sp) + 37e: 00c72783 lw a5,12(a4) # c <__divtc3+0xc> + 382: c5b6 sw a3,200(sp) + 384: 4696 lw a3,68(sp) + 386: 190c add a1,sp,176 + 388: 0188 add a0,sp,192 + 38a: c7b6 sw a3,204(sp) + 38c: df3e sw a5,188(sp) + 38e: 00000097 auipc ra,0x0 + 392: 000080e7 jalr ra # 38e <.L11+0x26> + +00000396 <.LVL36>: + 396: e2054de3 bltz a0,1d0 <.L78> + +0000039a <.L8>: + 39a: 47e2 lw a5,24(sp) + 39c: 1110 add a2,sp,160 + 39e: 190c add a1,sp,176 + 3a0: d93e sw a5,176(sp) + 3a2: 47f2 lw a5,28(sp) + 3a4: 0188 add a0,sp,192 + 3a6: db3e sw a5,180(sp) + 3a8: 5782 lw a5,32(sp) + 3aa: dd3e sw a5,184(sp) + 3ac: 57e2 lw a5,56(sp) + 3ae: df3e sw a5,188(sp) + 3b0: 5792 lw a5,36(sp) + 3b2: d13e sw a5,160(sp) + 3b4: 57a2 lw a5,40(sp) + 3b6: d33e sw a5,164(sp) + 3b8: 57b2 lw a5,44(sp) + 3ba: d53e sw a5,168(sp) + 3bc: 57f2 lw a5,60(sp) + 3be: d73e sw a5,172(sp) + 3c0: 00000097 auipc ra,0x0 + 3c4: 000080e7 jalr ra # 3c0 <.L8+0x26> + +000003c8 <.LVL38>: + 3c8: 47ae lw a5,200(sp) + 3ca: 448e lw s1,192(sp) + 3cc: 441e lw s0,196(sp) + 3ce: cabe sw a5,84(sp) + 3d0: 47be lw a5,204(sp) + 3d2: 1110 add a2,sp,160 + 3d4: 190c add a1,sp,176 + 3d6: ccbe sw a5,88(sp) + +000003d8 <.LVL39>: + 3d8: 47e2 lw a5,24(sp) + +000003da <.LVL40>: + 3da: 0188 add a0,sp,192 + 3dc: d126 sw s1,160(sp) + 3de: d93e sw a5,176(sp) + 3e0: 47f2 lw a5,28(sp) + 3e2: d322 sw s0,164(sp) + 3e4: db3e sw a5,180(sp) + 3e6: 5782 lw a5,32(sp) + 3e8: dd3e sw a5,184(sp) + 3ea: 57e2 lw a5,56(sp) + 3ec: df3e sw a5,188(sp) + 3ee: 47d6 lw a5,84(sp) + 3f0: d53e sw a5,168(sp) + 3f2: 47e6 lw a5,88(sp) + 3f4: d73e sw a5,172(sp) + 3f6: 00000097 auipc ra,0x0 + 3fa: 000080e7 jalr ra # 3f6 <.LVL40+0x1c> + +000003fe <.LVL41>: + 3fe: 47be lw a5,204(sp) + 400: 460e lw a2,192(sp) + 402: 469e lw a3,196(sp) + 404: d73e sw a5,172(sp) + 406: 5792 lw a5,36(sp) + 408: 472e lw a4,200(sp) + 40a: d132 sw a2,160(sp) + 40c: c93e sw a5,144(sp) + 40e: 57a2 lw a5,40(sp) + 410: 0910 add a2,sp,144 + 412: 110c add a1,sp,160 + 414: cb3e sw a5,148(sp) + 416: 57b2 lw a5,44(sp) + 418: 1908 add a0,sp,176 + 41a: d336 sw a3,164(sp) + 41c: cd3e sw a5,152(sp) + 41e: 57f2 lw a5,60(sp) + 420: d53a sw a4,168(sp) + 422: cf3e sw a5,156(sp) + 424: 00000097 auipc ra,0x0 + 428: 000080e7 jalr ra # 424 <.LVL41+0x26> + +0000042c <.LVL42>: + 42c: 57ca lw a5,176(sp) + 42e: 4756 lw a4,84(sp) + 430: 190c add a1,sp,176 + 432: cebe sw a5,92(sp) + 434: 57da lw a5,180(sp) + 436: 0188 add a0,sp,192 + 438: c1a6 sw s1,192(sp) + 43a: d0be sw a5,96(sp) + 43c: 57ea lw a5,184(sp) + 43e: c3a2 sw s0,196(sp) + 440: c5ba sw a4,200(sp) + 442: d2be sw a5,100(sp) + 444: 57fa lw a5,188(sp) + 446: d902 sw zero,176(sp) + 448: db02 sw zero,180(sp) + 44a: d4be sw a5,104(sp) + +0000044c <.LVL43>: + 44c: 47e6 lw a5,88(sp) + +0000044e <.LVL44>: + 44e: dd02 sw zero,184(sp) + +00000450 <.LVL45>: + 450: 0786 sll a5,a5,0x1 + 452: 8385 srl a5,a5,0x1 + 454: c7be sw a5,204(sp) + 456: 67c1 lui a5,0x10 + 458: df3e sw a5,188(sp) + +0000045a <.LVL46>: + 45a: 00000097 auipc ra,0x0 + 45e: 000080e7 jalr ra # 45a <.LVL46> + +00000462 <.LVL47>: + 462: 4782 lw a5,0(sp) + 464: d93e sw a5,176(sp) + 466: 4792 lw a5,4(sp) + 468: db3e sw a5,180(sp) + 46a: 47a2 lw a5,8(sp) + 46c: dd3e sw a5,184(sp) + 46e: 57d2 lw a5,52(sp) + 470: df3e sw a5,188(sp) + 472: 2ca05763 blez a0,740 <.L74> + 476: 47d6 lw a5,84(sp) + 478: 1110 add a2,sp,160 + 47a: 190c add a1,sp,176 + 47c: d53e sw a5,168(sp) + 47e: 47e6 lw a5,88(sp) + 480: 0188 add a0,sp,192 + 482: d126 sw s1,160(sp) + 484: d73e sw a5,172(sp) + 486: d322 sw s0,164(sp) + 488: 00000097 auipc ra,0x0 + 48c: 000080e7 jalr ra # 488 <.LVL47+0x26> + +00000490 <.LVL48>: + 490: 47be lw a5,204(sp) + 492: 460e lw a2,192(sp) + 494: 469e lw a3,196(sp) + 496: d73e sw a5,172(sp) + 498: 47b2 lw a5,12(sp) + 49a: 472e lw a4,200(sp) + 49c: d132 sw a2,160(sp) + 49e: c93e sw a5,144(sp) + 4a0: 47c2 lw a5,16(sp) + 4a2: 0910 add a2,sp,144 + 4a4: 110c add a1,sp,160 + 4a6: cb3e sw a5,148(sp) + 4a8: 47d2 lw a5,20(sp) + 4aa: 1908 add a0,sp,176 + 4ac: d336 sw a3,164(sp) + 4ae: cd3e sw a5,152(sp) + 4b0: 57c2 lw a5,48(sp) + 4b2: d53a sw a4,168(sp) + 4b4: cf3e sw a5,156(sp) + 4b6: 00000097 auipc ra,0x0 + 4ba: 000080e7 jalr ra # 4b6 <.LVL48+0x26> + +000004be <.LVL49>: + 4be: 57fa lw a5,188(sp) + 4c0: 564a lw a2,176(sp) + 4c2: 56da lw a3,180(sp) + 4c4: cf3e sw a5,156(sp) + 4c6: 47f6 lw a5,92(sp) + 4c8: 576a lw a4,184(sp) + 4ca: c932 sw a2,144(sp) + 4cc: c13e sw a5,128(sp) + 4ce: 5786 lw a5,96(sp) + 4d0: 0110 add a2,sp,128 + 4d2: 090c add a1,sp,144 + 4d4: c33e sw a5,132(sp) + 4d6: 5796 lw a5,100(sp) + 4d8: 1108 add a0,sp,160 + 4da: cb36 sw a3,148(sp) + 4dc: c53e sw a5,136(sp) + 4de: 57a6 lw a5,104(sp) + 4e0: cd3a sw a4,152(sp) + 4e2: c73e sw a5,140(sp) + 4e4: 00000097 auipc ra,0x0 + 4e8: 000080e7 jalr ra # 4e4 <.LVL49+0x26> + +000004ec <.LVL50>: + 4ec: 578a lw a5,160(sp) + 4ee: 1110 add a2,sp,160 + 4f0: 190c add a1,sp,176 + 4f2: c2be sw a5,68(sp) + 4f4: 579a lw a5,164(sp) + 4f6: 0188 add a0,sp,192 + 4f8: d126 sw s1,160(sp) + 4fa: c4be sw a5,72(sp) + 4fc: 57aa lw a5,168(sp) + 4fe: d322 sw s0,164(sp) + 500: c6be sw a5,76(sp) + 502: 57ba lw a5,172(sp) + 504: c8be sw a5,80(sp) + +00000506 <.LVL51>: + 506: 47b2 lw a5,12(sp) + +00000508 <.LVL52>: + 508: d93e sw a5,176(sp) + 50a: 47c2 lw a5,16(sp) + 50c: db3e sw a5,180(sp) + 50e: 47d2 lw a5,20(sp) + 510: dd3e sw a5,184(sp) + 512: 57c2 lw a5,48(sp) + 514: df3e sw a5,188(sp) + 516: 47d6 lw a5,84(sp) + 518: d53e sw a5,168(sp) + +0000051a <.LVL53>: + 51a: 47e6 lw a5,88(sp) + 51c: d73e sw a5,172(sp) + +0000051e <.LVL54>: + 51e: 00000097 auipc ra,0x0 + 522: 000080e7 jalr ra # 51e <.LVL54> + +00000526 <.LVL55>: + 526: 47be lw a5,204(sp) + 528: 460e lw a2,192(sp) + 52a: 469e lw a3,196(sp) + 52c: d73e sw a5,172(sp) + 52e: 4782 lw a5,0(sp) + 530: 472e lw a4,200(sp) + 532: d132 sw a2,160(sp) + 534: c93e sw a5,144(sp) + 536: 4792 lw a5,4(sp) + 538: d336 sw a3,164(sp) + 53a: d53a sw a4,168(sp) + 53c: cb3e sw a5,148(sp) + 53e: 47a2 lw a5,8(sp) + 540: cd3e sw a5,152(sp) + 542: 57d2 lw a5,52(sp) + +00000544 <.L84>: + 544: 0910 add a2,sp,144 + 546: 110c add a1,sp,160 + 548: 1908 add a0,sp,176 + 54a: cf3e sw a5,156(sp) + 54c: 00000097 auipc ra,0x0 + 550: 000080e7 jalr ra # 54c <.L84+0x8> + +00000554 <.LVL57>: + 554: 57fa lw a5,188(sp) + 556: 564a lw a2,176(sp) + 558: 56da lw a3,180(sp) + 55a: cf3e sw a5,156(sp) + 55c: 47f6 lw a5,92(sp) + 55e: 576a lw a4,184(sp) + 560: c932 sw a2,144(sp) + 562: c13e sw a5,128(sp) + 564: 5786 lw a5,96(sp) + 566: 0110 add a2,sp,128 + 568: 090c add a1,sp,144 + 56a: c33e sw a5,132(sp) + 56c: 5796 lw a5,100(sp) + 56e: 1108 add a0,sp,160 + 570: cb36 sw a3,148(sp) + 572: c53e sw a5,136(sp) + 574: 57a6 lw a5,104(sp) + 576: cd3a sw a4,152(sp) + 578: c73e sw a5,140(sp) + 57a: 00000097 auipc ra,0x0 + 57e: 000080e7 jalr ra # 57a <.LVL57+0x26> + +00000582 <.LVL58>: + 582: 578a lw a5,160(sp) + 584: cabe sw a5,84(sp) + 586: 579a lw a5,164(sp) + 588: ccbe sw a5,88(sp) + 58a: 57aa lw a5,168(sp) + 58c: cebe sw a5,92(sp) + 58e: 57ba lw a5,172(sp) + +00000590 <.L80>: + 590: d0be sw a5,96(sp) + +00000592 <.LVL59>: + 592: 4796 lw a5,68(sp) + +00000594 <.LVL60>: + 594: 190c add a1,sp,176 + 596: 0188 add a0,sp,192 + 598: c1be sw a5,192(sp) + 59a: 47a6 lw a5,72(sp) + 59c: c3be sw a5,196(sp) + 59e: 47b6 lw a5,76(sp) + 5a0: c5be sw a5,200(sp) + 5a2: 47c6 lw a5,80(sp) + 5a4: c7be sw a5,204(sp) + 5a6: 4796 lw a5,68(sp) + 5a8: d93e sw a5,176(sp) + 5aa: 47a6 lw a5,72(sp) + 5ac: db3e sw a5,180(sp) + 5ae: 47b6 lw a5,76(sp) + 5b0: dd3e sw a5,184(sp) + 5b2: 47c6 lw a5,80(sp) + 5b4: df3e sw a5,188(sp) + 5b6: 00000097 auipc ra,0x0 + 5ba: 000080e7 jalr ra # 5b6 <.LVL60+0x22> + +000005be <.LVL61>: + 5be: 14050963 beqz a0,710 <.L31> + 5c2: 47d6 lw a5,84(sp) + 5c4: 190c add a1,sp,176 + 5c6: 0188 add a0,sp,192 + 5c8: c1be sw a5,192(sp) + 5ca: 47e6 lw a5,88(sp) + 5cc: c3be sw a5,196(sp) + 5ce: 47f6 lw a5,92(sp) + 5d0: c5be sw a5,200(sp) + 5d2: 5786 lw a5,96(sp) + 5d4: c7be sw a5,204(sp) + 5d6: 47d6 lw a5,84(sp) + 5d8: d93e sw a5,176(sp) + 5da: 47e6 lw a5,88(sp) + 5dc: db3e sw a5,180(sp) + 5de: 47f6 lw a5,92(sp) + 5e0: dd3e sw a5,184(sp) + 5e2: 5786 lw a5,96(sp) + 5e4: df3e sw a5,188(sp) + 5e6: 00000097 auipc ra,0x0 + 5ea: 000080e7 jalr ra # 5e6 <.LVL61+0x28> + +000005ee <.LVL62>: + 5ee: 12050163 beqz a0,710 <.L31> + 5f2: 47e2 lw a5,24(sp) + 5f4: 190c add a1,sp,176 + 5f6: 0188 add a0,sp,192 + 5f8: c1be sw a5,192(sp) + 5fa: 47f2 lw a5,28(sp) + 5fc: d902 sw zero,176(sp) + 5fe: db02 sw zero,180(sp) + 600: c3be sw a5,196(sp) + 602: 5782 lw a5,32(sp) + 604: dd02 sw zero,184(sp) + 606: df02 sw zero,188(sp) + 608: c5be sw a5,200(sp) + 60a: 57e2 lw a5,56(sp) + 60c: c7be sw a5,204(sp) + 60e: 00000097 auipc ra,0x0 + 612: 000080e7 jalr ra # 60e <.LVL62+0x20> + +00000616 <.LVL63>: + 616: 080519e3 bnez a0,ea8 <.L34> + 61a: 5792 lw a5,36(sp) + 61c: 190c add a1,sp,176 + 61e: 0188 add a0,sp,192 + 620: c1be sw a5,192(sp) + 622: 57a2 lw a5,40(sp) + 624: c3be sw a5,196(sp) + 626: 57b2 lw a5,44(sp) + 628: c5be sw a5,200(sp) + 62a: 57f2 lw a5,60(sp) + 62c: c7be sw a5,204(sp) + 62e: 00000097 auipc ra,0x0 + 632: 000080e7 jalr ra # 62e <.LVL63+0x18> + +00000636 <.LVL64>: + 636: 060519e3 bnez a0,ea8 <.L34> + 63a: 4782 lw a5,0(sp) + 63c: 190c add a1,sp,176 + 63e: 0188 add a0,sp,192 + 640: c1be sw a5,192(sp) + 642: 4792 lw a5,4(sp) + 644: c3be sw a5,196(sp) + 646: 47a2 lw a5,8(sp) + 648: c5be sw a5,200(sp) + 64a: 57d2 lw a5,52(sp) + 64c: c7be sw a5,204(sp) + 64e: 4782 lw a5,0(sp) + 650: d93e sw a5,176(sp) + 652: 4792 lw a5,4(sp) + 654: db3e sw a5,180(sp) + 656: 47a2 lw a5,8(sp) + 658: dd3e sw a5,184(sp) + 65a: 57d2 lw a5,52(sp) + 65c: df3e sw a5,188(sp) + 65e: 00000097 auipc ra,0x0 + 662: 000080e7 jalr ra # 65e <.LVL64+0x28> + +00000666 <.LVL65>: + 666: c90d beqz a0,698 <.L37> + 668: 47b2 lw a5,12(sp) + 66a: 190c add a1,sp,176 + 66c: 0188 add a0,sp,192 + 66e: c1be sw a5,192(sp) + 670: 47c2 lw a5,16(sp) + 672: c3be sw a5,196(sp) + 674: 47d2 lw a5,20(sp) + 676: c5be sw a5,200(sp) + 678: 57c2 lw a5,48(sp) + 67a: c7be sw a5,204(sp) + 67c: 47b2 lw a5,12(sp) + 67e: d93e sw a5,176(sp) + 680: 47c2 lw a5,16(sp) + 682: db3e sw a5,180(sp) + 684: 47d2 lw a5,20(sp) + 686: dd3e sw a5,184(sp) + 688: 57c2 lw a5,48(sp) + 68a: df3e sw a5,188(sp) + 68c: 00000097 auipc ra,0x0 + 690: 000080e7 jalr ra # 68c <.LVL65+0x26> + +00000694 <.LVL66>: + 694: 00051ae3 bnez a0,ea8 <.L34> + +00000698 <.L37>: + 698: 57e2 lw a5,56(sp) + 69a: 7fff0437 lui s0,0x7fff0 + 69e: 0007d363 bgez a5,6a4 <.L39> + 6a2: 7441 lui s0,0xffff0 + +000006a4 <.L39>: + 6a4: 4782 lw a5,0(sp) + 6a6: 1110 add a2,sp,160 + 6a8: 190c add a1,sp,176 + 6aa: d13e sw a5,160(sp) + 6ac: 4792 lw a5,4(sp) + 6ae: 0188 add a0,sp,192 + 6b0: d902 sw zero,176(sp) + 6b2: d33e sw a5,164(sp) + 6b4: 47a2 lw a5,8(sp) + 6b6: db02 sw zero,180(sp) + 6b8: dd02 sw zero,184(sp) + 6ba: d53e sw a5,168(sp) + 6bc: 57d2 lw a5,52(sp) + 6be: df22 sw s0,188(sp) + 6c0: d73e sw a5,172(sp) + 6c2: 00000097 auipc ra,0x0 + 6c6: 000080e7 jalr ra # 6c2 <.L39+0x1e> + +000006ca <.LVL67>: + 6ca: 478e lw a5,192(sp) + 6cc: 1110 add a2,sp,160 + 6ce: 190c add a1,sp,176 + 6d0: c2be sw a5,68(sp) + +000006d2 <.LVL68>: + 6d2: 479e lw a5,196(sp) + 6d4: 0188 add a0,sp,192 + 6d6: d902 sw zero,176(sp) + 6d8: c4be sw a5,72(sp) + 6da: 47ae lw a5,200(sp) + 6dc: db02 sw zero,180(sp) + 6de: dd02 sw zero,184(sp) + 6e0: c6be sw a5,76(sp) + 6e2: 47be lw a5,204(sp) + 6e4: df22 sw s0,188(sp) + 6e6: c8be sw a5,80(sp) + +000006e8 <.LVL69>: + 6e8: 47b2 lw a5,12(sp) + +000006ea <.LVL70>: + 6ea: d13e sw a5,160(sp) + 6ec: 47c2 lw a5,16(sp) + 6ee: d33e sw a5,164(sp) + 6f0: 47d2 lw a5,20(sp) + 6f2: d53e sw a5,168(sp) + 6f4: 57c2 lw a5,48(sp) + 6f6: d73e sw a5,172(sp) + 6f8: 00000097 auipc ra,0x0 + 6fc: 000080e7 jalr ra # 6f8 <.LVL70+0xe> + +00000700 <.LVL71>: + 700: 478e lw a5,192(sp) + 702: cabe sw a5,84(sp) + +00000704 <.LVL72>: + 704: 479e lw a5,196(sp) + 706: ccbe sw a5,88(sp) + 708: 47ae lw a5,200(sp) + 70a: cebe sw a5,92(sp) + 70c: 47be lw a5,204(sp) + +0000070e <.L82>: + 70e: d0be sw a5,96(sp) + +00000710 <.L31>: + 710: 4786 lw a5,64(sp) + 712: 4716 lw a4,68(sp) + 714: 40ee lw ra,216(sp) + 716: 445e lw s0,212(sp) + 718: c398 sw a4,0(a5) + 71a: 4726 lw a4,72(sp) + 71c: 44ce lw s1,208(sp) + 71e: 853e mv a0,a5 + 720: c3d8 sw a4,4(a5) + 722: 4736 lw a4,76(sp) + 724: c798 sw a4,8(a5) + 726: 4746 lw a4,80(sp) + 728: c7d8 sw a4,12(a5) + 72a: 4756 lw a4,84(sp) + 72c: cb98 sw a4,16(a5) + 72e: 4766 lw a4,88(sp) + 730: cbd8 sw a4,20(a5) + 732: 4776 lw a4,92(sp) + 734: cf98 sw a4,24(a5) + 736: 5706 lw a4,96(sp) + 738: cfd8 sw a4,28(a5) + 73a: 0dc10113 add sp,sp,220 + +0000073e <.LVL75>: + 73e: 8082 ret + +00000740 <.L74>: + 740: 5792 lw a5,36(sp) + 742: 1110 add a2,sp,160 + 744: 190c add a1,sp,176 + 746: d13e sw a5,160(sp) + 748: 57a2 lw a5,40(sp) + 74a: 0188 add a0,sp,192 + 74c: d33e sw a5,164(sp) + 74e: 57b2 lw a5,44(sp) + 750: d53e sw a5,168(sp) + 752: 57f2 lw a5,60(sp) + 754: d73e sw a5,172(sp) + 756: 00000097 auipc ra,0x0 + 75a: 000080e7 jalr ra # 756 <.L74+0x16> + +0000075e <.LVL77>: + 75e: 47be lw a5,204(sp) + 760: 460e lw a2,192(sp) + 762: 469e lw a3,196(sp) + 764: d73e sw a5,172(sp) + 766: 47e2 lw a5,24(sp) + 768: 472e lw a4,200(sp) + 76a: d132 sw a2,160(sp) + 76c: c93e sw a5,144(sp) + 76e: 47f2 lw a5,28(sp) + 770: 0910 add a2,sp,144 + 772: 110c add a1,sp,160 + 774: cb3e sw a5,148(sp) + 776: 5782 lw a5,32(sp) + 778: 1908 add a0,sp,176 + 77a: d336 sw a3,164(sp) + 77c: cd3e sw a5,152(sp) + 77e: 57e2 lw a5,56(sp) + 780: d53a sw a4,168(sp) + 782: cf3e sw a5,156(sp) + 784: 00000097 auipc ra,0x0 + 788: 000080e7 jalr ra # 784 <.LVL77+0x26> + +0000078c <.LVL78>: + 78c: 57fa lw a5,188(sp) + 78e: 564a lw a2,176(sp) + 790: 56da lw a3,180(sp) + 792: cf3e sw a5,156(sp) + 794: 47b2 lw a5,12(sp) + 796: 576a lw a4,184(sp) + 798: c932 sw a2,144(sp) + 79a: c13e sw a5,128(sp) + 79c: 47c2 lw a5,16(sp) + 79e: 0110 add a2,sp,128 + 7a0: 090c add a1,sp,144 + 7a2: c33e sw a5,132(sp) + 7a4: 47d2 lw a5,20(sp) + 7a6: 1108 add a0,sp,160 + 7a8: cb36 sw a3,148(sp) + 7aa: c53e sw a5,136(sp) + 7ac: 57c2 lw a5,48(sp) + 7ae: cd3a sw a4,152(sp) + 7b0: c73e sw a5,140(sp) + 7b2: 00000097 auipc ra,0x0 + 7b6: 000080e7 jalr ra # 7b2 <.LVL78+0x26> + +000007ba <.LVL79>: + 7ba: 57ba lw a5,172(sp) + 7bc: 560a lw a2,160(sp) + 7be: 569a lw a3,164(sp) + 7c0: c73e sw a5,140(sp) + 7c2: 47f6 lw a5,92(sp) + 7c4: 572a lw a4,168(sp) + 7c6: c132 sw a2,128(sp) + 7c8: d8be sw a5,112(sp) + 7ca: 5786 lw a5,96(sp) + 7cc: 1890 add a2,sp,112 + 7ce: 010c add a1,sp,128 + 7d0: dabe sw a5,116(sp) + 7d2: 5796 lw a5,100(sp) + 7d4: 0908 add a0,sp,144 + 7d6: c336 sw a3,132(sp) + 7d8: dcbe sw a5,120(sp) + 7da: 57a6 lw a5,104(sp) + 7dc: c53a sw a4,136(sp) + 7de: debe sw a5,124(sp) + 7e0: 00000097 auipc ra,0x0 + 7e4: 000080e7 jalr ra # 7e0 <.LVL79+0x26> + +000007e8 <.LVL80>: + 7e8: 47ca lw a5,144(sp) + 7ea: 1110 add a2,sp,160 + 7ec: 190c add a1,sp,176 + 7ee: c2be sw a5,68(sp) + 7f0: 47da lw a5,148(sp) + 7f2: 0188 add a0,sp,192 + 7f4: c4be sw a5,72(sp) + 7f6: 47ea lw a5,152(sp) + 7f8: c6be sw a5,76(sp) + 7fa: 47fa lw a5,156(sp) + 7fc: c8be sw a5,80(sp) + +000007fe <.LVL81>: + 7fe: 47b2 lw a5,12(sp) + +00000800 <.LVL82>: + 800: d93e sw a5,176(sp) + 802: 47c2 lw a5,16(sp) + 804: db3e sw a5,180(sp) + 806: 47d2 lw a5,20(sp) + 808: dd3e sw a5,184(sp) + 80a: 57c2 lw a5,48(sp) + 80c: df3e sw a5,188(sp) + 80e: 5792 lw a5,36(sp) + 810: d13e sw a5,160(sp) + 812: 57a2 lw a5,40(sp) + 814: d33e sw a5,164(sp) + 816: 57b2 lw a5,44(sp) + 818: d53e sw a5,168(sp) + 81a: 57f2 lw a5,60(sp) + 81c: d73e sw a5,172(sp) + 81e: 00000097 auipc ra,0x0 + 822: 000080e7 jalr ra # 81e <.LVL82+0x1e> + +00000826 <.LVL83>: + 826: 47be lw a5,204(sp) + 828: 460e lw a2,192(sp) + 82a: 469e lw a3,196(sp) + 82c: d73e sw a5,172(sp) + 82e: 47e2 lw a5,24(sp) + 830: 472e lw a4,200(sp) + 832: d132 sw a2,160(sp) + 834: c93e sw a5,144(sp) + 836: 47f2 lw a5,28(sp) + 838: 0910 add a2,sp,144 + 83a: 110c add a1,sp,160 + 83c: cb3e sw a5,148(sp) + 83e: 5782 lw a5,32(sp) + 840: 1908 add a0,sp,176 + 842: d336 sw a3,164(sp) + 844: cd3e sw a5,152(sp) + 846: 57e2 lw a5,56(sp) + 848: d53a sw a4,168(sp) + 84a: cf3e sw a5,156(sp) + 84c: 00000097 auipc ra,0x0 + 850: 000080e7 jalr ra # 84c <.LVL83+0x26> + +00000854 <.LVL84>: + 854: 57fa lw a5,188(sp) + 856: 564a lw a2,176(sp) + 858: 56da lw a3,180(sp) + 85a: cf3e sw a5,156(sp) + 85c: 4782 lw a5,0(sp) + 85e: 576a lw a4,184(sp) + 860: c932 sw a2,144(sp) + 862: c13e sw a5,128(sp) + 864: 4792 lw a5,4(sp) + 866: cb36 sw a3,148(sp) + 868: cd3a sw a4,152(sp) + 86a: c33e sw a5,132(sp) + 86c: 47a2 lw a5,8(sp) + 86e: c53e sw a5,136(sp) + 870: 57d2 lw a5,52(sp) + +00000872 <.L81>: + 872: 0110 add a2,sp,128 + 874: 090c add a1,sp,144 + 876: 1108 add a0,sp,160 + 878: c73e sw a5,140(sp) + 87a: 00000097 auipc ra,0x0 + 87e: 000080e7 jalr ra # 87a <.L81+0x8> + +00000882 <.LVL86>: + 882: 57ba lw a5,172(sp) + 884: 560a lw a2,160(sp) + 886: 569a lw a3,164(sp) + 888: c73e sw a5,140(sp) + 88a: 47f6 lw a5,92(sp) + 88c: 572a lw a4,168(sp) + 88e: c132 sw a2,128(sp) + 890: d8be sw a5,112(sp) + 892: 5786 lw a5,96(sp) + 894: 1890 add a2,sp,112 + 896: 010c add a1,sp,128 + 898: dabe sw a5,116(sp) + 89a: 5796 lw a5,100(sp) + 89c: 0908 add a0,sp,144 + 89e: c336 sw a3,132(sp) + 8a0: dcbe sw a5,120(sp) + 8a2: 57a6 lw a5,104(sp) + 8a4: c53a sw a4,136(sp) + 8a6: debe sw a5,124(sp) + 8a8: 00000097 auipc ra,0x0 + 8ac: 000080e7 jalr ra # 8a8 <.LVL86+0x26> + +000008b0 <.LVL87>: + 8b0: 47ca lw a5,144(sp) + 8b2: cabe sw a5,84(sp) + 8b4: 47da lw a5,148(sp) + 8b6: ccbe sw a5,88(sp) + 8b8: 47ea lw a5,152(sp) + 8ba: cebe sw a5,92(sp) + 8bc: 47fa lw a5,156(sp) + 8be: b9c9 j 590 <.L80> + +000008c0 <.L72>: + 8c0: 46e2 lw a3,24(sp) + 8c2: 190c add a1,sp,176 + 8c4: 0188 add a0,sp,192 + 8c6: c1b6 sw a3,192(sp) + 8c8: 46f2 lw a3,28(sp) + 8ca: c7a6 sw s1,204(sp) + 8cc: d93e sw a5,176(sp) + 8ce: c3b6 sw a3,196(sp) + 8d0: 5682 lw a3,32(sp) + 8d2: db3e sw a5,180(sp) + 8d4: dd3e sw a5,184(sp) + 8d6: c5b6 sw a3,200(sp) + 8d8: df3a sw a4,188(sp) + 8da: 00000097 auipc ra,0x0 + 8de: 000080e7 jalr ra # 8da <.L72+0x1a> + +000008e2 <.LVL89>: + 8e2: 0e054063 bltz a0,9c2 <.L18> + 8e6: 4782 lw a5,0(sp) + 8e8: 3ffe0437 lui s0,0x3ffe0 + 8ec: 1110 add a2,sp,160 + 8ee: d93e sw a5,176(sp) + 8f0: 4792 lw a5,4(sp) + 8f2: 190c add a1,sp,176 + 8f4: 0188 add a0,sp,192 + 8f6: db3e sw a5,180(sp) + 8f8: 47a2 lw a5,8(sp) + 8fa: d102 sw zero,160(sp) + 8fc: d302 sw zero,164(sp) + 8fe: dd3e sw a5,184(sp) + 900: 57d2 lw a5,52(sp) + 902: d502 sw zero,168(sp) + 904: d722 sw s0,172(sp) + 906: df3e sw a5,188(sp) + 908: 00000097 auipc ra,0x0 + 90c: 000080e7 jalr ra # 908 <.LVL89+0x26> + +00000910 <.LVL90>: + 910: 478e lw a5,192(sp) + 912: 1110 add a2,sp,160 + 914: 190c add a1,sp,176 + 916: c03e sw a5,0(sp) + 918: 479e lw a5,196(sp) + 91a: 0188 add a0,sp,192 + 91c: d102 sw zero,160(sp) + 91e: c23e sw a5,4(sp) + 920: 47ae lw a5,200(sp) + 922: d302 sw zero,164(sp) + 924: d502 sw zero,168(sp) + 926: c43e sw a5,8(sp) + 928: 47be lw a5,204(sp) + 92a: d722 sw s0,172(sp) + 92c: da3e sw a5,52(sp) + +0000092e <.LVL91>: + 92e: 47b2 lw a5,12(sp) + +00000930 <.LVL92>: + 930: d93e sw a5,176(sp) + 932: 47c2 lw a5,16(sp) + 934: db3e sw a5,180(sp) + 936: 47d2 lw a5,20(sp) + 938: dd3e sw a5,184(sp) + 93a: 57c2 lw a5,48(sp) + 93c: df3e sw a5,188(sp) + 93e: 00000097 auipc ra,0x0 + 942: 000080e7 jalr ra # 93e <.LVL92+0xe> + +00000946 <.LVL93>: + 946: 478e lw a5,192(sp) + 948: 1110 add a2,sp,160 + 94a: 190c add a1,sp,176 + 94c: c63e sw a5,12(sp) + 94e: 479e lw a5,196(sp) + 950: 0188 add a0,sp,192 + 952: d102 sw zero,160(sp) + 954: c83e sw a5,16(sp) + 956: 47ae lw a5,200(sp) + 958: d302 sw zero,164(sp) + 95a: d502 sw zero,168(sp) + 95c: ca3e sw a5,20(sp) + 95e: 47be lw a5,204(sp) + 960: d722 sw s0,172(sp) + 962: d83e sw a5,48(sp) + +00000964 <.LVL94>: + 964: 47e2 lw a5,24(sp) + +00000966 <.LVL95>: + 966: d93e sw a5,176(sp) + 968: 47f2 lw a5,28(sp) + 96a: db3e sw a5,180(sp) + 96c: 5782 lw a5,32(sp) + 96e: dd3e sw a5,184(sp) + 970: 57e2 lw a5,56(sp) + 972: df3e sw a5,188(sp) + 974: 00000097 auipc ra,0x0 + 978: 000080e7 jalr ra # 974 <.LVL95+0xe> + +0000097c <.LVL96>: + 97c: 478e lw a5,192(sp) + 97e: 1110 add a2,sp,160 + 980: 190c add a1,sp,176 + 982: cc3e sw a5,24(sp) + 984: 479e lw a5,196(sp) + 986: 0188 add a0,sp,192 + 988: d102 sw zero,160(sp) + 98a: ce3e sw a5,28(sp) + 98c: 47ae lw a5,200(sp) + 98e: d302 sw zero,164(sp) + 990: d502 sw zero,168(sp) + 992: d03e sw a5,32(sp) + 994: 47be lw a5,204(sp) + 996: d722 sw s0,172(sp) + 998: dc3e sw a5,56(sp) + +0000099a <.LVL97>: + 99a: 5792 lw a5,36(sp) + +0000099c <.LVL98>: + 99c: d93e sw a5,176(sp) + 99e: 57a2 lw a5,40(sp) + 9a0: db3e sw a5,180(sp) + 9a2: 57b2 lw a5,44(sp) + 9a4: dd3e sw a5,184(sp) + 9a6: 57f2 lw a5,60(sp) + 9a8: df3e sw a5,188(sp) + 9aa: 00000097 auipc ra,0x0 + 9ae: 000080e7 jalr ra # 9aa <.LVL98+0xe> + +000009b2 <.LVL99>: + 9b2: 478e lw a5,192(sp) + 9b4: d23e sw a5,36(sp) + 9b6: 479e lw a5,196(sp) + 9b8: d43e sw a5,40(sp) + 9ba: 47ae lw a5,200(sp) + 9bc: d63e sw a5,44(sp) + 9be: 47be lw a5,204(sp) + 9c0: de3e sw a5,60(sp) + +000009c2 <.L18>: + 9c2: 57e2 lw a5,56(sp) + 9c4: 80000437 lui s0,0x80000 + 9c8: fff44413 not s0,s0 + 9cc: 8fe1 and a5,a5,s0 + 9ce: c2be sw a5,68(sp) + 9d0: 47e2 lw a5,24(sp) + 9d2: 190c add a1,sp,176 + 9d4: 0188 add a0,sp,192 + 9d6: c1be sw a5,192(sp) + 9d8: 47f2 lw a5,28(sp) + 9da: d902 sw zero,176(sp) + 9dc: db02 sw zero,180(sp) + 9de: c3be sw a5,196(sp) + 9e0: 5782 lw a5,32(sp) + 9e2: dd02 sw zero,184(sp) + 9e4: c5be sw a5,200(sp) + 9e6: 4796 lw a5,68(sp) + 9e8: c7be sw a5,204(sp) + 9ea: 3f8f07b7 lui a5,0x3f8f0 + 9ee: df3e sw a5,188(sp) + 9f0: 00000097 auipc ra,0x0 + 9f4: 000080e7 jalr ra # 9f0 <.L18+0x2e> + +000009f8 <.LVL101>: + 9f8: 0e055163 bgez a0,ada <.L75> + +000009fc <.L79>: + 9fc: 4782 lw a5,0(sp) + 9fe: 406f0437 lui s0,0x406f0 + a02: 1110 add a2,sp,160 + a04: d93e sw a5,176(sp) + a06: 4792 lw a5,4(sp) + a08: 190c add a1,sp,176 + a0a: 0188 add a0,sp,192 + a0c: db3e sw a5,180(sp) + a0e: 47a2 lw a5,8(sp) + a10: d102 sw zero,160(sp) + a12: d302 sw zero,164(sp) + a14: dd3e sw a5,184(sp) + a16: 57d2 lw a5,52(sp) + a18: d502 sw zero,168(sp) + a1a: d722 sw s0,172(sp) + a1c: df3e sw a5,188(sp) + a1e: 00000097 auipc ra,0x0 + a22: 000080e7 jalr ra # a1e <.L79+0x22> + +00000a26 <.LVL102>: + a26: 478e lw a5,192(sp) + a28: 1110 add a2,sp,160 + a2a: 190c add a1,sp,176 + a2c: c03e sw a5,0(sp) + +00000a2e <.LVL103>: + a2e: 479e lw a5,196(sp) + a30: 0188 add a0,sp,192 + a32: d102 sw zero,160(sp) + a34: c23e sw a5,4(sp) + a36: 47ae lw a5,200(sp) + a38: d302 sw zero,164(sp) + a3a: d502 sw zero,168(sp) + a3c: c43e sw a5,8(sp) + a3e: 47be lw a5,204(sp) + a40: d722 sw s0,172(sp) + a42: da3e sw a5,52(sp) + +00000a44 <.LVL104>: + a44: 47b2 lw a5,12(sp) + +00000a46 <.LVL105>: + a46: d93e sw a5,176(sp) + a48: 47c2 lw a5,16(sp) + a4a: db3e sw a5,180(sp) + a4c: 47d2 lw a5,20(sp) + a4e: dd3e sw a5,184(sp) + a50: 57c2 lw a5,48(sp) + a52: df3e sw a5,188(sp) + a54: 00000097 auipc ra,0x0 + a58: 000080e7 jalr ra # a54 <.LVL105+0xe> + +00000a5c <.LVL106>: + a5c: 478e lw a5,192(sp) + a5e: 1110 add a2,sp,160 + a60: 190c add a1,sp,176 + a62: c63e sw a5,12(sp) + +00000a64 <.LVL107>: + a64: 479e lw a5,196(sp) + a66: 0188 add a0,sp,192 + a68: d102 sw zero,160(sp) + a6a: c83e sw a5,16(sp) + a6c: 47ae lw a5,200(sp) + a6e: d302 sw zero,164(sp) + a70: d502 sw zero,168(sp) + a72: ca3e sw a5,20(sp) + a74: 47be lw a5,204(sp) + a76: d722 sw s0,172(sp) + a78: d83e sw a5,48(sp) + +00000a7a <.LVL108>: + a7a: 47e2 lw a5,24(sp) + +00000a7c <.LVL109>: + a7c: d93e sw a5,176(sp) + a7e: 47f2 lw a5,28(sp) + a80: db3e sw a5,180(sp) + a82: 5782 lw a5,32(sp) + a84: dd3e sw a5,184(sp) + a86: 57e2 lw a5,56(sp) + a88: df3e sw a5,188(sp) + a8a: 00000097 auipc ra,0x0 + a8e: 000080e7 jalr ra # a8a <.LVL109+0xe> + +00000a92 <.LVL110>: + a92: 478e lw a5,192(sp) + a94: 1110 add a2,sp,160 + a96: 190c add a1,sp,176 + a98: cc3e sw a5,24(sp) + +00000a9a <.LVL111>: + a9a: 479e lw a5,196(sp) + a9c: 0188 add a0,sp,192 + a9e: d102 sw zero,160(sp) + aa0: ce3e sw a5,28(sp) + aa2: 47ae lw a5,200(sp) + aa4: d302 sw zero,164(sp) + aa6: d502 sw zero,168(sp) + aa8: d03e sw a5,32(sp) + aaa: 47be lw a5,204(sp) + aac: d722 sw s0,172(sp) + aae: dc3e sw a5,56(sp) + +00000ab0 <.LVL112>: + ab0: 5792 lw a5,36(sp) + +00000ab2 <.LVL113>: + ab2: d93e sw a5,176(sp) + ab4: 57a2 lw a5,40(sp) + ab6: db3e sw a5,180(sp) + ab8: 57b2 lw a5,44(sp) + aba: dd3e sw a5,184(sp) + abc: 57f2 lw a5,60(sp) + abe: df3e sw a5,188(sp) + ac0: 00000097 auipc ra,0x0 + ac4: 000080e7 jalr ra # ac0 <.LVL113+0xe> + +00000ac8 <.LVL114>: + ac8: 478e lw a5,192(sp) + aca: d23e sw a5,36(sp) + +00000acc <.LVL115>: + acc: 479e lw a5,196(sp) + ace: d43e sw a5,40(sp) + ad0: 47ae lw a5,200(sp) + ad2: d63e sw a5,44(sp) + ad4: 47be lw a5,204(sp) + ad6: de3e sw a5,60(sp) + +00000ad8 <.LVL116>: + ad8: a0fd j bc6 <.L22> + +00000ada <.L75>: + ada: 57d2 lw a5,52(sp) + adc: 190c add a1,sp,176 + ade: 0188 add a0,sp,192 + ae0: 0087f4b3 and s1,a5,s0 + ae4: 57c2 lw a5,48(sp) + ae6: c7a6 sw s1,204(sp) + ae8: d902 sw zero,176(sp) + aea: 8c7d and s0,s0,a5 + aec: 4782 lw a5,0(sp) + aee: db02 sw zero,180(sp) + af0: dd02 sw zero,184(sp) + af2: c1be sw a5,192(sp) + af4: 4792 lw a5,4(sp) + af6: c3be sw a5,196(sp) + af8: 47a2 lw a5,8(sp) + afa: c5be sw a5,200(sp) + afc: 67c1 lui a5,0x10 + afe: df3e sw a5,188(sp) + b00: 00000097 auipc ra,0x0 + b04: 000080e7 jalr ra # b00 <.L75+0x26> + +00000b08 <.LVL118>: + b08: 02055a63 bgez a0,b3c <.L23> + b0c: 46b2 lw a3,12(sp) + b0e: 57fd li a5,-1 + b10: 00000737 lui a4,0x0 + b14: c1b6 sw a3,192(sp) + b16: 46c2 lw a3,16(sp) + b18: d93e sw a5,176(sp) + b1a: db3e sw a5,180(sp) + b1c: c3b6 sw a3,196(sp) + b1e: dd3e sw a5,184(sp) + b20: 46d2 lw a3,20(sp) + b22: 00c72783 lw a5,12(a4) # c <__divtc3+0xc> + b26: 190c add a1,sp,176 + b28: 0188 add a0,sp,192 + b2a: c5b6 sw a3,200(sp) + b2c: c7a2 sw s0,204(sp) + b2e: df3e sw a5,188(sp) + b30: 00000097 auipc ra,0x0 + b34: 000080e7 jalr ra # b30 <.LVL118+0x28> + +00000b38 <.LVL119>: + b38: 04054e63 bltz a0,b94 <.L25> + +00000b3c <.L23>: + b3c: 47b2 lw a5,12(sp) + b3e: 190c add a1,sp,176 + b40: 0188 add a0,sp,192 + b42: c1be sw a5,192(sp) + b44: 47c2 lw a5,16(sp) + b46: c7a2 sw s0,204(sp) + b48: d902 sw zero,176(sp) + b4a: c3be sw a5,196(sp) + b4c: 47d2 lw a5,20(sp) + b4e: db02 sw zero,180(sp) + b50: dd02 sw zero,184(sp) + b52: c5be sw a5,200(sp) + b54: 67c1 lui a5,0x10 + b56: df3e sw a5,188(sp) + b58: 00000097 auipc ra,0x0 + b5c: 000080e7 jalr ra # b58 <.L23+0x1c> + +00000b60 <.LVL120>: + b60: 06055363 bgez a0,bc6 <.L22> + b64: 4682 lw a3,0(sp) + b66: 57fd li a5,-1 + b68: 00000737 lui a4,0x0 + b6c: c1b6 sw a3,192(sp) + b6e: 4692 lw a3,4(sp) + b70: d93e sw a5,176(sp) + b72: db3e sw a5,180(sp) + b74: c3b6 sw a3,196(sp) + b76: dd3e sw a5,184(sp) + b78: 46a2 lw a3,8(sp) + b7a: 00c72783 lw a5,12(a4) # c <__divtc3+0xc> + b7e: 190c add a1,sp,176 + b80: 0188 add a0,sp,192 + b82: c5b6 sw a3,200(sp) + b84: c7a6 sw s1,204(sp) + b86: df3e sw a5,188(sp) + b88: 00000097 auipc ra,0x0 + b8c: 000080e7 jalr ra # b88 <.LVL120+0x28> + +00000b90 <.LVL121>: + b90: 02055b63 bgez a0,bc6 <.L22> + +00000b94 <.L25>: + b94: 46e2 lw a3,24(sp) + b96: 57fd li a5,-1 + b98: 00000737 lui a4,0x0 + b9c: c1b6 sw a3,192(sp) + b9e: 46f2 lw a3,28(sp) + ba0: d93e sw a5,176(sp) + ba2: db3e sw a5,180(sp) + ba4: c3b6 sw a3,196(sp) + ba6: 5682 lw a3,32(sp) + ba8: dd3e sw a5,184(sp) + baa: 00c72783 lw a5,12(a4) # c <__divtc3+0xc> + bae: c5b6 sw a3,200(sp) + bb0: 4696 lw a3,68(sp) + bb2: 190c add a1,sp,176 + bb4: 0188 add a0,sp,192 + bb6: c7b6 sw a3,204(sp) + bb8: df3e sw a5,188(sp) + bba: 00000097 auipc ra,0x0 + bbe: 000080e7 jalr ra # bba <.L25+0x26> + +00000bc2 <.LVL122>: + bc2: e2054de3 bltz a0,9fc <.L79> + +00000bc6 <.L22>: + bc6: 5792 lw a5,36(sp) + bc8: 1110 add a2,sp,160 + bca: 190c add a1,sp,176 + bcc: d93e sw a5,176(sp) + bce: 57a2 lw a5,40(sp) + bd0: 0188 add a0,sp,192 + bd2: db3e sw a5,180(sp) + bd4: 57b2 lw a5,44(sp) + bd6: dd3e sw a5,184(sp) + bd8: 57f2 lw a5,60(sp) + bda: df3e sw a5,188(sp) + bdc: 47e2 lw a5,24(sp) + bde: d13e sw a5,160(sp) + be0: 47f2 lw a5,28(sp) + be2: d33e sw a5,164(sp) + be4: 5782 lw a5,32(sp) + be6: d53e sw a5,168(sp) + be8: 57e2 lw a5,56(sp) + bea: d73e sw a5,172(sp) + bec: 00000097 auipc ra,0x0 + bf0: 000080e7 jalr ra # bec <.L22+0x26> + +00000bf4 <.LVL124>: + bf4: 47ae lw a5,200(sp) + bf6: 448e lw s1,192(sp) + bf8: 441e lw s0,196(sp) + bfa: cabe sw a5,84(sp) + bfc: 47be lw a5,204(sp) + bfe: 1110 add a2,sp,160 + c00: 190c add a1,sp,176 + c02: ccbe sw a5,88(sp) + +00000c04 <.LVL125>: + c04: 5792 lw a5,36(sp) + +00000c06 <.LVL126>: + c06: 0188 add a0,sp,192 + c08: d126 sw s1,160(sp) + c0a: d93e sw a5,176(sp) + c0c: 57a2 lw a5,40(sp) + c0e: d322 sw s0,164(sp) + c10: db3e sw a5,180(sp) + c12: 57b2 lw a5,44(sp) + c14: dd3e sw a5,184(sp) + c16: 57f2 lw a5,60(sp) + c18: df3e sw a5,188(sp) + c1a: 47d6 lw a5,84(sp) + c1c: d53e sw a5,168(sp) + c1e: 47e6 lw a5,88(sp) + c20: d73e sw a5,172(sp) + c22: 00000097 auipc ra,0x0 + c26: 000080e7 jalr ra # c22 <.LVL126+0x1c> + +00000c2a <.LVL127>: + c2a: 47be lw a5,204(sp) + c2c: 460e lw a2,192(sp) + c2e: 469e lw a3,196(sp) + c30: d73e sw a5,172(sp) + c32: 47e2 lw a5,24(sp) + c34: 472e lw a4,200(sp) + c36: d132 sw a2,160(sp) + c38: c93e sw a5,144(sp) + c3a: 47f2 lw a5,28(sp) + c3c: 0910 add a2,sp,144 + c3e: 110c add a1,sp,160 + c40: cb3e sw a5,148(sp) + c42: 5782 lw a5,32(sp) + c44: 1908 add a0,sp,176 + c46: d336 sw a3,164(sp) + c48: cd3e sw a5,152(sp) + c4a: 57e2 lw a5,56(sp) + c4c: d53a sw a4,168(sp) + c4e: cf3e sw a5,156(sp) + c50: 00000097 auipc ra,0x0 + c54: 000080e7 jalr ra # c50 <.LVL127+0x26> + +00000c58 <.LVL128>: + c58: 57ca lw a5,176(sp) + c5a: 4756 lw a4,84(sp) + c5c: 190c add a1,sp,176 + c5e: cebe sw a5,92(sp) + c60: 57da lw a5,180(sp) + c62: 0188 add a0,sp,192 + c64: c1a6 sw s1,192(sp) + c66: d0be sw a5,96(sp) + c68: 57ea lw a5,184(sp) + c6a: c3a2 sw s0,196(sp) + c6c: c5ba sw a4,200(sp) + c6e: d2be sw a5,100(sp) + c70: 57fa lw a5,188(sp) + c72: d902 sw zero,176(sp) + c74: db02 sw zero,180(sp) + c76: d4be sw a5,104(sp) + +00000c78 <.LVL129>: + c78: 47e6 lw a5,88(sp) + +00000c7a <.LVL130>: + c7a: dd02 sw zero,184(sp) + +00000c7c <.LVL131>: + c7c: 0786 sll a5,a5,0x1 + c7e: 8385 srl a5,a5,0x1 + c80: c7be sw a5,204(sp) + c82: 67c1 lui a5,0x10 + c84: df3e sw a5,188(sp) + +00000c86 <.LVL132>: + c86: 00000097 auipc ra,0x0 + c8a: 000080e7 jalr ra # c86 <.LVL132> + +00000c8e <.LVL133>: + c8e: 47b2 lw a5,12(sp) + c90: d93e sw a5,176(sp) + c92: 47c2 lw a5,16(sp) + c94: db3e sw a5,180(sp) + c96: 47d2 lw a5,20(sp) + c98: dd3e sw a5,184(sp) + c9a: 57c2 lw a5,48(sp) + c9c: df3e sw a5,188(sp) + c9e: 0ca05b63 blez a0,d74 <.L76> + ca2: 47d6 lw a5,84(sp) + ca4: 1110 add a2,sp,160 + ca6: 190c add a1,sp,176 + ca8: d53e sw a5,168(sp) + caa: 47e6 lw a5,88(sp) + cac: 0188 add a0,sp,192 + cae: d126 sw s1,160(sp) + cb0: d73e sw a5,172(sp) + cb2: d322 sw s0,164(sp) + cb4: 00000097 auipc ra,0x0 + cb8: 000080e7 jalr ra # cb4 <.LVL133+0x26> + +00000cbc <.LVL134>: + cbc: 47be lw a5,204(sp) + cbe: 460e lw a2,192(sp) + cc0: 469e lw a3,196(sp) + cc2: d73e sw a5,172(sp) + cc4: 4782 lw a5,0(sp) + cc6: 472e lw a4,200(sp) + cc8: d132 sw a2,160(sp) + cca: c93e sw a5,144(sp) + ccc: 4792 lw a5,4(sp) + cce: 0910 add a2,sp,144 + cd0: 110c add a1,sp,160 + cd2: cb3e sw a5,148(sp) + cd4: 47a2 lw a5,8(sp) + cd6: 1908 add a0,sp,176 + cd8: d336 sw a3,164(sp) + cda: cd3e sw a5,152(sp) + cdc: 57d2 lw a5,52(sp) + cde: d53a sw a4,168(sp) + ce0: cf3e sw a5,156(sp) + ce2: 00000097 auipc ra,0x0 + ce6: 000080e7 jalr ra # ce2 <.LVL134+0x26> + +00000cea <.LVL135>: + cea: 57fa lw a5,188(sp) + cec: 564a lw a2,176(sp) + cee: 56da lw a3,180(sp) + cf0: cf3e sw a5,156(sp) + cf2: 47f6 lw a5,92(sp) + cf4: 576a lw a4,184(sp) + cf6: c932 sw a2,144(sp) + cf8: c13e sw a5,128(sp) + cfa: 5786 lw a5,96(sp) + cfc: 0110 add a2,sp,128 + cfe: 090c add a1,sp,144 + d00: c33e sw a5,132(sp) + d02: 5796 lw a5,100(sp) + d04: 1108 add a0,sp,160 + d06: cb36 sw a3,148(sp) + d08: c53e sw a5,136(sp) + d0a: 57a6 lw a5,104(sp) + d0c: cd3a sw a4,152(sp) + d0e: c73e sw a5,140(sp) + d10: 00000097 auipc ra,0x0 + d14: 000080e7 jalr ra # d10 <.LVL135+0x26> + +00000d18 <.LVL136>: + d18: 578a lw a5,160(sp) + d1a: 1110 add a2,sp,160 + d1c: 190c add a1,sp,176 + d1e: c2be sw a5,68(sp) + d20: 579a lw a5,164(sp) + d22: 0188 add a0,sp,192 + d24: d126 sw s1,160(sp) + d26: c4be sw a5,72(sp) + d28: 57aa lw a5,168(sp) + d2a: d322 sw s0,164(sp) + d2c: c6be sw a5,76(sp) + d2e: 57ba lw a5,172(sp) + d30: c8be sw a5,80(sp) + +00000d32 <.LVL137>: + d32: 4782 lw a5,0(sp) + +00000d34 <.LVL138>: + d34: d93e sw a5,176(sp) + d36: 4792 lw a5,4(sp) + d38: db3e sw a5,180(sp) + d3a: 47a2 lw a5,8(sp) + d3c: dd3e sw a5,184(sp) + d3e: 57d2 lw a5,52(sp) + d40: df3e sw a5,188(sp) + d42: 47d6 lw a5,84(sp) + d44: d53e sw a5,168(sp) + +00000d46 <.LVL139>: + d46: 47e6 lw a5,88(sp) + d48: d73e sw a5,172(sp) + +00000d4a <.LVL140>: + d4a: 00000097 auipc ra,0x0 + d4e: 000080e7 jalr ra # d4a <.LVL140> + +00000d52 <.LVL141>: + d52: 45b2 lw a1,12(sp) + d54: 460e lw a2,192(sp) + d56: 469e lw a3,196(sp) + d58: d12e sw a1,160(sp) + d5a: 45c2 lw a1,16(sp) + d5c: 472e lw a4,200(sp) + d5e: 47be lw a5,204(sp) + d60: d32e sw a1,164(sp) + d62: 45d2 lw a1,20(sp) + d64: c932 sw a2,144(sp) + d66: cb36 sw a3,148(sp) + d68: d52e sw a1,168(sp) + d6a: 55c2 lw a1,48(sp) + d6c: cd3a sw a4,152(sp) + d6e: d72e sw a1,172(sp) + d70: fd4ff06f j 544 <.L84> + +00000d74 <.L76>: + d74: 47e2 lw a5,24(sp) + d76: 1110 add a2,sp,160 + d78: 190c add a1,sp,176 + d7a: d13e sw a5,160(sp) + d7c: 47f2 lw a5,28(sp) + d7e: 0188 add a0,sp,192 + d80: d33e sw a5,164(sp) + d82: 5782 lw a5,32(sp) + d84: d53e sw a5,168(sp) + d86: 57e2 lw a5,56(sp) + d88: d73e sw a5,172(sp) + d8a: 00000097 auipc ra,0x0 + d8e: 000080e7 jalr ra # d8a <.L76+0x16> + +00000d92 <.LVL143>: + d92: 47be lw a5,204(sp) + d94: 460e lw a2,192(sp) + d96: 469e lw a3,196(sp) + d98: d73e sw a5,172(sp) + d9a: 5792 lw a5,36(sp) + d9c: 472e lw a4,200(sp) + d9e: d132 sw a2,160(sp) + da0: c93e sw a5,144(sp) + da2: 57a2 lw a5,40(sp) + da4: 0910 add a2,sp,144 + da6: 110c add a1,sp,160 + da8: cb3e sw a5,148(sp) + daa: 57b2 lw a5,44(sp) + dac: 1908 add a0,sp,176 + dae: d336 sw a3,164(sp) + db0: cd3e sw a5,152(sp) + db2: 57f2 lw a5,60(sp) + db4: d53a sw a4,168(sp) + db6: cf3e sw a5,156(sp) + db8: 00000097 auipc ra,0x0 + dbc: 000080e7 jalr ra # db8 <.LVL143+0x26> + +00000dc0 <.LVL144>: + dc0: 57fa lw a5,188(sp) + dc2: 564a lw a2,176(sp) + dc4: 56da lw a3,180(sp) + dc6: cf3e sw a5,156(sp) + dc8: 4782 lw a5,0(sp) + dca: 576a lw a4,184(sp) + dcc: c932 sw a2,144(sp) + dce: c13e sw a5,128(sp) + dd0: 4792 lw a5,4(sp) + dd2: 0110 add a2,sp,128 + dd4: 090c add a1,sp,144 + dd6: c33e sw a5,132(sp) + dd8: 47a2 lw a5,8(sp) + dda: 1108 add a0,sp,160 + ddc: cb36 sw a3,148(sp) + dde: c53e sw a5,136(sp) + de0: 57d2 lw a5,52(sp) + de2: cd3a sw a4,152(sp) + de4: c73e sw a5,140(sp) + de6: 00000097 auipc ra,0x0 + dea: 000080e7 jalr ra # de6 <.LVL144+0x26> + +00000dee <.LVL145>: + dee: 57ba lw a5,172(sp) + df0: 560a lw a2,160(sp) + df2: 569a lw a3,164(sp) + df4: c73e sw a5,140(sp) + df6: 47f6 lw a5,92(sp) + df8: 572a lw a4,168(sp) + dfa: c132 sw a2,128(sp) + dfc: d8be sw a5,112(sp) + dfe: 5786 lw a5,96(sp) + e00: 1890 add a2,sp,112 + e02: 010c add a1,sp,128 + e04: dabe sw a5,116(sp) + e06: 5796 lw a5,100(sp) + e08: 0908 add a0,sp,144 + e0a: c336 sw a3,132(sp) + e0c: dcbe sw a5,120(sp) + e0e: 57a6 lw a5,104(sp) + e10: c53a sw a4,136(sp) + e12: debe sw a5,124(sp) + e14: 00000097 auipc ra,0x0 + e18: 000080e7 jalr ra # e14 <.LVL145+0x26> + +00000e1c <.LVL146>: + e1c: 47ca lw a5,144(sp) + e1e: 1110 add a2,sp,160 + e20: 190c add a1,sp,176 + e22: c2be sw a5,68(sp) + e24: 47da lw a5,148(sp) + e26: 0188 add a0,sp,192 + e28: c4be sw a5,72(sp) + e2a: 47ea lw a5,152(sp) + e2c: c6be sw a5,76(sp) + e2e: 47fa lw a5,156(sp) + e30: c8be sw a5,80(sp) + +00000e32 <.LVL147>: + e32: 4782 lw a5,0(sp) + +00000e34 <.LVL148>: + e34: d93e sw a5,176(sp) + e36: 4792 lw a5,4(sp) + e38: db3e sw a5,180(sp) + e3a: 47a2 lw a5,8(sp) + e3c: dd3e sw a5,184(sp) + e3e: 57d2 lw a5,52(sp) + e40: df3e sw a5,188(sp) + e42: 47e2 lw a5,24(sp) + e44: d13e sw a5,160(sp) + e46: 47f2 lw a5,28(sp) + e48: d33e sw a5,164(sp) + e4a: 5782 lw a5,32(sp) + e4c: d53e sw a5,168(sp) + e4e: 57e2 lw a5,56(sp) + e50: d73e sw a5,172(sp) + e52: 00000097 auipc ra,0x0 + e56: 000080e7 jalr ra # e52 <.LVL148+0x1e> + +00000e5a <.LVL149>: + e5a: 47be lw a5,204(sp) + e5c: 460e lw a2,192(sp) + e5e: 469e lw a3,196(sp) + e60: d73e sw a5,172(sp) + e62: 5792 lw a5,36(sp) + e64: 472e lw a4,200(sp) + e66: d132 sw a2,160(sp) + e68: c93e sw a5,144(sp) + e6a: 57a2 lw a5,40(sp) + e6c: 0910 add a2,sp,144 + e6e: 110c add a1,sp,160 + e70: cb3e sw a5,148(sp) + e72: 57b2 lw a5,44(sp) + e74: 1908 add a0,sp,176 + e76: d336 sw a3,164(sp) + e78: cd3e sw a5,152(sp) + e7a: 57f2 lw a5,60(sp) + e7c: d53a sw a4,168(sp) + e7e: cf3e sw a5,156(sp) + e80: 00000097 auipc ra,0x0 + e84: 000080e7 jalr ra # e80 <.LVL149+0x26> + +00000e88 <.LVL150>: + e88: 45b2 lw a1,12(sp) + e8a: 564a lw a2,176(sp) + e8c: 56da lw a3,180(sp) + e8e: c92e sw a1,144(sp) + e90: 45c2 lw a1,16(sp) + e92: 576a lw a4,184(sp) + e94: 57fa lw a5,188(sp) + e96: cb2e sw a1,148(sp) + e98: 45d2 lw a1,20(sp) + e9a: c132 sw a2,128(sp) + e9c: c336 sw a3,132(sp) + e9e: cd2e sw a1,152(sp) + ea0: 55c2 lw a1,48(sp) + ea2: c53a sw a4,136(sp) + ea4: cf2e sw a1,156(sp) + ea6: b2f1 j 872 <.L81> + +00000ea8 <.L34>: + ea8: 57d2 lw a5,52(sp) + eaa: 54fd li s1,-1 + eac: 190c add a1,sp,176 + eae: 0786 sll a5,a5,0x1 + eb0: 8385 srl a5,a5,0x1 + eb2: d2be sw a5,100(sp) + eb4: 000007b7 lui a5,0x0 + eb8: 00c7a403 lw s0,12(a5) # c <__divtc3+0xc> + ebc: 4782 lw a5,0(sp) + ebe: 0188 add a0,sp,192 + ec0: d926 sw s1,176(sp) + ec2: c1be sw a5,192(sp) + ec4: 4792 lw a5,4(sp) + ec6: db26 sw s1,180(sp) + ec8: dd26 sw s1,184(sp) + eca: c3be sw a5,196(sp) + ecc: 47a2 lw a5,8(sp) + ece: df22 sw s0,188(sp) + ed0: c5be sw a5,200(sp) + ed2: 5796 lw a5,100(sp) + ed4: c7be sw a5,204(sp) + ed6: 00000097 auipc ra,0x0 + eda: 000080e7 jalr ra # ed6 <.L34+0x2e> + +00000ede <.LVL152>: + ede: e909 bnez a0,ef0 <.L67> + ee0: 190c add a1,sp,176 + ee2: 0188 add a0,sp,192 + ee4: 00000097 auipc ra,0x0 + ee8: 000080e7 jalr ra # ee4 <.LVL152+0x6> + +00000eec <.LVL153>: + eec: 04a04863 bgtz a0,f3c <.L40> + +00000ef0 <.L67>: + ef0: 57c2 lw a5,48(sp) + ef2: 00000737 lui a4,0x0 + ef6: 54fd li s1,-1 + ef8: 0786 sll a5,a5,0x1 + efa: 0017d413 srl s0,a5,0x1 + efe: 00c72783 lw a5,12(a4) # c <__divtc3+0xc> + f02: 190c add a1,sp,176 + f04: 0188 add a0,sp,192 + f06: d4be sw a5,104(sp) + f08: 47b2 lw a5,12(sp) + f0a: c7a2 sw s0,204(sp) + f0c: d926 sw s1,176(sp) + f0e: c1be sw a5,192(sp) + f10: 47c2 lw a5,16(sp) + f12: db26 sw s1,180(sp) + f14: dd26 sw s1,184(sp) + f16: c3be sw a5,196(sp) + f18: 47d2 lw a5,20(sp) + f1a: c5be sw a5,200(sp) + f1c: 57a6 lw a5,104(sp) + f1e: df3e sw a5,188(sp) + f20: 00000097 auipc ra,0x0 + f24: 000080e7 jalr ra # f20 <.L67+0x30> + +00000f28 <.LVL154>: + f28: 30051763 bnez a0,1236 <.L42> + f2c: 190c add a1,sp,176 + f2e: 0188 add a0,sp,192 + f30: 00000097 auipc ra,0x0 + f34: 000080e7 jalr ra # f30 <.LVL154+0x8> + +00000f38 <.LVL155>: + f38: 2ea05f63 blez a0,1236 <.L42> + +00000f3c <.L40>: + f3c: 57e2 lw a5,56(sp) + f3e: 80000437 lui s0,0x80000 + f42: fff44413 not s0,s0 + f46: 000006b7 lui a3,0x0 + f4a: 0087f733 and a4,a5,s0 + f4e: 00c6a783 lw a5,12(a3) # c <__divtc3+0xc> + f52: 54fd li s1,-1 + f54: 190c add a1,sp,176 + f56: d4be sw a5,104(sp) + f58: 47e2 lw a5,24(sp) + f5a: 0188 add a0,sp,192 + f5c: c7ba sw a4,204(sp) + f5e: c1be sw a5,192(sp) + f60: 47f2 lw a5,28(sp) + f62: d6ba sw a4,108(sp) + f64: d926 sw s1,176(sp) + f66: c3be sw a5,196(sp) + f68: 5782 lw a5,32(sp) + f6a: db26 sw s1,180(sp) + f6c: dd26 sw s1,184(sp) + f6e: c5be sw a5,200(sp) + f70: 57a6 lw a5,104(sp) + f72: df3e sw a5,188(sp) + f74: 00000097 auipc ra,0x0 + f78: 000080e7 jalr ra # f74 <.L40+0x38> + +00000f7c <.LVL156>: + f7c: 2a051d63 bnez a0,1236 <.L42> + f80: 190c add a1,sp,176 + f82: 0188 add a0,sp,192 + f84: 00000097 auipc ra,0x0 + f88: 000080e7 jalr ra # f84 <.LVL156+0x8> + +00000f8c <.LVL157>: + f8c: 2aa04563 bgtz a0,1236 <.L42> + f90: 57f2 lw a5,60(sp) + f92: 190c add a1,sp,176 + f94: 0188 add a0,sp,192 + f96: 8c7d and s0,s0,a5 + f98: 5792 lw a5,36(sp) + f9a: c7a2 sw s0,204(sp) + f9c: c1be sw a5,192(sp) + f9e: 57a2 lw a5,40(sp) + fa0: c3be sw a5,196(sp) + fa2: 57b2 lw a5,44(sp) + fa4: c5be sw a5,200(sp) + fa6: 00000097 auipc ra,0x0 + faa: 000080e7 jalr ra # fa6 <.LVL157+0x1a> + +00000fae <.LVL158>: + fae: 28051463 bnez a0,1236 <.L42> + fb2: 190c add a1,sp,176 + fb4: 0188 add a0,sp,192 + fb6: 00000097 auipc ra,0x0 + fba: 000080e7 jalr ra # fb6 <.LVL158+0x8> + +00000fbe <.LVL159>: + fbe: 26a04c63 bgtz a0,1236 <.L42> + fc2: 4782 lw a5,0(sp) + fc4: 190c add a1,sp,176 + fc6: 0188 add a0,sp,192 + fc8: c1be sw a5,192(sp) + fca: 4792 lw a5,4(sp) + fcc: 4405 li s0,1 + fce: c3be sw a5,196(sp) + fd0: 47a2 lw a5,8(sp) + fd2: c5be sw a5,200(sp) + fd4: 5796 lw a5,100(sp) + fd6: c7be sw a5,204(sp) + fd8: 00000097 auipc ra,0x0 + fdc: 000080e7 jalr ra # fd8 <.LVL159+0x1a> + +00000fe0 <.LVL160>: + fe0: e911 bnez a0,ff4 <.L43> + fe2: 190c add a1,sp,176 + fe4: 0188 add a0,sp,192 + fe6: 00000097 auipc ra,0x0 + fea: 000080e7 jalr ra # fe6 <.LVL160+0x6> + +00000fee <.LVL161>: + fee: 00a05363 blez a0,ff4 <.L43> + ff2: 4401 li s0,0 + +00000ff4 <.L43>: + ff4: 00144593 xor a1,s0,1 + ff8: 8985 and a1,a1,1 + ffa: 0188 add a0,sp,192 + ffc: 00000097 auipc ra,0x0 + 1000: 000080e7 jalr ra # ffc <.L43+0x8> + +00001004 <.LVL162>: + 1004: 478e lw a5,192(sp) + 1006: 46be lw a3,204(sp) + 1008: 5652 lw a2,52(sp) + 100a: cabe sw a5,84(sp) + +0000100c <.LVL163>: + 100c: 479e lw a5,196(sp) + 100e: 54fd li s1,-1 + 1010: 190c add a1,sp,176 + 1012: ccbe sw a5,88(sp) + 1014: 47ae lw a5,200(sp) + 1016: 0188 add a0,sp,192 + 1018: 4405 li s0,1 + 101a: cebe sw a5,92(sp) + 101c: 800007b7 lui a5,0x80000 + 1020: fff7c713 not a4,a5 + 1024: 8ef9 and a3,a3,a4 + 1026: 8ff1 and a5,a5,a2 + 1028: 8fd5 or a5,a5,a3 + 102a: c43e sw a5,8(sp) + +0000102c <.LVL164>: + 102c: 57c2 lw a5,48(sp) + +0000102e <.LVL165>: + 102e: 000006b7 lui a3,0x0 + 1032: d926 sw s1,176(sp) + 1034: 8f7d and a4,a4,a5 + 1036: 00c6a783 lw a5,12(a3) # c <__divtc3+0xc> + 103a: c7ba sw a4,204(sp) + 103c: c23a sw a4,4(sp) + 103e: c03e sw a5,0(sp) + 1040: 47b2 lw a5,12(sp) + 1042: db26 sw s1,180(sp) + 1044: dd26 sw s1,184(sp) + 1046: c1be sw a5,192(sp) + +00001048 <.LVL166>: + 1048: 47c2 lw a5,16(sp) + 104a: c3be sw a5,196(sp) + +0000104c <.LVL167>: + 104c: 47d2 lw a5,20(sp) + 104e: c5be sw a5,200(sp) + +00001050 <.LVL168>: + 1050: 4782 lw a5,0(sp) + 1052: df3e sw a5,188(sp) + 1054: 00000097 auipc ra,0x0 + 1058: 000080e7 jalr ra # 1054 <.LVL168+0x4> + +0000105c <.LVL169>: + 105c: e911 bnez a0,1070 <.L44> + 105e: 190c add a1,sp,176 + 1060: 0188 add a0,sp,192 + 1062: 00000097 auipc ra,0x0 + 1066: 000080e7 jalr ra # 1062 <.LVL169+0x6> + +0000106a <.LVL170>: + 106a: 00a05363 blez a0,1070 <.L44> + 106e: 4401 li s0,0 + +00001070 <.L44>: + 1070: 00144593 xor a1,s0,1 + 1074: 8985 and a1,a1,1 + 1076: 0188 add a0,sp,192 + 1078: 00000097 auipc ra,0x0 + 107c: 000080e7 jalr ra # 1078 <.L44+0x8> + +00001080 <.LVL171>: + 1080: 479e lw a5,196(sp) + 1082: 443e lw s0,204(sp) + 1084: 1110 add a2,sp,160 + 1086: c03e sw a5,0(sp) + 1088: 47ae lw a5,200(sp) + 108a: 190c add a1,sp,176 + 108c: 0188 add a0,sp,192 + 108e: c23e sw a5,4(sp) + 1090: 800007b7 lui a5,0x80000 + 1094: fff7c713 not a4,a5 + 1098: 8c79 and s0,s0,a4 + 109a: 5742 lw a4,48(sp) + 109c: 448e lw s1,192(sp) + 109e: 8ff9 and a5,a5,a4 + 10a0: 8c5d or s0,s0,a5 + +000010a2 <.LVL172>: + 10a2: 47e2 lw a5,24(sp) + 10a4: d93e sw a5,176(sp) + 10a6: 47f2 lw a5,28(sp) + 10a8: db3e sw a5,180(sp) + 10aa: 5782 lw a5,32(sp) + 10ac: dd3e sw a5,184(sp) + 10ae: 57e2 lw a5,56(sp) + 10b0: df3e sw a5,188(sp) + 10b2: 47d6 lw a5,84(sp) + 10b4: d13e sw a5,160(sp) + 10b6: 47e6 lw a5,88(sp) + 10b8: d33e sw a5,164(sp) + 10ba: 47f6 lw a5,92(sp) + 10bc: d53e sw a5,168(sp) + 10be: 47a2 lw a5,8(sp) + 10c0: d73e sw a5,172(sp) + 10c2: 00000097 auipc ra,0x0 + 10c6: 000080e7 jalr ra # 10c2 <.LVL172+0x20> + +000010ca <.LVL173>: + 10ca: 5792 lw a5,36(sp) + 10cc: 438e lw t2,192(sp) + 10ce: 429e lw t0,196(sp) + 10d0: d13e sw a5,160(sp) + 10d2: 57a2 lw a5,40(sp) + 10d4: 432e lw t1,200(sp) + 10d6: 46be lw a3,204(sp) + 10d8: d33e sw a5,164(sp) + 10da: 57b2 lw a5,44(sp) + 10dc: 0910 add a2,sp,144 + 10de: 110c add a1,sp,160 + 10e0: d53e sw a5,168(sp) + 10e2: 57f2 lw a5,60(sp) + 10e4: 1908 add a0,sp,176 + 10e6: d81e sw t2,48(sp) + 10e8: d73e sw a5,172(sp) + 10ea: 4782 lw a5,0(sp) + 10ec: ca16 sw t0,20(sp) + 10ee: c81a sw t1,16(sp) + 10f0: cb3e sw a5,148(sp) + 10f2: 4792 lw a5,4(sp) + 10f4: c636 sw a3,12(sp) + 10f6: c926 sw s1,144(sp) + 10f8: cd3e sw a5,152(sp) + 10fa: cf22 sw s0,156(sp) + 10fc: 00000097 auipc ra,0x0 + 1100: 000080e7 jalr ra # 10fc <.LVL173+0x32> + +00001104 <.LVL174>: + 1104: 55ca lw a1,176(sp) + 1106: 565a lw a2,180(sp) + 1108: 53c2 lw t2,48(sp) + 110a: 42d2 lw t0,20(sp) + 110c: 4342 lw t1,16(sp) + 110e: 576a lw a4,184(sp) + 1110: 57fa lw a5,188(sp) + 1112: 46b2 lw a3,12(sp) + 1114: c12e sw a1,128(sp) + 1116: c332 sw a2,132(sp) + 1118: 090c add a1,sp,144 + 111a: 0110 add a2,sp,128 + 111c: 1108 add a0,sp,160 + 111e: c91e sw t2,144(sp) + 1120: cb16 sw t0,148(sp) + 1122: cd1a sw t1,152(sp) + 1124: cf36 sw a3,156(sp) + 1126: c53a sw a4,136(sp) + 1128: c73e sw a5,140(sp) + 112a: 00000097 auipc ra,0x0 + 112e: 000080e7 jalr ra # 112a <.LVL174+0x26> + +00001132 <.LVL175>: + 1132: 558a lw a1,160(sp) + 1134: 561a lw a2,164(sp) + 1136: 573a lw a4,172(sp) + 1138: 56aa lw a3,168(sp) + 113a: 7fff07b7 lui a5,0x7fff0 + 113e: c12e sw a1,128(sp) + 1140: c332 sw a2,132(sp) + 1142: 010c add a1,sp,128 + 1144: 1890 add a2,sp,112 + 1146: 0908 add a0,sp,144 + 1148: c73a sw a4,140(sp) + 114a: c536 sw a3,136(sp) + 114c: debe sw a5,124(sp) + 114e: d882 sw zero,112(sp) + 1150: da82 sw zero,116(sp) + 1152: dc82 sw zero,120(sp) + 1154: 00000097 auipc ra,0x0 + 1158: 000080e7 jalr ra # 1154 <.LVL175+0x22> + +0000115c <.LVL176>: + 115c: 47ca lw a5,144(sp) + 115e: 1110 add a2,sp,160 + 1160: 190c add a1,sp,176 + 1162: c2be sw a5,68(sp) + +00001164 <.LVL177>: + 1164: 47da lw a5,148(sp) + 1166: 0188 add a0,sp,192 + 1168: d126 sw s1,160(sp) + 116a: c4be sw a5,72(sp) + 116c: 47ea lw a5,152(sp) + 116e: d722 sw s0,172(sp) + 1170: c6be sw a5,76(sp) + 1172: 47fa lw a5,156(sp) + 1174: c8be sw a5,80(sp) + +00001176 <.LVL178>: + 1176: 47e2 lw a5,24(sp) + +00001178 <.LVL179>: + 1178: d93e sw a5,176(sp) + 117a: 47f2 lw a5,28(sp) + 117c: db3e sw a5,180(sp) + 117e: 5782 lw a5,32(sp) + 1180: dd3e sw a5,184(sp) + 1182: 57e2 lw a5,56(sp) + 1184: df3e sw a5,188(sp) + 1186: 4782 lw a5,0(sp) + 1188: d33e sw a5,164(sp) + 118a: 4792 lw a5,4(sp) + 118c: d53e sw a5,168(sp) + 118e: 00000097 auipc ra,0x0 + 1192: 000080e7 jalr ra # 118e <.LVL179+0x16> + +00001196 <.LVL180>: + 1196: 5792 lw a5,36(sp) + 1198: 430e lw t1,192(sp) + 119a: 469e lw a3,196(sp) + 119c: d13e sw a5,160(sp) + 119e: 57a2 lw a5,40(sp) + 11a0: 0910 add a2,sp,144 + 11a2: 110c add a1,sp,160 + 11a4: d33e sw a5,164(sp) + 11a6: 57b2 lw a5,44(sp) + 11a8: 1908 add a0,sp,176 + 11aa: 44ae lw s1,200(sp) + +000011ac <.LVL181>: + 11ac: d53e sw a5,168(sp) + 11ae: 57f2 lw a5,60(sp) + 11b0: 443e lw s0,204(sp) + 11b2: c21a sw t1,4(sp) + 11b4: d73e sw a5,172(sp) + 11b6: 47d6 lw a5,84(sp) + 11b8: c036 sw a3,0(sp) + 11ba: c93e sw a5,144(sp) + 11bc: 47e6 lw a5,88(sp) + 11be: cb3e sw a5,148(sp) + 11c0: 47f6 lw a5,92(sp) + 11c2: cd3e sw a5,152(sp) + 11c4: 47a2 lw a5,8(sp) + 11c6: cf3e sw a5,156(sp) + 11c8: 00000097 auipc ra,0x0 + 11cc: 000080e7 jalr ra # 11c8 <.LVL181+0x1c> + +000011d0 <.LVL182>: + 11d0: 554a lw a0,176(sp) + 11d2: 55da lw a1,180(sp) + 11d4: 566a lw a2,184(sp) + 11d6: 577a lw a4,188(sp) + 11d8: 4682 lw a3,0(sp) + 11da: 4312 lw t1,4(sp) + 11dc: c12a sw a0,128(sp) + 11de: c32e sw a1,132(sp) + 11e0: c532 sw a2,136(sp) + 11e2: 090c add a1,sp,144 + 11e4: 0110 add a2,sp,128 + 11e6: 1108 add a0,sp,160 + 11e8: cb36 sw a3,148(sp) + 11ea: c73a sw a4,140(sp) + 11ec: c91a sw t1,144(sp) + 11ee: cd26 sw s1,152(sp) + 11f0: cf22 sw s0,156(sp) + 11f2: 00000097 auipc ra,0x0 + 11f6: 000080e7 jalr ra # 11f2 <.LVL182+0x22> + +000011fa <.LVL183>: + 11fa: 558a lw a1,160(sp) + 11fc: 561a lw a2,164(sp) + 11fe: 56aa lw a3,168(sp) + 1200: 573a lw a4,172(sp) + 1202: 7fff07b7 lui a5,0x7fff0 + 1206: c12e sw a1,128(sp) + 1208: c332 sw a2,132(sp) + 120a: c536 sw a3,136(sp) + 120c: c73a sw a4,140(sp) + 120e: d882 sw zero,112(sp) + 1210: da82 sw zero,116(sp) + 1212: dc82 sw zero,120(sp) + 1214: debe sw a5,124(sp) + +00001216 <.L83>: + 1216: 1890 add a2,sp,112 + 1218: 010c add a1,sp,128 + 121a: 0908 add a0,sp,144 + 121c: 00000097 auipc ra,0x0 + 1220: 000080e7 jalr ra # 121c <.L83+0x6> + +00001224 <.LVL185>: + 1224: 47ca lw a5,144(sp) + 1226: cabe sw a5,84(sp) + 1228: 47da lw a5,148(sp) + 122a: ccbe sw a5,88(sp) + 122c: 47ea lw a5,152(sp) + 122e: cebe sw a5,92(sp) + 1230: 47fa lw a5,156(sp) + 1232: cdcff06f j 70e <.L82> + +00001236 <.L42>: + 1236: 57e2 lw a5,56(sp) + 1238: 54fd li s1,-1 + 123a: 190c add a1,sp,176 + 123c: 0786 sll a5,a5,0x1 + 123e: 8385 srl a5,a5,0x1 + 1240: d6be sw a5,108(sp) + 1242: 000007b7 lui a5,0x0 + 1246: 00c7a403 lw s0,12(a5) # c <__divtc3+0xc> + 124a: 47e2 lw a5,24(sp) + 124c: 0188 add a0,sp,192 + 124e: d926 sw s1,176(sp) + 1250: c1be sw a5,192(sp) + 1252: 47f2 lw a5,28(sp) + 1254: db26 sw s1,180(sp) + 1256: dd26 sw s1,184(sp) + 1258: c3be sw a5,196(sp) + 125a: 5782 lw a5,32(sp) + 125c: df22 sw s0,188(sp) + 125e: c5be sw a5,200(sp) + 1260: 57b6 lw a5,108(sp) + 1262: c7be sw a5,204(sp) + 1264: 00000097 auipc ra,0x0 + 1268: 000080e7 jalr ra # 1264 <.L42+0x2e> + +0000126c <.LVL187>: + 126c: e909 bnez a0,127e <.L68> + 126e: 190c add a1,sp,176 + 1270: 0188 add a0,sp,192 + 1272: 00000097 auipc ra,0x0 + 1276: 000080e7 jalr ra # 1272 <.LVL187+0x6> + +0000127a <.LVL188>: + 127a: 04a04863 bgtz a0,12ca <.L45> + +0000127e <.L68>: + 127e: 57f2 lw a5,60(sp) + 1280: 00000737 lui a4,0x0 + 1284: 54fd li s1,-1 + 1286: 0786 sll a5,a5,0x1 + 1288: 0017d413 srl s0,a5,0x1 + 128c: 00c72783 lw a5,12(a4) # c <__divtc3+0xc> + 1290: 190c add a1,sp,176 + 1292: 0188 add a0,sp,192 + 1294: d4be sw a5,104(sp) + 1296: 5792 lw a5,36(sp) + 1298: c7a2 sw s0,204(sp) + 129a: d926 sw s1,176(sp) + 129c: c1be sw a5,192(sp) + 129e: 57a2 lw a5,40(sp) + 12a0: db26 sw s1,180(sp) + 12a2: dd26 sw s1,184(sp) + 12a4: c3be sw a5,196(sp) + 12a6: 57b2 lw a5,44(sp) + 12a8: c5be sw a5,200(sp) + 12aa: 57a6 lw a5,104(sp) + 12ac: df3e sw a5,188(sp) + 12ae: 00000097 auipc ra,0x0 + 12b2: 000080e7 jalr ra # 12ae <.L68+0x30> + +000012b6 <.LVL189>: + 12b6: c4051d63 bnez a0,710 <.L31> + 12ba: 190c add a1,sp,176 + 12bc: 0188 add a0,sp,192 + 12be: 00000097 auipc ra,0x0 + 12c2: 000080e7 jalr ra # 12be <.LVL189+0x8> + +000012c6 <.LVL190>: + 12c6: c4a05563 blez a0,710 <.L31> + +000012ca <.L45>: + 12ca: 00000737 lui a4,0x0 + 12ce: 00c72783 lw a5,12(a4) # c <__divtc3+0xc> + 12d2: 547d li s0,-1 + 12d4: 190c add a1,sp,176 + 12d6: d4be sw a5,104(sp) + 12d8: 4782 lw a5,0(sp) + 12da: 0188 add a0,sp,192 + 12dc: d922 sw s0,176(sp) + 12de: c1be sw a5,192(sp) + 12e0: 4792 lw a5,4(sp) + 12e2: db22 sw s0,180(sp) + 12e4: dd22 sw s0,184(sp) + 12e6: c3be sw a5,196(sp) + 12e8: 47a2 lw a5,8(sp) + 12ea: c5be sw a5,200(sp) + 12ec: 5796 lw a5,100(sp) + 12ee: c7be sw a5,204(sp) + 12f0: 57a6 lw a5,104(sp) + 12f2: df3e sw a5,188(sp) + 12f4: 00000097 auipc ra,0x0 + 12f8: 000080e7 jalr ra # 12f4 <.L45+0x2a> + +000012fc <.LVL191>: + 12fc: c0051a63 bnez a0,710 <.L31> + 1300: 190c add a1,sp,176 + 1302: 0188 add a0,sp,192 + 1304: 00000097 auipc ra,0x0 + 1308: 000080e7 jalr ra # 1304 <.LVL191+0x8> + +0000130c <.LVL192>: + 130c: c0a04263 bgtz a0,710 <.L31> + 1310: 57c2 lw a5,48(sp) + 1312: 190c add a1,sp,176 + 1314: 0188 add a0,sp,192 + 1316: 00179493 sll s1,a5,0x1 + 131a: 47b2 lw a5,12(sp) + 131c: 8085 srl s1,s1,0x1 + 131e: c7a6 sw s1,204(sp) + 1320: c1be sw a5,192(sp) + 1322: 47c2 lw a5,16(sp) + 1324: c3be sw a5,196(sp) + 1326: 47d2 lw a5,20(sp) + 1328: c5be sw a5,200(sp) + 132a: 00000097 auipc ra,0x0 + 132e: 000080e7 jalr ra # 132a <.LVL192+0x1e> + +00001332 <.LVL193>: + 1332: bc051f63 bnez a0,710 <.L31> + 1336: 190c add a1,sp,176 + 1338: 0188 add a0,sp,192 + 133a: 00000097 auipc ra,0x0 + 133e: 000080e7 jalr ra # 133a <.LVL193+0x8> + +00001342 <.LVL194>: + 1342: bca04763 bgtz a0,710 <.L31> + 1346: 47e2 lw a5,24(sp) + 1348: 190c add a1,sp,176 + 134a: 0188 add a0,sp,192 + 134c: c1be sw a5,192(sp) + 134e: 47f2 lw a5,28(sp) + 1350: 4485 li s1,1 + 1352: c3be sw a5,196(sp) + 1354: 5782 lw a5,32(sp) + 1356: c5be sw a5,200(sp) + 1358: 57b6 lw a5,108(sp) + 135a: c7be sw a5,204(sp) + 135c: 00000097 auipc ra,0x0 + 1360: 000080e7 jalr ra # 135c <.LVL194+0x1a> + +00001364 <.LVL195>: + 1364: e911 bnez a0,1378 <.L47> + 1366: 190c add a1,sp,176 + 1368: 0188 add a0,sp,192 + 136a: 00000097 auipc ra,0x0 + 136e: 000080e7 jalr ra # 136a <.LVL195+0x6> + +00001372 <.LVL196>: + 1372: 00a05363 blez a0,1378 <.L47> + 1376: 4481 li s1,0 + +00001378 <.L47>: + 1378: 0014c593 xor a1,s1,1 + 137c: 8985 and a1,a1,1 + 137e: 0188 add a0,sp,192 + 1380: 00000097 auipc ra,0x0 + 1384: 000080e7 jalr ra # 1380 <.L47+0x8> + +00001388 <.LVL197>: + 1388: 478e lw a5,192(sp) + 138a: 46be lw a3,204(sp) + 138c: 5662 lw a2,56(sp) + 138e: cabe sw a5,84(sp) + +00001390 <.LVL198>: + 1390: 479e lw a5,196(sp) + 1392: 54fd li s1,-1 + 1394: 190c add a1,sp,176 + 1396: ccbe sw a5,88(sp) + 1398: 47ae lw a5,200(sp) + 139a: 0188 add a0,sp,192 + 139c: 4405 li s0,1 + 139e: cebe sw a5,92(sp) + 13a0: 800007b7 lui a5,0x80000 + 13a4: fff7c713 not a4,a5 + 13a8: 8ef9 and a3,a3,a4 + 13aa: 8ff1 and a5,a5,a2 + 13ac: 8fd5 or a5,a5,a3 + 13ae: d03e sw a5,32(sp) + +000013b0 <.LVL199>: + 13b0: 57f2 lw a5,60(sp) + +000013b2 <.LVL200>: + 13b2: 000006b7 lui a3,0x0 + 13b6: d926 sw s1,176(sp) + 13b8: 8f7d and a4,a4,a5 + 13ba: 00c6a783 lw a5,12(a3) # c <__divtc3+0xc> + 13be: c7ba sw a4,204(sp) + 13c0: ce3a sw a4,28(sp) + 13c2: cc3e sw a5,24(sp) + 13c4: 5792 lw a5,36(sp) + 13c6: db26 sw s1,180(sp) + 13c8: dd26 sw s1,184(sp) + 13ca: c1be sw a5,192(sp) + +000013cc <.LVL201>: + 13cc: 57a2 lw a5,40(sp) + 13ce: c3be sw a5,196(sp) + +000013d0 <.LVL202>: + 13d0: 57b2 lw a5,44(sp) + 13d2: c5be sw a5,200(sp) + +000013d4 <.LVL203>: + 13d4: 47e2 lw a5,24(sp) + 13d6: df3e sw a5,188(sp) + 13d8: 00000097 auipc ra,0x0 + 13dc: 000080e7 jalr ra # 13d8 <.LVL203+0x4> + +000013e0 <.LVL204>: + 13e0: e911 bnez a0,13f4 <.L48> + 13e2: 190c add a1,sp,176 + 13e4: 0188 add a0,sp,192 + 13e6: 00000097 auipc ra,0x0 + 13ea: 000080e7 jalr ra # 13e6 <.LVL204+0x6> + +000013ee <.LVL205>: + 13ee: 00a05363 blez a0,13f4 <.L48> + 13f2: 4401 li s0,0 + +000013f4 <.L48>: + 13f4: 00144593 xor a1,s0,1 + 13f8: 8985 and a1,a1,1 + 13fa: 0188 add a0,sp,192 + 13fc: 00000097 auipc ra,0x0 + 1400: 000080e7 jalr ra # 13fc <.L48+0x8> + +00001404 <.LVL206>: + 1404: 478e lw a5,192(sp) + 1406: 443e lw s0,204(sp) + 1408: 1110 add a2,sp,160 + 140a: cc3e sw a5,24(sp) + 140c: 479e lw a5,196(sp) + 140e: 190c add a1,sp,176 + 1410: 0188 add a0,sp,192 + 1412: ce3e sw a5,28(sp) + 1414: 800007b7 lui a5,0x80000 + 1418: fff7c713 not a4,a5 + 141c: 8c79 and s0,s0,a4 + 141e: 5772 lw a4,60(sp) + 1420: 44ae lw s1,200(sp) + 1422: 8ff9 and a5,a5,a4 + 1424: 8c5d or s0,s0,a5 + +00001426 <.LVL207>: + 1426: 4782 lw a5,0(sp) + 1428: d93e sw a5,176(sp) + 142a: 4792 lw a5,4(sp) + 142c: db3e sw a5,180(sp) + 142e: 47a2 lw a5,8(sp) + 1430: dd3e sw a5,184(sp) + 1432: 57d2 lw a5,52(sp) + 1434: df3e sw a5,188(sp) + 1436: 47d6 lw a5,84(sp) + 1438: d13e sw a5,160(sp) + 143a: 47e6 lw a5,88(sp) + 143c: d33e sw a5,164(sp) + 143e: 47f6 lw a5,92(sp) + 1440: d53e sw a5,168(sp) + 1442: 5782 lw a5,32(sp) + 1444: d73e sw a5,172(sp) + 1446: 00000097 auipc ra,0x0 + 144a: 000080e7 jalr ra # 1446 <.LVL207+0x20> + +0000144e <.LVL208>: + 144e: 47b2 lw a5,12(sp) + 1450: 438e lw t2,192(sp) + 1452: 429e lw t0,196(sp) + 1454: d13e sw a5,160(sp) + 1456: 47c2 lw a5,16(sp) + 1458: 432e lw t1,200(sp) + 145a: 46be lw a3,204(sp) + 145c: d33e sw a5,164(sp) + 145e: 47d2 lw a5,20(sp) + 1460: 0910 add a2,sp,144 + 1462: 110c add a1,sp,160 + 1464: d53e sw a5,168(sp) + 1466: 57c2 lw a5,48(sp) + 1468: 1908 add a0,sp,176 + 146a: dc1e sw t2,56(sp) + 146c: d73e sw a5,172(sp) + 146e: 47e2 lw a5,24(sp) + 1470: d616 sw t0,44(sp) + 1472: d41a sw t1,40(sp) + 1474: c93e sw a5,144(sp) + 1476: 47f2 lw a5,28(sp) + 1478: d236 sw a3,36(sp) + 147a: cd26 sw s1,152(sp) + 147c: cb3e sw a5,148(sp) + 147e: cf22 sw s0,156(sp) + 1480: 00000097 auipc ra,0x0 + 1484: 000080e7 jalr ra # 1480 <.LVL208+0x32> + +00001488 <.LVL209>: + 1488: 55ca lw a1,176(sp) + 148a: 565a lw a2,180(sp) + 148c: 53e2 lw t2,56(sp) + 148e: 52b2 lw t0,44(sp) + 1490: 5322 lw t1,40(sp) + 1492: 576a lw a4,184(sp) + 1494: 57fa lw a5,188(sp) + 1496: 5692 lw a3,36(sp) + 1498: c12e sw a1,128(sp) + 149a: c332 sw a2,132(sp) + 149c: 090c add a1,sp,144 + 149e: 0110 add a2,sp,128 + 14a0: 1108 add a0,sp,160 + 14a2: c91e sw t2,144(sp) + 14a4: cb16 sw t0,148(sp) + 14a6: cd1a sw t1,152(sp) + 14a8: cf36 sw a3,156(sp) + 14aa: c53a sw a4,136(sp) + 14ac: c73e sw a5,140(sp) + 14ae: 00000097 auipc ra,0x0 + 14b2: 000080e7 jalr ra # 14ae <.LVL209+0x26> + +000014b6 <.LVL210>: + 14b6: 560a lw a2,160(sp) + 14b8: 572a lw a4,168(sp) + 14ba: 569a lw a3,164(sp) + 14bc: 57ba lw a5,172(sp) + 14be: c132 sw a2,128(sp) + 14c0: 010c add a1,sp,128 + 14c2: 1890 add a2,sp,112 + 14c4: 0908 add a0,sp,144 + 14c6: c53a sw a4,136(sp) + 14c8: c336 sw a3,132(sp) + 14ca: c73e sw a5,140(sp) + 14cc: d882 sw zero,112(sp) + 14ce: da82 sw zero,116(sp) + 14d0: dc82 sw zero,120(sp) + 14d2: de82 sw zero,124(sp) + 14d4: 00000097 auipc ra,0x0 + 14d8: 000080e7 jalr ra # 14d4 <.LVL210+0x1e> + +000014dc <.LVL211>: + 14dc: 47ca lw a5,144(sp) + 14de: 1110 add a2,sp,160 + 14e0: 190c add a1,sp,176 + 14e2: c2be sw a5,68(sp) + +000014e4 <.LVL212>: + 14e4: 47da lw a5,148(sp) + 14e6: 0188 add a0,sp,192 + 14e8: c4be sw a5,72(sp) + 14ea: 47ea lw a5,152(sp) + 14ec: c6be sw a5,76(sp) + 14ee: 47fa lw a5,156(sp) + 14f0: c8be sw a5,80(sp) + +000014f2 <.LVL213>: + 14f2: 47b2 lw a5,12(sp) + +000014f4 <.LVL214>: + 14f4: d93e sw a5,176(sp) + 14f6: 47c2 lw a5,16(sp) + 14f8: db3e sw a5,180(sp) + 14fa: 47d2 lw a5,20(sp) + 14fc: dd3e sw a5,184(sp) + 14fe: 57c2 lw a5,48(sp) + 1500: df3e sw a5,188(sp) + 1502: 47d6 lw a5,84(sp) + 1504: d13e sw a5,160(sp) + 1506: 47e6 lw a5,88(sp) + 1508: d33e sw a5,164(sp) + 150a: 47f6 lw a5,92(sp) + 150c: d53e sw a5,168(sp) + 150e: 5782 lw a5,32(sp) + 1510: d73e sw a5,172(sp) + 1512: 00000097 auipc ra,0x0 + 1516: 000080e7 jalr ra # 1512 <.LVL214+0x1e> + +0000151a <.LVL215>: + 151a: 4782 lw a5,0(sp) + 151c: 438e lw t2,192(sp) + 151e: 429e lw t0,196(sp) + 1520: d13e sw a5,160(sp) + 1522: 4792 lw a5,4(sp) + 1524: 432e lw t1,200(sp) + 1526: 46be lw a3,204(sp) + 1528: d33e sw a5,164(sp) + 152a: 47a2 lw a5,8(sp) + 152c: 0910 add a2,sp,144 + 152e: 110c add a1,sp,160 + 1530: d53e sw a5,168(sp) + 1532: 57d2 lw a5,52(sp) + 1534: 1908 add a0,sp,176 + 1536: d01e sw t2,32(sp) + +00001538 <.LVL216>: + 1538: d73e sw a5,172(sp) + 153a: 47e2 lw a5,24(sp) + 153c: ca16 sw t0,20(sp) + +0000153e <.LVL217>: + 153e: c81a sw t1,16(sp) + 1540: c93e sw a5,144(sp) + 1542: 47f2 lw a5,28(sp) + 1544: c636 sw a3,12(sp) + 1546: cd26 sw s1,152(sp) + 1548: cb3e sw a5,148(sp) + 154a: cf22 sw s0,156(sp) + 154c: 00000097 auipc ra,0x0 + 1550: 000080e7 jalr ra # 154c <.LVL217+0xe> + +00001554 <.LVL218>: + 1554: 55ca lw a1,176(sp) + 1556: 565a lw a2,180(sp) + 1558: 576a lw a4,184(sp) + 155a: 57fa lw a5,188(sp) + 155c: 46b2 lw a3,12(sp) + 155e: 5382 lw t2,32(sp) + 1560: 42d2 lw t0,20(sp) + 1562: 4342 lw t1,16(sp) + 1564: c12e sw a1,128(sp) + 1566: c332 sw a2,132(sp) + 1568: 090c add a1,sp,144 + 156a: 0110 add a2,sp,128 + 156c: 1108 add a0,sp,160 + 156e: cf36 sw a3,156(sp) + 1570: c53a sw a4,136(sp) + 1572: c73e sw a5,140(sp) + 1574: c91e sw t2,144(sp) + 1576: cb16 sw t0,148(sp) + 1578: cd1a sw t1,152(sp) + 157a: 00000097 auipc ra,0x0 + 157e: 000080e7 jalr ra # 157a <.LVL218+0x26> + +00001582 <.LVL219>: + 1582: 560a lw a2,160(sp) + 1584: 569a lw a3,164(sp) + 1586: 572a lw a4,168(sp) + 1588: 57ba lw a5,172(sp) + 158a: c132 sw a2,128(sp) + 158c: c336 sw a3,132(sp) + 158e: c53a sw a4,136(sp) + 1590: c73e sw a5,140(sp) + 1592: d882 sw zero,112(sp) + 1594: da82 sw zero,116(sp) + 1596: dc82 sw zero,120(sp) + 1598: de82 sw zero,124(sp) + 159a: b9b5 j 1216 <.L83> + +_bswapsi2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__bswapsi2>: + 0: 01851713 sll a4,a0,0x18 + 4: 01855793 srl a5,a0,0x18 + 8: 66c1 lui a3,0x10 + a: 8fd9 or a5,a5,a4 + c: f0068693 add a3,a3,-256 # ff00 <.LASF5+0xfd71> + 10: 00855713 srl a4,a0,0x8 + 14: 8f75 and a4,a4,a3 + 16: 8fd9 or a5,a5,a4 + 18: 0522 sll a0,a0,0x8 + +0000001a <.LVL1>: + 1a: 00ff0737 lui a4,0xff0 + 1e: 8d79 and a0,a0,a4 + 20: 8d5d or a0,a0,a5 + 22: 8082 ret + +_bswapdi2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__bswapdi2>: + 0: 6341 lui t1,0x10 + 2: f0030313 add t1,t1,-256 # ff00 <.LASF6+0xfd71> + 6: 0085d713 srl a4,a1,0x8 + a: 87aa mv a5,a0 + c: 00677733 and a4,a4,t1 + 10: 0185d513 srl a0,a1,0x18 + +00000014 <.LVL1>: + 14: 00859613 sll a2,a1,0x8 + 18: 8d59 or a0,a0,a4 + 1a: 0187d713 srl a4,a5,0x18 + 1e: 8f51 or a4,a4,a2 + 20: 00ff0637 lui a2,0xff0 + 24: 8f71 and a4,a4,a2 + 26: 0187d293 srl t0,a5,0x18 + 2a: 01879693 sll a3,a5,0x18 + 2e: 8d59 or a0,a0,a4 + 30: 01859713 sll a4,a1,0x18 + 34: 00879593 sll a1,a5,0x8 + 38: 83a1 srl a5,a5,0x8 + 3a: 8fd9 or a5,a5,a4 + 3c: 0056e6b3 or a3,a3,t0 + 40: 0067f7b3 and a5,a5,t1 + 44: 8fd5 or a5,a5,a3 + 46: 8df1 and a1,a1,a2 + 48: 8d59 or a0,a0,a4 + 4a: 8ddd or a1,a1,a5 + 4c: 8082 ret + +_clrsbsi2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__clrsbsi2>: + 0: 41f55793 sra a5,a0,0x1f + 4: 00f54733 xor a4,a0,a5 + +00000008 <.LVL1>: + 8: 02f50e63 beq a0,a5,44 <.L5> + +0000000c <.LBB2>: + c: 67c1 lui a5,0x10 + e: 02f75463 bge a4,a5,36 <.L3> + 12: 10072793 slti a5,a4,256 + 16: 0017c793 xor a5,a5,1 + 1a: 078e sll a5,a5,0x3 + +0000001c <.L4>: + 1c: 000006b7 lui a3,0x0 + +00000020 <.LBE3>: + 20: 457d li a0,31 + +00000022 <.LBB4>: + 22: 00f75733 srl a4,a4,a5 + +00000026 <.LBE4>: + 26: 8d1d sub a0,a0,a5 + +00000028 <.LBB5>: + 28: 00068793 mv a5,a3 + +0000002c <.LVL5>: + 2c: 97ba add a5,a5,a4 + 2e: 0007c783 lbu a5,0(a5) # 10000 <.LASF5+0xfe52> + +00000032 <.LBE5>: + 32: 8d1d sub a0,a0,a5 + 34: 8082 ret + +00000036 <.L3>: + 36: 010006b7 lui a3,0x1000 + 3a: 47e1 li a5,24 + 3c: fed750e3 bge a4,a3,1c <.L4> + 40: 47c1 li a5,16 + 42: bfe9 j 1c <.L4> + +00000044 <.L5>: + 44: 457d li a0,31 + 46: 8082 ret + +_clrsbdi2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__clrsbdi2>: + 0: c1b9 beqz a1,46 <.L3> + 2: 57fd li a5,-1 + 4: fff54513 not a0,a0 + +00000008 <.LVL1>: + 8: 02f58f63 beq a1,a5,46 <.L3> + c: 41f5d513 sra a0,a1,0x1f + 10: 8d2d xor a0,a0,a1 + 12: 4681 li a3,0 + +00000014 <.L5>: + 14: 67c1 lui a5,0x10 + 16: 02f57e63 bgeu a0,a5,52 <.L7> + 1a: 10053713 sltiu a4,a0,256 + 1e: 00174713 xor a4,a4,1 + 22: 070e sll a4,a4,0x3 + +00000024 <.L8>: + 24: 02000793 li a5,32 + 28: 00000637 lui a2,0x0 + 2c: 00e55533 srl a0,a0,a4 + +00000030 <.LVL4>: + 30: 8f99 sub a5,a5,a4 + 32: 00060713 mv a4,a2 + +00000036 <.LVL5>: + 36: 972a add a4,a4,a0 + 38: 00074703 lbu a4,0(a4) + 3c: 40e78533 sub a0,a5,a4 + +00000040 <.L6>: + 40: 9536 add a0,a0,a3 + +00000042 <.LVL7>: + 42: 157d add a0,a0,-1 + 44: 8082 ret + +00000046 <.L3>: + 46: 02000693 li a3,32 + 4a: f569 bnez a0,14 <.L5> + 4c: 02000513 li a0,32 + +00000050 <.LVL9>: + 50: bfc5 j 40 <.L6> + +00000052 <.L7>: + 52: 010007b7 lui a5,0x1000 + 56: 4741 li a4,16 + 58: fcf566e3 bltu a0,a5,24 <.L8> + 5c: 4761 li a4,24 + 5e: b7d9 j 24 <.L8> + +_fixunsxfsi.o: file format elf32-littleriscv + + +_fixxfdi.o: file format elf32-littleriscv + + +_fixunsxfdi.o: file format elf32-littleriscv + + +_floatdixf.o: file format elf32-littleriscv + + +_floatundixf.o: file format elf32-littleriscv + + +_eprintf.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__eprintf>: + 0: 1151 add sp,sp,-12 + 2: c222 sw s0,4(sp) + 4: 00000437 lui s0,0x0 + 8: 00042783 lw a5,0(s0) # 0 <__eprintf> + c: 8736 mv a4,a3 + e: 86b2 mv a3,a2 + +00000010 <.LVL1>: + 10: 862e mv a2,a1 + +00000012 <.LVL2>: + 12: 85aa mv a1,a0 + +00000014 <.LVL3>: + 14: 47c8 lw a0,12(a5) + +00000016 <.LVL4>: + 16: c406 sw ra,8(sp) + 18: 00000097 auipc ra,0x0 + 1c: 000080e7 jalr ra # 18 <.LVL4+0x2> + +00000020 <.LVL5>: + 20: 00042783 lw a5,0(s0) + 24: 47c8 lw a0,12(a5) + 26: 00000097 auipc ra,0x0 + 2a: 000080e7 jalr ra # 26 <.LVL5+0x6> + +0000002e <.LVL6>: + 2e: 00000097 auipc ra,0x0 + 32: 000080e7 jalr ra # 2e <.LVL6> + +__gcc_bcmp.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__gcc_bcmp>: + 0: 4701 li a4,0 + +00000002 <.L2>: + 2: 00e61463 bne a2,a4,a <.L4> + 6: 4501 li a0,0 + +00000008 <.LVL2>: + 8: 8082 ret + +0000000a <.L4>: + a: 00e507b3 add a5,a0,a4 + e: 0705 add a4,a4,1 + +00000010 <.LVL4>: + 10: 00e586b3 add a3,a1,a4 + 14: 0007c783 lbu a5,0(a5) + +00000018 <.LVL5>: + 18: fff6c683 lbu a3,-1(a3) + 1c: fed783e3 beq a5,a3,2 <.L2> + 20: 40d78533 sub a0,a5,a3 + +00000024 <.LVL7>: + 24: 8082 ret + +_divdi3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__divdi3>: + 0: fcc10113 add sp,sp,-52 + 4: d806 sw ra,48(sp) + 6: d622 sw s0,44(sp) + 8: d426 sw s1,40(sp) + a: c002 sw zero,0(sp) + c: 832a mv t1,a0 + +0000000e <.LVL1>: + e: 0005db63 bgez a1,24 <.L2> + +00000012 <.LVL2>: + 12: 00a037b3 snez a5,a0 + 16: 40b005b3 neg a1,a1 + 1a: 8d9d sub a1,a1,a5 + 1c: 57fd li a5,-1 + 1e: 40a00333 neg t1,a0 + 22: c03e sw a5,0(sp) + +00000024 <.L2>: + 24: 0006dd63 bgez a3,3e <.L3> + 28: 4782 lw a5,0(sp) + 2a: 40d006b3 neg a3,a3 + +0000002e <.LVL4>: + 2e: fff7c793 not a5,a5 + 32: c03e sw a5,0(sp) + +00000034 <.LVL5>: + 34: 00c037b3 snez a5,a2 + +00000038 <.LVL6>: + 38: 8e9d sub a3,a3,a5 + 3a: 40c00633 neg a2,a2 + +0000003e <.L3>: + 3e: 82b2 mv t0,a2 + +00000040 <.LVL8>: + 40: 841a mv s0,t1 + +00000042 <.LVL9>: + 42: 84ae mv s1,a1 + 44: 30069c63 bnez a3,35c <.L4> + 48: 000006b7 lui a3,0x0 + 4c: 00068693 mv a3,a3 + 50: 10c5f763 bgeu a1,a2,15e <.L5> + +00000054 <.LBB22>: + 54: 67c1 lui a5,0x10 + 56: 0ef67d63 bgeu a2,a5,150 <.L6> + 5a: 10063793 sltiu a5,a2,256 + 5e: 0017c793 xor a5,a5,1 + 62: 078e sll a5,a5,0x3 + +00000064 <.L7>: + 64: 00f65533 srl a0,a2,a5 + 68: 96aa add a3,a3,a0 + 6a: 0006c683 lbu a3,0(a3) # 0 <__divdi3> + 6e: 02000513 li a0,32 + 72: 97b6 add a5,a5,a3 + +00000074 <.LVL13>: + 74: 40f506b3 sub a3,a0,a5 + +00000078 <.LBE22>: + 78: 00f50c63 beq a0,a5,90 <.L8> + +0000007c <.LVL15>: + 7c: 00d59733 sll a4,a1,a3 + 80: 00f357b3 srl a5,t1,a5 + 84: 00d612b3 sll t0,a2,a3 + +00000088 <.LVL16>: + 88: 00e7e4b3 or s1,a5,a4 + +0000008c <.LVL17>: + 8c: 00d31433 sll s0,t1,a3 + +00000090 <.L8>: + 90: 0102d793 srl a5,t0,0x10 + 94: c23e sw a5,4(sp) + +00000096 <.LVL19>: + 96: 4592 lw a1,4(sp) + 98: 01029793 sll a5,t0,0x10 + +0000009c <.LVL20>: + 9c: 83c1 srl a5,a5,0x10 + 9e: 8526 mv a0,s1 + a0: ca16 sw t0,20(sp) + a2: c43e sw a5,8(sp) + +000000a4 <.LVL21>: + a4: 00000097 auipc ra,0x0 + a8: 000080e7 jalr ra # a4 <.LVL21> + +000000ac <.LVL22>: + ac: 85aa mv a1,a0 + ae: c82a sw a0,16(sp) + b0: 4522 lw a0,8(sp) + +000000b2 <.LVL23>: + b2: 00000097 auipc ra,0x0 + b6: 000080e7 jalr ra # b2 <.LVL23> + +000000ba <.LVL24>: + ba: 4592 lw a1,4(sp) + bc: c62a sw a0,12(sp) + +000000be <.LVL25>: + be: 8526 mv a0,s1 + +000000c0 <.LVL26>: + c0: 00000097 auipc ra,0x0 + c4: 000080e7 jalr ra # c0 <.LVL26> + +000000c8 <.LVL27>: + c8: 4642 lw a2,16(sp) + ca: 46b2 lw a3,12(sp) + cc: 0542 sll a0,a0,0x10 + ce: 01045713 srl a4,s0,0x10 + d2: 8f49 or a4,a4,a0 + +000000d4 <.LVL28>: + d4: 42d2 lw t0,20(sp) + d6: 84b2 mv s1,a2 + +000000d8 <.LVL29>: + d8: 00d77c63 bgeu a4,a3,f0 <.L9> + dc: 9716 add a4,a4,t0 + +000000de <.LVL30>: + de: fff60493 add s1,a2,-1 + +000000e2 <.LVL31>: + e2: 00576763 bltu a4,t0,f0 <.L9> + e6: 00d77563 bgeu a4,a3,f0 <.L9> + ea: ffe60493 add s1,a2,-2 + ee: 9716 add a4,a4,t0 + +000000f0 <.L9>: + f0: 4592 lw a1,4(sp) + f2: 40d707b3 sub a5,a4,a3 + f6: 853e mv a0,a5 + f8: ca16 sw t0,20(sp) + +000000fa <.LVL34>: + fa: c63e sw a5,12(sp) + +000000fc <.LVL35>: + fc: 00000097 auipc ra,0x0 + 100: 000080e7 jalr ra # fc <.LVL35> + +00000104 <.LVL36>: + 104: 85aa mv a1,a0 + 106: c82a sw a0,16(sp) + 108: 4522 lw a0,8(sp) + +0000010a <.LVL37>: + 10a: 0442 sll s0,s0,0x10 + +0000010c <.LVL38>: + 10c: 8041 srl s0,s0,0x10 + 10e: 00000097 auipc ra,0x0 + 112: 000080e7 jalr ra # 10e <.LVL38+0x2> + +00000116 <.LVL39>: + 116: c42a sw a0,8(sp) + +00000118 <.LVL40>: + 118: 4592 lw a1,4(sp) + 11a: 4532 lw a0,12(sp) + +0000011c <.LVL41>: + 11c: 00000097 auipc ra,0x0 + 120: 000080e7 jalr ra # 11c <.LVL41> + +00000124 <.LVL42>: + 124: 4742 lw a4,16(sp) + 126: 46a2 lw a3,8(sp) + 128: 0542 sll a0,a0,0x10 + 12a: 8c49 or s0,s0,a0 + +0000012c <.LVL43>: + 12c: 863a mv a2,a4 + 12e: 00d47c63 bgeu s0,a3,146 <.L12> + 132: 42d2 lw t0,20(sp) + 134: fff70613 add a2,a4,-1 + +00000138 <.LVL44>: + 138: 9416 add s0,s0,t0 + +0000013a <.LVL45>: + 13a: 00546663 bltu s0,t0,146 <.L12> + +0000013e <.LVL46>: + 13e: 00d47463 bgeu s0,a3,146 <.L12> + 142: ffe70613 add a2,a4,-2 + +00000146 <.L12>: + 146: 01049793 sll a5,s1,0x10 + 14a: 8fd1 or a5,a5,a2 + +0000014c <.L59>: + 14c: 4481 li s1,0 + 14e: a211 j 252 <.L15> + +00000150 <.L6>: + 150: 01000537 lui a0,0x1000 + +00000154 <.LVL50>: + 154: 47c1 li a5,16 + 156: f0a667e3 bltu a2,a0,64 <.L7> + 15a: 47e1 li a5,24 + 15c: b721 j 64 <.L7> + +0000015e <.L5>: + 15e: 4781 li a5,0 + +00000160 <.LBE37>: + 160: ca09 beqz a2,172 <.L16> + +00000162 <.LBB38>: + 162: 67c1 lui a5,0x10 + 164: 10f67863 bgeu a2,a5,274 <.L17> + +00000168 <.LVL53>: + 168: 10063793 sltiu a5,a2,256 + 16c: 0017c793 xor a5,a5,1 + 170: 078e sll a5,a5,0x3 + +00000172 <.L16>: + 172: 00f65733 srl a4,a2,a5 + 176: 9736 add a4,a4,a3 + 178: 00074703 lbu a4,0(a4) + 17c: 02000693 li a3,32 + 180: 97ba add a5,a5,a4 + +00000182 <.LVL55>: + 182: 40f68733 sub a4,a3,a5 + +00000186 <.LBE38>: + 186: 0ef69e63 bne a3,a5,282 <.L18> + 18a: 40c58633 sub a2,a1,a2 + +0000018e <.LVL57>: + 18e: 4485 li s1,1 + +00000190 <.L19>: + 190: 0102d793 srl a5,t0,0x10 + 194: c23e sw a5,4(sp) + +00000196 <.LVL59>: + 196: 4592 lw a1,4(sp) + 198: 01029793 sll a5,t0,0x10 + +0000019c <.LVL60>: + 19c: 83c1 srl a5,a5,0x10 + 19e: 8532 mv a0,a2 + 1a0: cc16 sw t0,24(sp) + 1a2: c43e sw a5,8(sp) + +000001a4 <.LVL61>: + 1a4: ca32 sw a2,20(sp) + 1a6: 00000097 auipc ra,0x0 + 1aa: 000080e7 jalr ra # 1a6 <.LVL61+0x2> + +000001ae <.LVL62>: + 1ae: 85aa mv a1,a0 + 1b0: c82a sw a0,16(sp) + 1b2: 4522 lw a0,8(sp) + +000001b4 <.LVL63>: + 1b4: 00000097 auipc ra,0x0 + 1b8: 000080e7 jalr ra # 1b4 <.LVL63> + +000001bc <.LVL64>: + 1bc: 4652 lw a2,20(sp) + 1be: 4592 lw a1,4(sp) + 1c0: c62a sw a0,12(sp) + +000001c2 <.LVL65>: + 1c2: 8532 mv a0,a2 + +000001c4 <.LVL66>: + 1c4: 00000097 auipc ra,0x0 + 1c8: 000080e7 jalr ra # 1c4 <.LVL66> + +000001cc <.LVL67>: + 1cc: 43c2 lw t2,16(sp) + 1ce: 4332 lw t1,12(sp) + 1d0: 0542 sll a0,a0,0x10 + 1d2: 01045693 srl a3,s0,0x10 + 1d6: 8ec9 or a3,a3,a0 + +000001d8 <.LVL68>: + 1d8: 42e2 lw t0,24(sp) + 1da: 879e mv a5,t2 + 1dc: 0066fc63 bgeu a3,t1,1f4 <.L26> + 1e0: 9696 add a3,a3,t0 + +000001e2 <.LVL69>: + 1e2: fff38793 add a5,t2,-1 + +000001e6 <.LVL70>: + 1e6: 0056e763 bltu a3,t0,1f4 <.L26> + 1ea: 0066f563 bgeu a3,t1,1f4 <.L26> + 1ee: ffe38793 add a5,t2,-2 + 1f2: 9696 add a3,a3,t0 + +000001f4 <.L26>: + 1f4: 4592 lw a1,4(sp) + 1f6: cc3e sw a5,24(sp) + +000001f8 <.LVL73>: + 1f8: 406687b3 sub a5,a3,t1 + +000001fc <.LVL74>: + 1fc: 853e mv a0,a5 + 1fe: c63e sw a5,12(sp) + +00000200 <.LVL75>: + 200: ca16 sw t0,20(sp) + +00000202 <.LVL76>: + 202: 00000097 auipc ra,0x0 + 206: 000080e7 jalr ra # 202 <.LVL76> + +0000020a <.LVL77>: + 20a: 85aa mv a1,a0 + 20c: c82a sw a0,16(sp) + 20e: 4522 lw a0,8(sp) + +00000210 <.LVL78>: + 210: 0442 sll s0,s0,0x10 + +00000212 <.LVL79>: + 212: 8041 srl s0,s0,0x10 + 214: 00000097 auipc ra,0x0 + 218: 000080e7 jalr ra # 214 <.LVL79+0x2> + +0000021c <.LVL80>: + 21c: 4592 lw a1,4(sp) + 21e: c42a sw a0,8(sp) + +00000220 <.LVL81>: + 220: 4532 lw a0,12(sp) + +00000222 <.LVL82>: + 222: 00000097 auipc ra,0x0 + 226: 000080e7 jalr ra # 222 <.LVL82> + +0000022a <.LVL83>: + 22a: 46c2 lw a3,16(sp) + 22c: 4622 lw a2,8(sp) + 22e: 0542 sll a0,a0,0x10 + 230: 8c49 or s0,s0,a0 + +00000232 <.LVL84>: + 232: 47e2 lw a5,24(sp) + 234: 85b6 mv a1,a3 + 236: 00c47c63 bgeu s0,a2,24e <.L29> + 23a: 42d2 lw t0,20(sp) + 23c: fff68593 add a1,a3,-1 + +00000240 <.LVL85>: + 240: 9416 add s0,s0,t0 + +00000242 <.LVL86>: + 242: 00546663 bltu s0,t0,24e <.L29> + +00000246 <.LVL87>: + 246: 00c47463 bgeu s0,a2,24e <.L29> + 24a: ffe68593 add a1,a3,-2 + +0000024e <.L29>: + 24e: 07c2 sll a5,a5,0x10 + 250: 8fcd or a5,a5,a1 + +00000252 <.L15>: + 252: 853e mv a0,a5 + +00000254 <.LBE20>: + 254: 4782 lw a5,0(sp) + +00000256 <.LBB46>: + 256: 85a6 mv a1,s1 + +00000258 <.LBE46>: + 258: cb81 beqz a5,268 <.L1> + 25a: 00a037b3 snez a5,a0 + 25e: 409005b3 neg a1,s1 + 262: 8d9d sub a1,a1,a5 + 264: 40a00533 neg a0,a0 + +00000268 <.L1>: + 268: 50c2 lw ra,48(sp) + 26a: 5432 lw s0,44(sp) + 26c: 54a2 lw s1,40(sp) + 26e: 03410113 add sp,sp,52 + +00000272 <.LVL93>: + 272: 8082 ret + +00000274 <.L17>: + 274: 01000737 lui a4,0x1000 + 278: 47c1 li a5,16 + 27a: eee66ce3 bltu a2,a4,172 <.L16> + 27e: 47e1 li a5,24 + 280: bdcd j 172 <.L16> + +00000282 <.L18>: + 282: 00f5d4b3 srl s1,a1,a5 + 286: 00e595b3 sll a1,a1,a4 + 28a: 00f357b3 srl a5,t1,a5 + +0000028e <.LVL96>: + 28e: 00e612b3 sll t0,a2,a4 + +00000292 <.LVL97>: + 292: 8fcd or a5,a5,a1 + 294: c43e sw a5,8(sp) + +00000296 <.LBB41>: + 296: 0102d793 srl a5,t0,0x10 + +0000029a <.LVL99>: + 29a: c23e sw a5,4(sp) + 29c: 4592 lw a1,4(sp) + 29e: 01029793 sll a5,t0,0x10 + 2a2: 83c1 srl a5,a5,0x10 + 2a4: 8526 mv a0,s1 + +000002a6 <.LVL100>: + 2a6: cc16 sw t0,24(sp) + 2a8: c63e sw a5,12(sp) + +000002aa <.LBE41>: + 2aa: 00e31433 sll s0,t1,a4 + +000002ae <.LBB42>: + 2ae: 00000097 auipc ra,0x0 + 2b2: 000080e7 jalr ra # 2ae <.LBB42> + +000002b6 <.LVL102>: + 2b6: 85aa mv a1,a0 + 2b8: ca2a sw a0,20(sp) + 2ba: 4532 lw a0,12(sp) + +000002bc <.LVL103>: + 2bc: 00000097 auipc ra,0x0 + 2c0: 000080e7 jalr ra # 2bc <.LVL103> + +000002c4 <.LVL104>: + 2c4: 4592 lw a1,4(sp) + 2c6: c82a sw a0,16(sp) + +000002c8 <.LVL105>: + 2c8: 8526 mv a0,s1 + +000002ca <.LVL106>: + 2ca: 00000097 auipc ra,0x0 + 2ce: 000080e7 jalr ra # 2ca <.LVL106> + +000002d2 <.LVL107>: + 2d2: 47a2 lw a5,8(sp) + 2d4: 4652 lw a2,20(sp) + 2d6: 46c2 lw a3,16(sp) + 2d8: 0542 sll a0,a0,0x10 + 2da: 83c1 srl a5,a5,0x10 + 2dc: 8fc9 or a5,a5,a0 + +000002de <.LVL108>: + 2de: 42e2 lw t0,24(sp) + 2e0: 84b2 mv s1,a2 + +000002e2 <.LVL109>: + 2e2: 00d7fc63 bgeu a5,a3,2fa <.L20> + 2e6: 9796 add a5,a5,t0 + +000002e8 <.LVL110>: + 2e8: fff60493 add s1,a2,-1 + +000002ec <.LVL111>: + 2ec: 0057e763 bltu a5,t0,2fa <.L20> + 2f0: 00d7f563 bgeu a5,a3,2fa <.L20> + 2f4: ffe60493 add s1,a2,-2 + 2f8: 9796 add a5,a5,t0 + +000002fa <.L20>: + 2fa: 4592 lw a1,4(sp) + 2fc: 8f95 sub a5,a5,a3 + +000002fe <.LVL114>: + 2fe: 853e mv a0,a5 + 300: cc16 sw t0,24(sp) + +00000302 <.LVL115>: + 302: c83e sw a5,16(sp) + +00000304 <.LVL116>: + 304: 00000097 auipc ra,0x0 + 308: 000080e7 jalr ra # 304 <.LVL116> + +0000030c <.LVL117>: + 30c: 85aa mv a1,a0 + 30e: ca2a sw a0,20(sp) + 310: 4532 lw a0,12(sp) + +00000312 <.LVL118>: + 312: 00000097 auipc ra,0x0 + 316: 000080e7 jalr ra # 312 <.LVL118> + +0000031a <.LVL119>: + 31a: 4592 lw a1,4(sp) + 31c: c62a sw a0,12(sp) + +0000031e <.LVL120>: + 31e: 4542 lw a0,16(sp) + +00000320 <.LVL121>: + 320: 00000097 auipc ra,0x0 + 324: 000080e7 jalr ra # 320 <.LVL121> + +00000328 <.LVL122>: + 328: 00815603 lhu a2,8(sp) + 32c: 46d2 lw a3,20(sp) + 32e: 47b2 lw a5,12(sp) + 330: 0542 sll a0,a0,0x10 + 332: 8e49 or a2,a2,a0 + +00000334 <.LVL123>: + 334: 42e2 lw t0,24(sp) + 336: 85b6 mv a1,a3 + 338: 00f67c63 bgeu a2,a5,350 <.L23> + +0000033c <.LVL124>: + 33c: 9616 add a2,a2,t0 + +0000033e <.LVL125>: + 33e: fff68593 add a1,a3,-1 + +00000342 <.LVL126>: + 342: 00566763 bltu a2,t0,350 <.L23> + 346: 00f67563 bgeu a2,a5,350 <.L23> + 34a: ffe68593 add a1,a3,-2 + 34e: 9616 add a2,a2,t0 + +00000350 <.L23>: + 350: 01049713 sll a4,s1,0x10 + 354: 8e1d sub a2,a2,a5 + 356: 00b764b3 or s1,a4,a1 + +0000035a <.LVL130>: + 35a: bd1d j 190 <.L19> + +0000035c <.L4>: + 35c: 1cd5e663 bltu a1,a3,528 <.L54> + +00000360 <.LBB43>: + 360: 67c1 lui a5,0x10 + 362: 02f6ff63 bgeu a3,a5,3a0 <.L32> + 366: 1006b793 sltiu a5,a3,256 + 36a: 0017c793 xor a5,a5,1 + 36e: 078e sll a5,a5,0x3 + +00000370 <.L33>: + 370: 00000737 lui a4,0x0 + 374: 00f6d533 srl a0,a3,a5 + +00000378 <.LVL134>: + 378: 00070713 mv a4,a4 + 37c: 972a add a4,a4,a0 + 37e: 00074503 lbu a0,0(a4) # 0 <__divdi3> + 382: 953e add a0,a0,a5 + 384: 02000793 li a5,32 + +00000388 <.LVL135>: + 388: 40a784b3 sub s1,a5,a0 + +0000038c <.LBE43>: + 38c: 02a79163 bne a5,a0,3ae <.L34> + 390: 4785 li a5,1 + 392: ecb6e0e3 bltu a3,a1,252 <.L15> + 396: 00c33633 sltu a2,t1,a2 + 39a: 00164793 xor a5,a2,1 + 39e: bd55 j 252 <.L15> + +000003a0 <.L32>: + 3a0: 01000737 lui a4,0x1000 + 3a4: 47c1 li a5,16 + 3a6: fce6e5e3 bltu a3,a4,370 <.L33> + 3aa: 47e1 li a5,24 + 3ac: b7d1 j 370 <.L33> + +000003ae <.L34>: + 3ae: 009697b3 sll a5,a3,s1 + 3b2: 00a656b3 srl a3,a2,a0 + +000003b6 <.LVL139>: + 3b6: 8edd or a3,a3,a5 + +000003b8 <.LVL140>: + 3b8: 00a5d433 srl s0,a1,a0 + 3bc: 009617b3 sll a5,a2,s1 + 3c0: 00a35533 srl a0,t1,a0 + +000003c4 <.LVL141>: + 3c4: 009595b3 sll a1,a1,s1 + 3c8: c43e sw a5,8(sp) + +000003ca <.LVL142>: + 3ca: 00b567b3 or a5,a0,a1 + +000003ce <.LVL143>: + 3ce: c63e sw a5,12(sp) + +000003d0 <.LBB25>: + 3d0: 0106d793 srl a5,a3,0x10 + +000003d4 <.LVL145>: + 3d4: c23e sw a5,4(sp) + +000003d6 <.LVL146>: + 3d6: 4592 lw a1,4(sp) + 3d8: 01069793 sll a5,a3,0x10 + +000003dc <.LVL147>: + 3dc: 83c1 srl a5,a5,0x10 + 3de: 8522 mv a0,s0 + +000003e0 <.LBE25>: + 3e0: d01a sw t1,32(sp) + +000003e2 <.LBB26>: + 3e2: ce36 sw a3,28(sp) + 3e4: c83e sw a5,16(sp) + +000003e6 <.LVL149>: + 3e6: 00000097 auipc ra,0x0 + 3ea: 000080e7 jalr ra # 3e6 <.LVL149> + +000003ee <.LVL150>: + 3ee: 85aa mv a1,a0 + 3f0: cc2a sw a0,24(sp) + 3f2: 4542 lw a0,16(sp) + +000003f4 <.LVL151>: + 3f4: 00000097 auipc ra,0x0 + 3f8: 000080e7 jalr ra # 3f4 <.LVL151> + +000003fc <.LVL152>: + 3fc: 4592 lw a1,4(sp) + 3fe: ca2a sw a0,20(sp) + +00000400 <.LVL153>: + 400: 8522 mv a0,s0 + +00000402 <.LVL154>: + 402: 00000097 auipc ra,0x0 + 406: 000080e7 jalr ra # 402 <.LVL154> + +0000040a <.LVL155>: + 40a: 47b2 lw a5,12(sp) + 40c: 42e2 lw t0,24(sp) + 40e: 4652 lw a2,20(sp) + 410: 0107d413 srl s0,a5,0x10 + +00000414 <.LVL156>: + 414: 0542 sll a0,a0,0x10 + 416: 8c49 or s0,s0,a0 + +00000418 <.LVL157>: + 418: 46f2 lw a3,28(sp) + 41a: 5302 lw t1,32(sp) + 41c: 8796 mv a5,t0 + 41e: 00c47c63 bgeu s0,a2,436 <.L35> + 422: 9436 add s0,s0,a3 + +00000424 <.LVL158>: + 424: fff28793 add a5,t0,-1 + +00000428 <.LVL159>: + 428: 00d46763 bltu s0,a3,436 <.L35> + 42c: 00c47563 bgeu s0,a2,436 <.L35> + 430: ffe28793 add a5,t0,-2 + 434: 9436 add s0,s0,a3 + +00000436 <.L35>: + 436: 4592 lw a1,4(sp) + 438: d03e sw a5,32(sp) + 43a: 40c407b3 sub a5,s0,a2 + +0000043e <.LVL162>: + 43e: 853e mv a0,a5 + 440: d21a sw t1,36(sp) + 442: ca3e sw a5,20(sp) + +00000444 <.LVL163>: + 444: ce36 sw a3,28(sp) + +00000446 <.LVL164>: + 446: 00000097 auipc ra,0x0 + 44a: 000080e7 jalr ra # 446 <.LVL164> + +0000044e <.LVL165>: + 44e: 85aa mv a1,a0 + 450: cc2a sw a0,24(sp) + 452: 4542 lw a0,16(sp) + +00000454 <.LVL166>: + 454: 00000097 auipc ra,0x0 + 458: 000080e7 jalr ra # 454 <.LVL166> + +0000045c <.LVL167>: + 45c: 4592 lw a1,4(sp) + 45e: 842a mv s0,a0 + +00000460 <.LVL168>: + 460: 4552 lw a0,20(sp) + 462: 00000097 auipc ra,0x0 + 466: 000080e7 jalr ra # 462 <.LVL168+0x2> + +0000046a <.LVL169>: + 46a: 00c15603 lhu a2,12(sp) + 46e: 43e2 lw t2,24(sp) + 470: 0542 sll a0,a0,0x10 + 472: 8e49 or a2,a2,a0 + +00000474 <.LVL170>: + 474: 5782 lw a5,32(sp) + 476: 5312 lw t1,36(sp) + 478: 859e mv a1,t2 + 47a: 00867d63 bgeu a2,s0,494 <.L38> + 47e: 46f2 lw a3,28(sp) + 480: fff38593 add a1,t2,-1 + +00000484 <.LVL171>: + 484: 9636 add a2,a2,a3 + 486: 00d66763 bltu a2,a3,494 <.L38> + +0000048a <.LVL173>: + 48a: 00867563 bgeu a2,s0,494 <.L38> + 48e: ffe38593 add a1,t2,-2 + 492: 9636 add a2,a2,a3 + +00000494 <.L38>: + 494: 40860733 sub a4,a2,s0 + +00000498 <.LBB27>: + 498: 4622 lw a2,8(sp) + 49a: 66c1 lui a3,0x10 + +0000049c <.LBB32>: + 49c: 07c2 sll a5,a5,0x10 + 49e: 8fcd or a5,a5,a1 + +000004a0 <.LBB33>: + 4a0: fff68293 add t0,a3,-1 # ffff <.LLST68+0xf2ae> + 4a4: 0057f433 and s0,a5,t0 + +000004a8 <.LVL178>: + 4a8: 005672b3 and t0,a2,t0 + +000004ac <.LVL179>: + 4ac: 8241 srl a2,a2,0x10 + 4ae: c232 sw a2,4(sp) + +000004b0 <.LBB28>: + 4b0: 8522 mv a0,s0 + 4b2: 8596 mv a1,t0 + +000004b4 <.LVL181>: + 4b4: 00000097 auipc ra,0x0 + 4b8: 000080e7 jalr ra # 4b4 <.LVL181> + +000004bc <.LVL182>: + 4bc: 83aa mv t2,a0 + +000004be <.LBB29>: + 4be: 4592 lw a1,4(sp) + 4c0: 8522 mv a0,s0 + 4c2: 00000097 auipc ra,0x0 + 4c6: 000080e7 jalr ra # 4c2 <.LBB29+0x4> + 4ca: 842a mv s0,a0 + +000004cc <.LBB30>: + 4cc: 8596 mv a1,t0 + 4ce: 0107d513 srl a0,a5,0x10 + +000004d2 <.LVL185>: + 4d2: 00000097 auipc ra,0x0 + 4d6: 000080e7 jalr ra # 4d2 <.LVL185> + +000004da <.LVL186>: + 4da: 82aa mv t0,a0 + +000004dc <.LBB31>: + 4dc: 4592 lw a1,4(sp) + 4de: 0107d513 srl a0,a5,0x10 + +000004e2 <.LVL188>: + 4e2: 00000097 auipc ra,0x0 + 4e6: 000080e7 jalr ra # 4e2 <.LVL188> + +000004ea <.LBE31>: + 4ea: 0103d613 srl a2,t2,0x10 + 4ee: 005406b3 add a3,s0,t0 + 4f2: 00d60433 add s0,a2,a3 + +000004f6 <.LVL190>: + 4f6: 00547463 bgeu s0,t0,4fe <.L41> + 4fa: 66c1 lui a3,0x10 + +000004fc <.LVL191>: + 4fc: 9536 add a0,a0,a3 + +000004fe <.L41>: + 4fe: 01045693 srl a3,s0,0x10 + 502: 9536 add a0,a0,a3 + +00000504 <.LBE33>: + 504: 02a76063 bltu a4,a0,524 <.L42> + 508: c4a712e3 bne a4,a0,14c <.L59> + +0000050c <.LBB34>: + 50c: 6741 lui a4,0x10 + +0000050e <.LVL194>: + 50e: 177d add a4,a4,-1 # ffff <.LLST68+0xf2ae> + +00000510 <.LVL195>: + 510: 8c79 and s0,s0,a4 + +00000512 <.LVL196>: + 512: 0442 sll s0,s0,0x10 + 514: 00e3f733 and a4,t2,a4 + +00000518 <.LBE34>: + 518: 00931333 sll t1,t1,s1 + +0000051c <.LBB35>: + 51c: 943a add s0,s0,a4 + +0000051e <.LBE35>: + 51e: 4481 li s1,0 + +00000520 <.LVL198>: + 520: d28379e3 bgeu t1,s0,252 <.L15> + +00000524 <.L42>: + 524: 17fd add a5,a5,-1 # ffff <.LLST68+0xf2ae> + +00000526 <.LBE45>: + 526: b11d j 14c <.L59> + +00000528 <.L54>: + 528: 4481 li s1,0 + 52a: 4781 li a5,0 + 52c: b31d j 252 <.L15> + +_moddi3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__moddi3>: + 0: fc810113 add sp,sp,-56 + 4: da06 sw ra,52(sp) + 6: d822 sw s0,48(sp) + 8: d626 sw s1,44(sp) + a: c802 sw zero,16(sp) + c: 0005db63 bgez a1,22 <.L2> + +00000010 <.LVL1>: + 10: 00a037b3 snez a5,a0 + 14: 40b005b3 neg a1,a1 + 18: 8d9d sub a1,a1,a5 + 1a: 57fd li a5,-1 + 1c: 40a00533 neg a0,a0 + +00000020 <.LVL2>: + 20: c83e sw a5,16(sp) + +00000022 <.L2>: + 22: 0006d963 bgez a3,34 <.L3> + +00000026 <.LVL4>: + 26: 00c037b3 snez a5,a2 + 2a: 40d006b3 neg a3,a3 + 2e: 8e9d sub a3,a3,a5 + 30: 40c00633 neg a2,a2 + +00000034 <.L3>: + 34: 84b2 mv s1,a2 + +00000036 <.LVL8>: + 36: 842a mv s0,a0 + +00000038 <.LVL9>: + 38: 872e mv a4,a1 + 3a: 24069a63 bnez a3,28e <.L4> + +0000003e <.LVL11>: + 3e: 000006b7 lui a3,0x0 + +00000042 <.LVL12>: + 42: 00068313 mv t1,a3 + 46: 10c5fa63 bgeu a1,a2,15a <.L5> + +0000004a <.LBB22>: + 4a: 66c1 lui a3,0x10 + 4c: 10d67063 bgeu a2,a3,14c <.L6> + 50: 10063693 sltiu a3,a2,256 + 54: 0016c693 xor a3,a3,1 + 58: 068e sll a3,a3,0x3 + +0000005a <.L7>: + 5a: 00d652b3 srl t0,a2,a3 + 5e: 9316 add t1,t1,t0 + 60: 00034303 lbu t1,0(t1) + 64: 969a add a3,a3,t1 + +00000066 <.LVL15>: + 66: 02000313 li t1,32 + 6a: 40d307b3 sub a5,t1,a3 + 6e: c03e sw a5,0(sp) + +00000070 <.LBE22>: + 70: 00d30b63 beq t1,a3,86 <.L8> + 74: 00f59733 sll a4,a1,a5 + 78: 00d556b3 srl a3,a0,a3 + 7c: 00f614b3 sll s1,a2,a5 + +00000080 <.LVL17>: + 80: 8f55 or a4,a4,a3 + +00000082 <.LVL18>: + 82: 00f51433 sll s0,a0,a5 + +00000086 <.L8>: + 86: 01049793 sll a5,s1,0x10 + +0000008a <.LVL20>: + 8a: 83c1 srl a5,a5,0x10 + 8c: 853a mv a0,a4 + 8e: 0104d593 srl a1,s1,0x10 + 92: c43a sw a4,8(sp) + 94: c23e sw a5,4(sp) + +00000096 <.LVL21>: + 96: 00000097 auipc ra,0x0 + 9a: 000080e7 jalr ra # 96 <.LVL21> + +0000009e <.LVL22>: + 9e: 01049593 sll a1,s1,0x10 + a2: 81c1 srl a1,a1,0x10 + a4: 00000097 auipc ra,0x0 + a8: 000080e7 jalr ra # a4 <.LVL22+0x6> + +000000ac <.LVL23>: + ac: 4722 lw a4,8(sp) + ae: c22a sw a0,4(sp) + +000000b0 <.LVL24>: + b0: 0104d593 srl a1,s1,0x10 + b4: 853a mv a0,a4 + +000000b6 <.L82>: + b6: 00000097 auipc ra,0x0 + ba: 000080e7 jalr ra # b6 <.L82> + +000000be <.LVL26>: + be: 4692 lw a3,4(sp) + c0: 0542 sll a0,a0,0x10 + c2: 01045713 srl a4,s0,0x10 + c6: 8f49 or a4,a4,a0 + +000000c8 <.LVL27>: + c8: 00d77863 bgeu a4,a3,d8 <.L26> + cc: 9726 add a4,a4,s1 + ce: 00976563 bltu a4,s1,d8 <.L26> + d2: 00d77363 bgeu a4,a3,d8 <.L26> + d6: 9726 add a4,a4,s1 + +000000d8 <.L26>: + d8: 40d707b3 sub a5,a4,a3 + dc: 853e mv a0,a5 + de: 0104d593 srl a1,s1,0x10 + e2: c23e sw a5,4(sp) + +000000e4 <.LVL31>: + e4: 00000097 auipc ra,0x0 + e8: 000080e7 jalr ra # e4 <.LVL31> + +000000ec <.LVL32>: + ec: 01049593 sll a1,s1,0x10 + f0: 81c1 srl a1,a1,0x10 + f2: 00000097 auipc ra,0x0 + f6: 000080e7 jalr ra # f2 <.LVL32+0x6> + +000000fa <.LVL33>: + fa: c42a sw a0,8(sp) + +000000fc <.LVL34>: + fc: 4512 lw a0,4(sp) + +000000fe <.LVL35>: + fe: 0104d593 srl a1,s1,0x10 + 102: 0442 sll s0,s0,0x10 + 104: 00000097 auipc ra,0x0 + 108: 000080e7 jalr ra # 104 <.LVL35+0x6> + +0000010c <.LVL36>: + 10c: 4722 lw a4,8(sp) + 10e: 0542 sll a0,a0,0x10 + 110: 8041 srl s0,s0,0x10 + 112: 8c49 or s0,s0,a0 + +00000114 <.LVL37>: + 114: 00e47863 bgeu s0,a4,124 <.L29> + +00000118 <.LVL38>: + 118: 9426 add s0,s0,s1 + 11a: 00946563 bltu s0,s1,124 <.L29> + 11e: 00e47363 bgeu s0,a4,124 <.L29> + +00000122 <.LVL40>: + 122: 9426 add s0,s0,s1 + +00000124 <.L29>: + 124: 4782 lw a5,0(sp) + +00000126 <.LBB25>: + 126: 8c19 sub s0,s0,a4 + +00000128 <.LBE25>: + 128: 4581 li a1,0 + 12a: 00f45533 srl a0,s0,a5 + +0000012e <.L32>: + 12e: 47c2 lw a5,16(sp) + 130: cb81 beqz a5,140 <.L1> + 132: 00a037b3 snez a5,a0 + 136: 40b005b3 neg a1,a1 + +0000013a <.LVL44>: + 13a: 8d9d sub a1,a1,a5 + 13c: 40a00533 neg a0,a0 + +00000140 <.L1>: + 140: 50d2 lw ra,52(sp) + 142: 5442 lw s0,48(sp) + 144: 54b2 lw s1,44(sp) + 146: 03810113 add sp,sp,56 + +0000014a <.LVL47>: + 14a: 8082 ret + +0000014c <.L6>: + 14c: 010002b7 lui t0,0x1000 + 150: 46c1 li a3,16 + 152: f05664e3 bltu a2,t0,5a <.L7> + 156: 46e1 li a3,24 + 158: b709 j 5a <.L7> + +0000015a <.L5>: + 15a: 4701 li a4,0 + +0000015c <.LBE27>: + 15c: ca09 beqz a2,16e <.L16> + +0000015e <.LBB28>: + 15e: 6741 lui a4,0x10 + 160: 04e67f63 bgeu a2,a4,1be <.L17> + +00000164 <.LVL51>: + 164: 10063713 sltiu a4,a2,256 + 168: 00174713 xor a4,a4,1 + 16c: 070e sll a4,a4,0x3 + +0000016e <.L16>: + 16e: 00e656b3 srl a3,a2,a4 + 172: 969a add a3,a3,t1 + 174: 0006c683 lbu a3,0(a3) # 10000 <.LLST68+0xf454> + 178: 9736 add a4,a4,a3 + +0000017a <.LVL53>: + 17a: 02000693 li a3,32 + 17e: 40e687b3 sub a5,a3,a4 + 182: c03e sw a5,0(sp) + +00000184 <.LBE28>: + 184: 04e69463 bne a3,a4,1cc <.L18> + 188: 40c58633 sub a2,a1,a2 + +0000018c <.L19>: + 18c: 01049793 sll a5,s1,0x10 + 190: 83c1 srl a5,a5,0x10 + 192: 8532 mv a0,a2 + 194: 0104d593 srl a1,s1,0x10 + 198: c432 sw a2,8(sp) + 19a: c23e sw a5,4(sp) + +0000019c <.LVL56>: + 19c: 00000097 auipc ra,0x0 + 1a0: 000080e7 jalr ra # 19c <.LVL56> + +000001a4 <.LVL57>: + 1a4: 01049593 sll a1,s1,0x10 + 1a8: 81c1 srl a1,a1,0x10 + 1aa: 00000097 auipc ra,0x0 + 1ae: 000080e7 jalr ra # 1aa <.LVL57+0x6> + +000001b2 <.LVL58>: + 1b2: 4622 lw a2,8(sp) + 1b4: c22a sw a0,4(sp) + +000001b6 <.LVL59>: + 1b6: 0104d593 srl a1,s1,0x10 + 1ba: 8532 mv a0,a2 + +000001bc <.LVL60>: + 1bc: bded j b6 <.L82> + +000001be <.L17>: + 1be: 010006b7 lui a3,0x1000 + 1c2: 4741 li a4,16 + 1c4: fad665e3 bltu a2,a3,16e <.L16> + 1c8: 4761 li a4,24 + 1ca: b755 j 16e <.L16> + +000001cc <.L18>: + 1cc: 4782 lw a5,0(sp) + +000001ce <.LVL63>: + 1ce: 00f614b3 sll s1,a2,a5 + +000001d2 <.LVL64>: + 1d2: 00e5d7b3 srl a5,a1,a4 + 1d6: c23e sw a5,4(sp) + +000001d8 <.LVL65>: + 1d8: 4782 lw a5,0(sp) + +000001da <.LVL66>: + 1da: 00e55733 srl a4,a0,a4 + +000001de <.LVL67>: + 1de: 00f595b3 sll a1,a1,a5 + 1e2: 00b767b3 or a5,a4,a1 + 1e6: c43e sw a5,8(sp) + +000001e8 <.LVL68>: + 1e8: 4782 lw a5,0(sp) + +000001ea <.LBB31>: + 1ea: 0104d593 srl a1,s1,0x10 + +000001ee <.LBE31>: + 1ee: 00f51433 sll s0,a0,a5 + +000001f2 <.LBB32>: + 1f2: 4512 lw a0,4(sp) + +000001f4 <.LVL71>: + 1f4: 01049793 sll a5,s1,0x10 + 1f8: 83c1 srl a5,a5,0x10 + 1fa: c63e sw a5,12(sp) + +000001fc <.LVL72>: + 1fc: 00000097 auipc ra,0x0 + 200: 000080e7 jalr ra # 1fc <.LVL72> + +00000204 <.LVL73>: + 204: 01049593 sll a1,s1,0x10 + 208: 81c1 srl a1,a1,0x10 + 20a: 00000097 auipc ra,0x0 + 20e: 000080e7 jalr ra # 20a <.LVL73+0x6> + +00000212 <.LVL74>: + 212: c62a sw a0,12(sp) + +00000214 <.LVL75>: + 214: 4512 lw a0,4(sp) + +00000216 <.LVL76>: + 216: 0104d593 srl a1,s1,0x10 + 21a: 00000097 auipc ra,0x0 + 21e: 000080e7 jalr ra # 21a <.LVL76+0x4> + +00000222 <.LVL77>: + 222: 47a2 lw a5,8(sp) + 224: 46b2 lw a3,12(sp) + 226: 0542 sll a0,a0,0x10 + 228: 0107d713 srl a4,a5,0x10 + 22c: 8f49 or a4,a4,a0 + +0000022e <.LVL78>: + 22e: 00d77863 bgeu a4,a3,23e <.L20> + +00000232 <.LVL79>: + 232: 9726 add a4,a4,s1 + 234: 00976563 bltu a4,s1,23e <.L20> + 238: 00d77363 bgeu a4,a3,23e <.L20> + +0000023c <.LVL81>: + 23c: 9726 add a4,a4,s1 + +0000023e <.L20>: + 23e: 40d707b3 sub a5,a4,a3 + 242: 853e mv a0,a5 + 244: 0104d593 srl a1,s1,0x10 + 248: c23e sw a5,4(sp) + +0000024a <.LVL83>: + 24a: 00000097 auipc ra,0x0 + 24e: 000080e7 jalr ra # 24a <.LVL83> + +00000252 <.LVL84>: + 252: 01049593 sll a1,s1,0x10 + 256: 81c1 srl a1,a1,0x10 + 258: 00000097 auipc ra,0x0 + 25c: 000080e7 jalr ra # 258 <.LVL84+0x6> + +00000260 <.LVL85>: + 260: c62a sw a0,12(sp) + +00000262 <.LVL86>: + 262: 4512 lw a0,4(sp) + +00000264 <.LVL87>: + 264: 0104d593 srl a1,s1,0x10 + 268: 00000097 auipc ra,0x0 + 26c: 000080e7 jalr ra # 268 <.LVL87+0x4> + +00000270 <.LVL88>: + 270: 00815603 lhu a2,8(sp) + 274: 4732 lw a4,12(sp) + 276: 0542 sll a0,a0,0x10 + 278: 8e49 or a2,a2,a0 + +0000027a <.LVL89>: + 27a: 00e67863 bgeu a2,a4,28a <.L23> + 27e: 9626 add a2,a2,s1 + 280: 00966563 bltu a2,s1,28a <.L23> + 284: 00e67363 bgeu a2,a4,28a <.L23> + 288: 9626 add a2,a2,s1 + +0000028a <.L23>: + 28a: 8e19 sub a2,a2,a4 + +0000028c <.LVL92>: + 28c: b701 j 18c <.L19> + +0000028e <.L4>: + 28e: ead5e0e3 bltu a1,a3,12e <.L32> + +00000292 <.LBB33>: + 292: 67c1 lui a5,0x10 + 294: 04f6f863 bgeu a3,a5,2e4 <.L34> + 298: 1006b793 sltiu a5,a3,256 + 29c: 0017c793 xor a5,a5,1 + 2a0: 078e sll a5,a5,0x3 + +000002a2 <.L35>: + 2a2: 00000337 lui t1,0x0 + 2a6: 00f6d2b3 srl t0,a3,a5 + 2aa: 00030313 mv t1,t1 + 2ae: 9316 add t1,t1,t0 + 2b0: 00034283 lbu t0,0(t1) # 0 <__moddi3> + 2b4: 92be add t0,t0,a5 + 2b6: 02000793 li a5,32 + +000002ba <.LVL96>: + 2ba: 405784b3 sub s1,a5,t0 + +000002be <.LVL97>: + 2be: c026 sw s1,0(sp) + +000002c0 <.LBE33>: + 2c0: 02579963 bne a5,t0,2f2 <.L36> + 2c4: 00b6e463 bltu a3,a1,2cc <.L37> + 2c8: 00c56b63 bltu a0,a2,2de <.L38> + +000002cc <.L37>: + 2cc: 40c50633 sub a2,a0,a2 + +000002d0 <.LVL100>: + 2d0: 40d586b3 sub a3,a1,a3 + +000002d4 <.LVL101>: + 2d4: 00c53733 sltu a4,a0,a2 + 2d8: 8432 mv s0,a2 + +000002da <.LVL102>: + 2da: 40e68733 sub a4,a3,a4 + +000002de <.L38>: + 2de: 8522 mv a0,s0 + 2e0: 85ba mv a1,a4 + 2e2: b5b1 j 12e <.L32> + +000002e4 <.L34>: + 2e4: 01000337 lui t1,0x1000 + 2e8: 47c1 li a5,16 + 2ea: fa66ece3 bltu a3,t1,2a2 <.L35> + 2ee: 47e1 li a5,24 + 2f0: bf4d j 2a2 <.L35> + +000002f2 <.L36>: + 2f2: 4782 lw a5,0(sp) + 2f4: 0055d4b3 srl s1,a1,t0 + +000002f8 <.LVL107>: + 2f8: 00565333 srl t1,a2,t0 + 2fc: 00f696b3 sll a3,a3,a5 + +00000300 <.LVL108>: + 300: 00f617b3 sll a5,a2,a5 + 304: c43e sw a5,8(sp) + 306: 4782 lw a5,0(sp) + 308: 00d36333 or t1,t1,a3 + +0000030c <.LVL109>: + 30c: d416 sw t0,40(sp) + 30e: 00f595b3 sll a1,a1,a5 + 312: 005557b3 srl a5,a0,t0 + 316: 8fcd or a5,a5,a1 + 318: ca3e sw a5,20(sp) + +0000031a <.LVL110>: + 31a: 4782 lw a5,0(sp) + +0000031c <.LBB37>: + 31c: d21a sw t1,36(sp) + +0000031e <.LBE37>: + 31e: 00f517b3 sll a5,a0,a5 + 322: c63e sw a5,12(sp) + +00000324 <.LBB38>: + 324: 01035793 srl a5,t1,0x10 + +00000328 <.LVL113>: + 328: c23e sw a5,4(sp) + +0000032a <.LVL114>: + 32a: 4592 lw a1,4(sp) + 32c: 01031793 sll a5,t1,0x10 + +00000330 <.LVL115>: + 330: 83c1 srl a5,a5,0x10 + 332: 8526 mv a0,s1 + 334: cc3e sw a5,24(sp) + +00000336 <.LVL116>: + 336: 00000097 auipc ra,0x0 + 33a: 000080e7 jalr ra # 336 <.LVL116> + +0000033e <.LVL117>: + 33e: 85aa mv a1,a0 + 340: d02a sw a0,32(sp) + 342: 4562 lw a0,24(sp) + +00000344 <.LVL118>: + 344: 00000097 auipc ra,0x0 + 348: 000080e7 jalr ra # 344 <.LVL118> + +0000034c <.LVL119>: + 34c: 4592 lw a1,4(sp) + 34e: ce2a sw a0,28(sp) + +00000350 <.LVL120>: + 350: 8526 mv a0,s1 + +00000352 <.LVL121>: + 352: 00000097 auipc ra,0x0 + 356: 000080e7 jalr ra # 352 <.LVL121> + +0000035a <.LVL122>: + 35a: 47d2 lw a5,20(sp) + 35c: 5682 lw a3,32(sp) + 35e: 0542 sll a0,a0,0x10 + 360: 0107d493 srl s1,a5,0x10 + +00000364 <.LVL123>: + 364: 47f2 lw a5,28(sp) + 366: 8cc9 or s1,s1,a0 + +00000368 <.LVL124>: + 368: 5312 lw t1,36(sp) + 36a: 52a2 lw t0,40(sp) + 36c: 8436 mv s0,a3 + 36e: 00f4fc63 bgeu s1,a5,386 <.L41> + +00000372 <.LVL125>: + 372: 949a add s1,s1,t1 + +00000374 <.LVL126>: + 374: fff68413 add s0,a3,-1 # ffffff <.LLST68+0xfff453> + +00000378 <.LVL127>: + 378: 0064e763 bltu s1,t1,386 <.L41> + 37c: 00f4f563 bgeu s1,a5,386 <.L41> + 380: ffe68413 add s0,a3,-2 + 384: 949a add s1,s1,t1 + +00000386 <.L41>: + 386: 4592 lw a1,4(sp) + 388: 40f487b3 sub a5,s1,a5 + 38c: 853e mv a0,a5 + 38e: d41a sw t1,40(sp) + 390: d216 sw t0,36(sp) + +00000392 <.LVL130>: + 392: ce3e sw a5,28(sp) + +00000394 <.LVL131>: + 394: 00000097 auipc ra,0x0 + 398: 000080e7 jalr ra # 394 <.LVL131> + +0000039c <.LVL132>: + 39c: 85aa mv a1,a0 + 39e: d02a sw a0,32(sp) + 3a0: 4562 lw a0,24(sp) + +000003a2 <.LVL133>: + 3a2: 00000097 auipc ra,0x0 + 3a6: 000080e7 jalr ra # 3a2 <.LVL133> + +000003aa <.LVL134>: + 3aa: 4592 lw a1,4(sp) + 3ac: 84aa mv s1,a0 + +000003ae <.LVL135>: + 3ae: 4572 lw a0,28(sp) + 3b0: 00000097 auipc ra,0x0 + 3b4: 000080e7 jalr ra # 3b0 <.LVL135+0x2> + +000003b8 <.LVL136>: + 3b8: 01415603 lhu a2,20(sp) + 3bc: 5682 lw a3,32(sp) + 3be: 0542 sll a0,a0,0x10 + 3c0: 8e49 or a2,a2,a0 + +000003c2 <.LVL137>: + 3c2: 5292 lw t0,36(sp) + 3c4: 5322 lw t1,40(sp) + 3c6: 85b6 mv a1,a3 + 3c8: 00967c63 bgeu a2,s1,3e0 <.L44> + +000003cc <.LVL138>: + 3cc: 961a add a2,a2,t1 + +000003ce <.LVL139>: + 3ce: fff68593 add a1,a3,-1 + +000003d2 <.LVL140>: + 3d2: 00666763 bltu a2,t1,3e0 <.L44> + 3d6: 00967563 bgeu a2,s1,3e0 <.L44> + 3da: ffe68593 add a1,a3,-2 + 3de: 961a add a2,a2,t1 + +000003e0 <.L44>: + 3e0: 46a2 lw a3,8(sp) + +000003e2 <.LBB44>: + 3e2: 01041713 sll a4,s0,0x10 + +000003e6 <.LBB45>: + 3e6: 67c1 lui a5,0x10 + +000003e8 <.LBB46>: + 3e8: 8f4d or a4,a4,a1 + +000003ea <.LBB47>: + 3ea: fff78413 add s0,a5,-1 # ffff <.LLST68+0xf453> + +000003ee <.LVL143>: + 3ee: 008777b3 and a5,a4,s0 + 3f2: 8c75 and s0,s0,a3 + +000003f4 <.LBB48>: + 3f4: 409603b3 sub t2,a2,s1 + +000003f8 <.LBB49>: + 3f8: 8341 srl a4,a4,0x10 + +000003fa <.LVL145>: + 3fa: 0106d493 srl s1,a3,0x10 + +000003fe <.LBB40>: + 3fe: 853e mv a0,a5 + 400: 85a2 mv a1,s0 + +00000402 <.LVL147>: + 402: 00000097 auipc ra,0x0 + 406: 000080e7 jalr ra # 402 <.LVL147> + 40a: c22a sw a0,4(sp) + +0000040c <.LBB41>: + 40c: 85a6 mv a1,s1 + 40e: 853e mv a0,a5 + +00000410 <.LVL149>: + 410: 00000097 auipc ra,0x0 + 414: 000080e7 jalr ra # 410 <.LVL149> + 418: 87aa mv a5,a0 + +0000041a <.LBB42>: + 41a: 85a2 mv a1,s0 + 41c: 853a mv a0,a4 + +0000041e <.LVL151>: + 41e: 00000097 auipc ra,0x0 + 422: 000080e7 jalr ra # 41e <.LVL151> + 426: 842a mv s0,a0 + +00000428 <.LBB43>: + 428: 85a6 mv a1,s1 + 42a: 853a mv a0,a4 + 42c: 00000097 auipc ra,0x0 + 430: 000080e7 jalr ra # 42c <.LBB43+0x4> + +00000434 <.LBE43>: + 434: 4692 lw a3,4(sp) + 436: 97a2 add a5,a5,s0 + +00000438 <.LVL154>: + 438: 0106d713 srl a4,a3,0x10 + +0000043c <.LVL155>: + 43c: 97ba add a5,a5,a4 + +0000043e <.LVL156>: + 43e: 0087f463 bgeu a5,s0,446 <.L47> + 442: 6741 lui a4,0x10 + +00000444 <.LVL157>: + 444: 953a add a0,a0,a4 + +00000446 <.L47>: + 446: 0107d713 srl a4,a5,0x10 + 44a: 953a add a0,a0,a4 + +0000044c <.LVL159>: + 44c: 6741 lui a4,0x10 + +0000044e <.LVL160>: + 44e: 177d add a4,a4,-1 # ffff <.LLST68+0xf453> + +00000450 <.LVL161>: + 450: 00e7f433 and s0,a5,a4 + +00000454 <.LVL162>: + 454: 4792 lw a5,4(sp) + +00000456 <.LVL163>: + 456: 0442 sll s0,s0,0x10 + 458: 8ff9 and a5,a5,a4 + 45a: 943e add s0,s0,a5 + +0000045c <.LBE49>: + 45c: 00a3e763 bltu t2,a0,46a <.L48> + 460: 00a39e63 bne t2,a0,47c <.L49> + 464: 47b2 lw a5,12(sp) + 466: 0087fb63 bgeu a5,s0,47c <.L49> + +0000046a <.L48>: + 46a: 47a2 lw a5,8(sp) + 46c: 40f407b3 sub a5,s0,a5 + 470: 00f43733 sltu a4,s0,a5 + +00000474 <.LVL165>: + 474: 843e mv s0,a5 + +00000476 <.LVL166>: + 476: 006707b3 add a5,a4,t1 + 47a: 8d1d sub a0,a0,a5 + +0000047c <.L49>: + 47c: 47b2 lw a5,12(sp) + 47e: 40a385b3 sub a1,t2,a0 + 482: 40878433 sub s0,a5,s0 + +00000486 <.LVL168>: + 486: 0087b7b3 sltu a5,a5,s0 + 48a: 8d9d sub a1,a1,a5 + +0000048c <.LBE51>: + 48c: 4782 lw a5,0(sp) + 48e: 005592b3 sll t0,a1,t0 + +00000492 <.LVL170>: + 492: 00f45433 srl s0,s0,a5 + +00000496 <.LVL171>: + 496: 0082e533 or a0,t0,s0 + +0000049a <.LVL172>: + 49a: 00f5d5b3 srl a1,a1,a5 + +0000049e <.LVL173>: + 49e: b941 j 12e <.L32> + +_divmoddi4.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__divmoddi4>: + 0: 7139 add sp,sp,-64 + 2: de06 sw ra,60(sp) + 4: dc22 sw s0,56(sp) + 6: da26 sw s1,52(sp) + 8: d23a sw a4,36(sp) + a: c402 sw zero,8(sp) + c: 0005db63 bgez a1,22 <.L2> + +00000010 <.LVL1>: + 10: 00a037b3 snez a5,a0 + 14: 40b005b3 neg a1,a1 + 18: 8d9d sub a1,a1,a5 + 1a: 57fd li a5,-1 + 1c: 40a00533 neg a0,a0 + +00000020 <.LVL2>: + 20: c43e sw a5,8(sp) + +00000022 <.L2>: + 22: 47a2 lw a5,8(sp) + 24: ca3e sw a5,20(sp) + 26: 0006dc63 bgez a3,3e <.L3> + 2a: fff7c793 not a5,a5 + 2e: ca3e sw a5,20(sp) + +00000030 <.LVL4>: + 30: 40d006b3 neg a3,a3 + 34: 00c037b3 snez a5,a2 + +00000038 <.LVL6>: + 38: 8e9d sub a3,a3,a5 + 3a: 40c00633 neg a2,a2 + +0000003e <.L3>: + 3e: c636 sw a3,12(sp) + 40: c02a sw a0,0(sp) + 42: 84b2 mv s1,a2 + +00000044 <.LVL9>: + 44: 842e mv s0,a1 + 46: 28069663 bnez a3,2d2 <.L4> + +0000004a <.LVL11>: + 4a: 00000737 lui a4,0x0 + +0000004e <.LVL12>: + 4e: 00070713 mv a4,a4 + 52: 14c5fb63 bgeu a1,a2,1a8 <.L5> + +00000056 <.LBB22>: + 56: 67c1 lui a5,0x10 + 58: 14f67163 bgeu a2,a5,19a <.L6> + 5c: 10063793 sltiu a5,a2,256 + 60: 0017c793 xor a5,a5,1 + 64: 078e sll a5,a5,0x3 + +00000066 <.L7>: + 66: 00f656b3 srl a3,a2,a5 + 6a: 9736 add a4,a4,a3 + 6c: 00074703 lbu a4,0(a4) # 0 <__divmoddi4> + 70: 97ba add a5,a5,a4 + +00000072 <.LVL15>: + 72: 02000713 li a4,32 + 76: 40f706b3 sub a3,a4,a5 + 7a: c236 sw a3,4(sp) + +0000007c <.LBE22>: + 7c: 00f70c63 beq a4,a5,94 <.L95> + 80: 00f557b3 srl a5,a0,a5 + 84: 00d59433 sll s0,a1,a3 + 88: 8c5d or s0,s0,a5 + 8a: 00d517b3 sll a5,a0,a3 + 8e: 00d614b3 sll s1,a2,a3 + +00000092 <.LVL17>: + 92: c03e sw a5,0(sp) + +00000094 <.L95>: + 94: 01049793 sll a5,s1,0x10 + 98: 83c1 srl a5,a5,0x10 + 9a: 0104d593 srl a1,s1,0x10 + 9e: 8522 mv a0,s0 + a0: c83e sw a5,16(sp) + +000000a2 <.LVL19>: + a2: 00000097 auipc ra,0x0 + a6: 000080e7 jalr ra # a2 <.LVL19> + +000000aa <.LVL20>: + aa: 85aa mv a1,a0 + ac: cc2a sw a0,24(sp) + ae: 01049513 sll a0,s1,0x10 + +000000b2 <.LVL21>: + b2: 8141 srl a0,a0,0x10 + b4: 00000097 auipc ra,0x0 + b8: 000080e7 jalr ra # b4 <.LVL21+0x2> + +000000bc <.LVL22>: + bc: c82a sw a0,16(sp) + +000000be <.LVL23>: + be: 0104d593 srl a1,s1,0x10 + c2: 8522 mv a0,s0 + +000000c4 <.LVL24>: + c4: 00000097 auipc ra,0x0 + c8: 000080e7 jalr ra # c4 <.LVL24> + +000000cc <.LVL25>: + cc: 4782 lw a5,0(sp) + ce: 46e2 lw a3,24(sp) + d0: 4742 lw a4,16(sp) + d2: 0107d413 srl s0,a5,0x10 + +000000d6 <.LVL26>: + d6: 0542 sll a0,a0,0x10 + d8: 8c49 or s0,s0,a0 + +000000da <.LVL27>: + da: 87b6 mv a5,a3 + dc: 00e47c63 bgeu s0,a4,f4 <.L26> + e0: 9426 add s0,s0,s1 + +000000e2 <.LVL28>: + e2: fff68793 add a5,a3,-1 + +000000e6 <.LVL29>: + e6: 00946763 bltu s0,s1,f4 <.L26> + ea: 00e47563 bgeu s0,a4,f4 <.L26> + ee: ffe68793 add a5,a3,-2 + f2: 9426 add s0,s0,s1 + +000000f4 <.L26>: + f4: ce3e sw a5,28(sp) + +000000f6 <.LVL32>: + f6: 40e407b3 sub a5,s0,a4 + fa: 853e mv a0,a5 + fc: 0104d593 srl a1,s1,0x10 + 100: c83e sw a5,16(sp) + +00000102 <.LVL33>: + 102: 00000097 auipc ra,0x0 + 106: 000080e7 jalr ra # 102 <.LVL33> + +0000010a <.LVL34>: + 10a: 85aa mv a1,a0 + 10c: cc2a sw a0,24(sp) + 10e: 01049513 sll a0,s1,0x10 + +00000112 <.LVL35>: + 112: 8141 srl a0,a0,0x10 + 114: 00000097 auipc ra,0x0 + 118: 000080e7 jalr ra # 114 <.LVL35+0x2> + +0000011c <.LVL36>: + 11c: 842a mv s0,a0 + +0000011e <.LVL37>: + 11e: 4542 lw a0,16(sp) + 120: 0104d593 srl a1,s1,0x10 + 124: 00000097 auipc ra,0x0 + 128: 000080e7 jalr ra # 124 <.LVL37+0x6> + +0000012c <.LVL38>: + 12c: 00015703 lhu a4,0(sp) + 130: 4662 lw a2,24(sp) + 132: 0542 sll a0,a0,0x10 + 134: 8f49 or a4,a4,a0 + +00000136 <.LVL39>: + 136: 47f2 lw a5,28(sp) + 138: 85b2 mv a1,a2 + 13a: 00877c63 bgeu a4,s0,152 <.L29> + 13e: 9726 add a4,a4,s1 + +00000140 <.LVL40>: + 140: fff60593 add a1,a2,-1 + +00000144 <.LVL41>: + 144: 00976763 bltu a4,s1,152 <.L29> + 148: 00877563 bgeu a4,s0,152 <.L29> + 14c: ffe60593 add a1,a2,-2 + 150: 9726 add a4,a4,s1 + +00000152 <.L29>: + 152: 4692 lw a3,4(sp) + 154: 44b2 lw s1,12(sp) + +00000156 <.LBB26>: + 156: 8f01 sub a4,a4,s0 + 158: 07c2 sll a5,a5,0x10 + 15a: 8fcd or a5,a5,a1 + +0000015c <.LBE26>: + 15c: 00d75733 srl a4,a4,a3 + +00000160 <.LVL47>: + 160: 4401 li s0,0 + +00000162 <.L32>: + 162: 853e mv a0,a5 + +00000164 <.LBE20>: + 164: 47d2 lw a5,20(sp) + +00000166 <.LBB52>: + 166: 85a6 mv a1,s1 + +00000168 <.LBE52>: + 168: cb81 beqz a5,178 <.L54> + 16a: 00a037b3 snez a5,a0 + 16e: 409005b3 neg a1,s1 + 172: 8d9d sub a1,a1,a5 + 174: 40a00533 neg a0,a0 + +00000178 <.L54>: + 178: 47a2 lw a5,8(sp) + 17a: cb81 beqz a5,18a <.L55> + 17c: 00e037b3 snez a5,a4 + 180: 40800433 neg s0,s0 + +00000184 <.LVL52>: + 184: 8c1d sub s0,s0,a5 + 186: 40e00733 neg a4,a4 + +0000018a <.L55>: + 18a: 5792 lw a5,36(sp) + 18c: 50f2 lw ra,60(sp) + 18e: 54d2 lw s1,52(sp) + 190: c3c0 sw s0,4(a5) + +00000192 <.LVL55>: + 192: 5462 lw s0,56(sp) + 194: c398 sw a4,0(a5) + 196: 6121 add sp,sp,64 + +00000198 <.LVL56>: + 198: 8082 ret + +0000019a <.L6>: + 19a: 010006b7 lui a3,0x1000 + +0000019e <.LVL58>: + 19e: 47c1 li a5,16 + 1a0: ecd663e3 bltu a2,a3,66 <.L7> + 1a4: 47e1 li a5,24 + 1a6: b5c1 j 66 <.L7> + +000001a8 <.L5>: + 1a8: 4781 li a5,0 + +000001aa <.LBE28>: + 1aa: ca09 beqz a2,1bc <.L16> + +000001ac <.LBB29>: + 1ac: 67c1 lui a5,0x10 + 1ae: 02f67963 bgeu a2,a5,1e0 <.L17> + +000001b2 <.LVL61>: + 1b2: 10063793 sltiu a5,a2,256 + 1b6: 0017c793 xor a5,a5,1 + 1ba: 078e sll a5,a5,0x3 + +000001bc <.L16>: + 1bc: 00f656b3 srl a3,a2,a5 + 1c0: 9736 add a4,a4,a3 + 1c2: 00074703 lbu a4,0(a4) + 1c6: 97ba add a5,a5,a4 + +000001c8 <.LVL63>: + 1c8: 02000713 li a4,32 + 1cc: 40f706b3 sub a3,a4,a5 + 1d0: c236 sw a3,4(sp) + +000001d2 <.LBE29>: + 1d2: 00f71e63 bne a4,a5,1ee <.L18> + 1d6: 40c58433 sub s0,a1,a2 + +000001da <.LVL65>: + 1da: 4785 li a5,1 + +000001dc <.L82>: + 1dc: c63e sw a5,12(sp) + 1de: bd5d j 94 <.L95> + +000001e0 <.L17>: + 1e0: 010006b7 lui a3,0x1000 + +000001e4 <.LVL68>: + 1e4: 47c1 li a5,16 + 1e6: fcd66be3 bltu a2,a3,1bc <.L16> + 1ea: 47e1 li a5,24 + 1ec: bfc1 j 1bc <.L16> + +000001ee <.L18>: + 1ee: 4712 lw a4,4(sp) + 1f0: 00f5d433 srl s0,a1,a5 + 1f4: 00f557b3 srl a5,a0,a5 + +000001f8 <.LVL70>: + 1f8: 00e595b3 sll a1,a1,a4 + 1fc: 8fcd or a5,a5,a1 + 1fe: 00e614b3 sll s1,a2,a4 + +00000202 <.LVL71>: + 202: c63e sw a5,12(sp) + +00000204 <.LVL72>: + 204: 00e517b3 sll a5,a0,a4 + +00000208 <.LVL73>: + 208: c03e sw a5,0(sp) + +0000020a <.LBB32>: + 20a: 01049793 sll a5,s1,0x10 + 20e: 83c1 srl a5,a5,0x10 + 210: 0104d593 srl a1,s1,0x10 + 214: 8522 mv a0,s0 + +00000216 <.LVL75>: + 216: c83e sw a5,16(sp) + +00000218 <.LVL76>: + 218: 00000097 auipc ra,0x0 + 21c: 000080e7 jalr ra # 218 <.LVL76> + +00000220 <.LVL77>: + 220: 85aa mv a1,a0 + 222: cc2a sw a0,24(sp) + 224: 01049513 sll a0,s1,0x10 + +00000228 <.LVL78>: + 228: 8141 srl a0,a0,0x10 + 22a: 00000097 auipc ra,0x0 + 22e: 000080e7 jalr ra # 22a <.LVL78+0x2> + +00000232 <.LVL79>: + 232: c82a sw a0,16(sp) + +00000234 <.LVL80>: + 234: 0104d593 srl a1,s1,0x10 + 238: 8522 mv a0,s0 + +0000023a <.LVL81>: + 23a: 00000097 auipc ra,0x0 + 23e: 000080e7 jalr ra # 23a <.LVL81> + +00000242 <.LVL82>: + 242: 47b2 lw a5,12(sp) + 244: 46e2 lw a3,24(sp) + 246: 4742 lw a4,16(sp) + 248: 0107d413 srl s0,a5,0x10 + +0000024c <.LVL83>: + 24c: 0542 sll a0,a0,0x10 + 24e: 8c49 or s0,s0,a0 + +00000250 <.LVL84>: + 250: 87b6 mv a5,a3 + 252: 00e47c63 bgeu s0,a4,26a <.L20> + 256: 9426 add s0,s0,s1 + +00000258 <.LVL85>: + 258: fff68793 add a5,a3,-1 # ffffff <.LLST64+0xfff13e> + +0000025c <.LVL86>: + 25c: 00946763 bltu s0,s1,26a <.L20> + 260: 00e47563 bgeu s0,a4,26a <.L20> + 264: ffe68793 add a5,a3,-2 + 268: 9426 add s0,s0,s1 + +0000026a <.L20>: + 26a: ce3e sw a5,28(sp) + +0000026c <.LVL89>: + 26c: 40e407b3 sub a5,s0,a4 + 270: 853e mv a0,a5 + 272: 0104d593 srl a1,s1,0x10 + 276: c83e sw a5,16(sp) + +00000278 <.LVL90>: + 278: 00000097 auipc ra,0x0 + 27c: 000080e7 jalr ra # 278 <.LVL90> + +00000280 <.LVL91>: + 280: 85aa mv a1,a0 + 282: cc2a sw a0,24(sp) + 284: 01049513 sll a0,s1,0x10 + +00000288 <.LVL92>: + 288: 8141 srl a0,a0,0x10 + 28a: 00000097 auipc ra,0x0 + 28e: 000080e7 jalr ra # 28a <.LVL92+0x2> + +00000292 <.LVL93>: + 292: 842a mv s0,a0 + +00000294 <.LVL94>: + 294: 4542 lw a0,16(sp) + 296: 0104d593 srl a1,s1,0x10 + 29a: 00000097 auipc ra,0x0 + 29e: 000080e7 jalr ra # 29a <.LVL94+0x6> + +000002a2 <.LVL95>: + 2a2: 00c15603 lhu a2,12(sp) + 2a6: 46e2 lw a3,24(sp) + 2a8: 0542 sll a0,a0,0x10 + 2aa: 8e49 or a2,a2,a0 + +000002ac <.LVL96>: + 2ac: 47f2 lw a5,28(sp) + 2ae: 85b6 mv a1,a3 + 2b0: 00867c63 bgeu a2,s0,2c8 <.L23> + 2b4: 9626 add a2,a2,s1 + +000002b6 <.LVL97>: + 2b6: fff68593 add a1,a3,-1 + +000002ba <.LVL98>: + 2ba: 00966763 bltu a2,s1,2c8 <.L23> + 2be: 00867563 bgeu a2,s0,2c8 <.L23> + 2c2: ffe68593 add a1,a3,-2 + 2c6: 9626 add a2,a2,s1 + +000002c8 <.L23>: + 2c8: 07c2 sll a5,a5,0x10 + 2ca: 40860433 sub s0,a2,s0 + +000002ce <.LVL101>: + 2ce: 8fcd or a5,a5,a1 + 2d0: b731 j 1dc <.L82> + +000002d2 <.L4>: + 2d2: 00d5f663 bgeu a1,a3,2de <.L33> + +000002d6 <.LVL103>: + 2d6: 872a mv a4,a0 + +000002d8 <.LVL104>: + 2d8: 4481 li s1,0 + +000002da <.LVL105>: + 2da: 4781 li a5,0 + 2dc: b559 j 162 <.L32> + +000002de <.L33>: + 2de: 67c1 lui a5,0x10 + 2e0: 04f6fa63 bgeu a3,a5,334 <.L34> + 2e4: 1006b793 sltiu a5,a3,256 + 2e8: 0017c793 xor a5,a5,1 + 2ec: 078e sll a5,a5,0x3 + +000002ee <.L35>: + 2ee: 00000737 lui a4,0x0 + 2f2: 00f6d333 srl t1,a3,a5 + 2f6: 00070713 mv a4,a4 + 2fa: 971a add a4,a4,t1 + 2fc: 00074703 lbu a4,0(a4) # 0 <__divmoddi4> + 300: 97ba add a5,a5,a4 + +00000302 <.LVL108>: + 302: c23e sw a5,4(sp) + 304: 4712 lw a4,4(sp) + 306: 02000793 li a5,32 + 30a: 40e784b3 sub s1,a5,a4 + +0000030e <.LBE33>: + 30e: 02e79a63 bne a5,a4,342 <.L36> + 312: 00b6e563 bltu a3,a1,31c <.L37> + 316: 4781 li a5,0 + 318: 00c56c63 bltu a0,a2,330 <.L38> + +0000031c <.L37>: + 31c: 40c50633 sub a2,a0,a2 + +00000320 <.LVL111>: + 320: 40d586b3 sub a3,a1,a3 + +00000324 <.LVL112>: + 324: 00c53433 sltu s0,a0,a2 + 328: c032 sw a2,0(sp) + +0000032a <.LVL113>: + 32a: 40868433 sub s0,a3,s0 + +0000032e <.LBE34>: + 32e: 4785 li a5,1 + +00000330 <.L38>: + 330: 4702 lw a4,0(sp) + 332: bd05 j 162 <.L32> + +00000334 <.L34>: + 334: 01000737 lui a4,0x1000 + +00000338 <.LVL118>: + 338: 47c1 li a5,16 + 33a: fae6eae3 bltu a3,a4,2ee <.L35> + 33e: 47e1 li a5,24 + 340: b77d j 2ee <.L35> + +00000342 <.L36>: + 342: 4792 lw a5,4(sp) + 344: 009696b3 sll a3,a3,s1 + +00000348 <.LVL120>: + 348: 00f657b3 srl a5,a2,a5 + 34c: 00d7e333 or t1,a5,a3 + +00000350 <.LVL121>: + 350: 009617b3 sll a5,a2,s1 + 354: c63e sw a5,12(sp) + +00000356 <.LVL122>: + 356: 4792 lw a5,4(sp) + +00000358 <.LBB37>: + 358: d61a sw t1,44(sp) + +0000035a <.LBE37>: + 35a: 00f5d433 srl s0,a1,a5 + +0000035e <.LVL124>: + 35e: 009595b3 sll a1,a1,s1 + 362: 00f557b3 srl a5,a0,a5 + 366: 8fcd or a5,a5,a1 + 368: cc3e sw a5,24(sp) + +0000036a <.LVL125>: + 36a: 009517b3 sll a5,a0,s1 + +0000036e <.LVL126>: + 36e: c83e sw a5,16(sp) + +00000370 <.LBB38>: + 370: 01035793 srl a5,t1,0x10 + +00000374 <.LVL128>: + 374: c03e sw a5,0(sp) + +00000376 <.LVL129>: + 376: 4582 lw a1,0(sp) + 378: 01031793 sll a5,t1,0x10 + +0000037c <.LVL130>: + 37c: 83c1 srl a5,a5,0x10 + 37e: 8522 mv a0,s0 + 380: ce3e sw a5,28(sp) + +00000382 <.LVL131>: + 382: 00000097 auipc ra,0x0 + 386: 000080e7 jalr ra # 382 <.LVL131> + +0000038a <.LVL132>: + 38a: 85aa mv a1,a0 + 38c: d42a sw a0,40(sp) + 38e: 4572 lw a0,28(sp) + +00000390 <.LVL133>: + 390: 00000097 auipc ra,0x0 + 394: 000080e7 jalr ra # 390 <.LVL133> + +00000398 <.LVL134>: + 398: 4582 lw a1,0(sp) + 39a: d02a sw a0,32(sp) + +0000039c <.LVL135>: + 39c: 8522 mv a0,s0 + +0000039e <.LVL136>: + 39e: 00000097 auipc ra,0x0 + 3a2: 000080e7 jalr ra # 39e <.LVL136> + +000003a6 <.LVL137>: + 3a6: 47e2 lw a5,24(sp) + 3a8: 56a2 lw a3,40(sp) + 3aa: 5702 lw a4,32(sp) + 3ac: 0107d413 srl s0,a5,0x10 + +000003b0 <.LVL138>: + 3b0: 0542 sll a0,a0,0x10 + 3b2: 8c49 or s0,s0,a0 + +000003b4 <.LVL139>: + 3b4: 5332 lw t1,44(sp) + 3b6: 87b6 mv a5,a3 + 3b8: 00e47c63 bgeu s0,a4,3d0 <.L41> + 3bc: 941a add s0,s0,t1 + +000003be <.LVL140>: + 3be: fff68793 add a5,a3,-1 + +000003c2 <.LVL141>: + 3c2: 00646763 bltu s0,t1,3d0 <.L41> + 3c6: 00e47563 bgeu s0,a4,3d0 <.L41> + 3ca: ffe68793 add a5,a3,-2 + 3ce: 941a add s0,s0,t1 + +000003d0 <.L41>: + 3d0: 4582 lw a1,0(sp) + 3d2: d83e sw a5,48(sp) + 3d4: 40e407b3 sub a5,s0,a4 + +000003d8 <.LVL144>: + 3d8: 853e mv a0,a5 + 3da: d61a sw t1,44(sp) + +000003dc <.LVL145>: + 3dc: d03e sw a5,32(sp) + +000003de <.LVL146>: + 3de: 00000097 auipc ra,0x0 + 3e2: 000080e7 jalr ra # 3de <.LVL146> + +000003e6 <.LVL147>: + 3e6: 85aa mv a1,a0 + 3e8: d42a sw a0,40(sp) + 3ea: 4572 lw a0,28(sp) + +000003ec <.LVL148>: + 3ec: 00000097 auipc ra,0x0 + 3f0: 000080e7 jalr ra # 3ec <.LVL148> + +000003f4 <.LVL149>: + 3f4: 4582 lw a1,0(sp) + 3f6: 842a mv s0,a0 + +000003f8 <.LVL150>: + 3f8: 5502 lw a0,32(sp) + 3fa: 00000097 auipc ra,0x0 + 3fe: 000080e7 jalr ra # 3fa <.LVL150+0x2> + +00000402 <.LVL151>: + 402: 01815603 lhu a2,24(sp) + 406: 56a2 lw a3,40(sp) + 408: 0542 sll a0,a0,0x10 + 40a: 8e49 or a2,a2,a0 + +0000040c <.LVL152>: + 40c: 5332 lw t1,44(sp) + 40e: 57c2 lw a5,48(sp) + 410: 85b6 mv a1,a3 + 412: 00867c63 bgeu a2,s0,42a <.L44> + +00000416 <.LVL153>: + 416: 961a add a2,a2,t1 + +00000418 <.LVL154>: + 418: fff68593 add a1,a3,-1 + +0000041c <.LVL155>: + 41c: 00666763 bltu a2,t1,42a <.L44> + 420: 00867563 bgeu a2,s0,42a <.L44> + 424: ffe68593 add a1,a3,-2 + 428: 961a add a2,a2,t1 + +0000042a <.L44>: + 42a: 40860733 sub a4,a2,s0 + +0000042e <.LBB39>: + 42e: 4632 lw a2,12(sp) + +00000430 <.LBB44>: + 430: c03a sw a4,0(sp) + +00000432 <.LVL159>: + 432: 07c2 sll a5,a5,0x10 + +00000434 <.LBB45>: + 434: 6741 lui a4,0x10 + +00000436 <.LBB46>: + 436: 8fcd or a5,a5,a1 + +00000438 <.LBB47>: + 438: fff70393 add t2,a4,-1 # ffff <.LLST64+0xf13e> + 43c: 0077f733 and a4,a5,t2 + +00000440 <.LVL162>: + 440: 007673b3 and t2,a2,t2 + +00000444 <.LVL163>: + 444: 01065413 srl s0,a2,0x10 + +00000448 <.LBB40>: + 448: 853a mv a0,a4 + 44a: 859e mv a1,t2 + +0000044c <.LVL165>: + 44c: 00000097 auipc ra,0x0 + 450: 000080e7 jalr ra # 44c <.LVL165> + 454: 82aa mv t0,a0 + +00000456 <.LBB41>: + 456: 85a2 mv a1,s0 + 458: 853a mv a0,a4 + 45a: 00000097 auipc ra,0x0 + 45e: 000080e7 jalr ra # 45a <.LBB41+0x4> + 462: 872a mv a4,a0 + +00000464 <.LBB42>: + 464: 859e mv a1,t2 + 466: 0107d513 srl a0,a5,0x10 + +0000046a <.LVL168>: + 46a: 00000097 auipc ra,0x0 + 46e: 000080e7 jalr ra # 46a <.LVL168> + +00000472 <.LVL169>: + 472: 83aa mv t2,a0 + +00000474 <.LBB43>: + 474: 85a2 mv a1,s0 + 476: 0107d513 srl a0,a5,0x10 + +0000047a <.LVL171>: + 47a: 00000097 auipc ra,0x0 + 47e: 000080e7 jalr ra # 47a <.LVL171> + +00000482 <.LBE43>: + 482: 971e add a4,a4,t2 + +00000484 <.LVL173>: + 484: 0102d693 srl a3,t0,0x10 + 488: 9736 add a4,a4,a3 + +0000048a <.LVL174>: + 48a: 00777463 bgeu a4,t2,492 <.L47> + 48e: 66c1 lui a3,0x10 + +00000490 <.LVL175>: + 490: 9536 add a0,a0,a3 + +00000492 <.L47>: + 492: 01075693 srl a3,a4,0x10 + 496: 9536 add a0,a0,a3 + +00000498 <.LVL177>: + 498: 66c1 lui a3,0x10 + +0000049a <.LVL178>: + 49a: 16fd add a3,a3,-1 # ffff <.LLST64+0xf13e> + +0000049c <.LVL179>: + 49c: 8f75 and a4,a4,a3 + +0000049e <.LVL180>: + 49e: 0742 sll a4,a4,0x10 + 4a0: 00d2f2b3 and t0,t0,a3 + +000004a4 <.LVL181>: + 4a4: 92ba add t0,t0,a4 + +000004a6 <.LBE47>: + 4a6: 4702 lw a4,0(sp) + 4a8: 00a76763 bltu a4,a0,4b6 <.L48> + 4ac: 00a71f63 bne a4,a0,4ca <.L49> + 4b0: 4742 lw a4,16(sp) + 4b2: 00577c63 bgeu a4,t0,4ca <.L49> + +000004b6 <.L48>: + 4b6: 4732 lw a4,12(sp) + 4b8: 17fd add a5,a5,-1 # ffff <.LLST64+0xf13e> + +000004ba <.LBB48>: + 4ba: 40e28733 sub a4,t0,a4 + 4be: 00e2b6b3 sltu a3,t0,a4 + +000004c2 <.LVL184>: + 4c2: 82ba mv t0,a4 + +000004c4 <.LVL185>: + 4c4: 00668733 add a4,a3,t1 + 4c8: 8d19 sub a0,a0,a4 + +000004ca <.L49>: + 4ca: 4742 lw a4,16(sp) + 4cc: 405702b3 sub t0,a4,t0 + +000004d0 <.LVL187>: + 4d0: 4702 lw a4,0(sp) + 4d2: 40a70433 sub s0,a4,a0 + 4d6: 4742 lw a4,16(sp) + 4d8: 00573733 sltu a4,a4,t0 + 4dc: 8c19 sub s0,s0,a4 + +000004de <.LBE49>: + 4de: 4712 lw a4,4(sp) + 4e0: 0092d2b3 srl t0,t0,s1 + +000004e4 <.LVL189>: + 4e4: 00e41733 sll a4,s0,a4 + 4e8: 00576733 or a4,a4,t0 + 4ec: 00945433 srl s0,s0,s1 + +000004f0 <.LVL190>: + 4f0: 4481 li s1,0 + +000004f2 <.LVL191>: + 4f2: b985 j 162 <.L32> + +_udivdi3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__udivdi3>: + 0: fd810113 add sp,sp,-40 + 4: d206 sw ra,36(sp) + 6: d022 sw s0,32(sp) + 8: ce26 sw s1,28(sp) + a: 832a mv t1,a0 + +0000000c <.LBB48>: + c: 30069663 bnez a3,318 <.L2> + 10: 000006b7 lui a3,0x0 + +00000014 <.LVL1>: + 14: 82b2 mv t0,a2 + 16: 842a mv s0,a0 + 18: 00068693 mv a3,a3 + 1c: 10c5f863 bgeu a1,a2,12c <.L3> + +00000020 <.LBB22>: + 20: 67c1 lui a5,0x10 + 22: 84ae mv s1,a1 + +00000024 <.LBB23>: + 24: 0ef67d63 bgeu a2,a5,11e <.L4> + 28: 10063793 sltiu a5,a2,256 + 2c: 0017c793 xor a5,a5,1 + 30: 078e sll a5,a5,0x3 + +00000032 <.L5>: + 32: 00f65533 srl a0,a2,a5 + 36: 96aa add a3,a3,a0 + 38: 0006c683 lbu a3,0(a3) # 0 <__udivdi3> + 3c: 02000513 li a0,32 + 40: 97b6 add a5,a5,a3 + +00000042 <.LVL4>: + 42: 40f506b3 sub a3,a0,a5 + +00000046 <.LBE23>: + 46: 00f50c63 beq a0,a5,5e <.L6> + +0000004a <.LVL6>: + 4a: 00d59733 sll a4,a1,a3 + 4e: 00f357b3 srl a5,t1,a5 + 52: 00d612b3 sll t0,a2,a3 + +00000056 <.LVL7>: + 56: 00e7e4b3 or s1,a5,a4 + +0000005a <.LVL8>: + 5a: 00d31433 sll s0,t1,a3 + +0000005e <.L6>: + 5e: 0102d793 srl a5,t0,0x10 + 62: c03e sw a5,0(sp) + +00000064 <.LVL10>: + 64: 4582 lw a1,0(sp) + +00000066 <.LVL11>: + 66: 01029793 sll a5,t0,0x10 + +0000006a <.LVL12>: + 6a: 83c1 srl a5,a5,0x10 + 6c: 8526 mv a0,s1 + 6e: c816 sw t0,16(sp) + 70: c23e sw a5,4(sp) + +00000072 <.LVL13>: + 72: 00000097 auipc ra,0x0 + 76: 000080e7 jalr ra # 72 <.LVL13> + +0000007a <.LVL14>: + 7a: 85aa mv a1,a0 + 7c: c62a sw a0,12(sp) + 7e: 4512 lw a0,4(sp) + +00000080 <.LVL15>: + 80: 00000097 auipc ra,0x0 + 84: 000080e7 jalr ra # 80 <.LVL15> + +00000088 <.LVL16>: + 88: 4582 lw a1,0(sp) + 8a: c42a sw a0,8(sp) + +0000008c <.LVL17>: + 8c: 8526 mv a0,s1 + +0000008e <.LVL18>: + 8e: 00000097 auipc ra,0x0 + 92: 000080e7 jalr ra # 8e <.LVL18> + +00000096 <.LVL19>: + 96: 4632 lw a2,12(sp) + 98: 46a2 lw a3,8(sp) + 9a: 0542 sll a0,a0,0x10 + 9c: 01045713 srl a4,s0,0x10 + a0: 8f49 or a4,a4,a0 + +000000a2 <.LVL20>: + a2: 42c2 lw t0,16(sp) + a4: 84b2 mv s1,a2 + +000000a6 <.LVL21>: + a6: 00d77c63 bgeu a4,a3,be <.L7> + aa: 9716 add a4,a4,t0 + +000000ac <.LVL22>: + ac: fff60493 add s1,a2,-1 + +000000b0 <.LVL23>: + b0: 00576763 bltu a4,t0,be <.L7> + b4: 00d77563 bgeu a4,a3,be <.L7> + b8: ffe60493 add s1,a2,-2 + bc: 9716 add a4,a4,t0 + +000000be <.L7>: + be: 4582 lw a1,0(sp) + c0: 40d707b3 sub a5,a4,a3 + c4: 853e mv a0,a5 + c6: c816 sw t0,16(sp) + +000000c8 <.LVL26>: + c8: c43e sw a5,8(sp) + +000000ca <.LVL27>: + ca: 00000097 auipc ra,0x0 + ce: 000080e7 jalr ra # ca <.LVL27> + +000000d2 <.LVL28>: + d2: 85aa mv a1,a0 + d4: c62a sw a0,12(sp) + d6: 4512 lw a0,4(sp) + +000000d8 <.LVL29>: + d8: 0442 sll s0,s0,0x10 + +000000da <.LVL30>: + da: 8041 srl s0,s0,0x10 + dc: 00000097 auipc ra,0x0 + e0: 000080e7 jalr ra # dc <.LVL30+0x2> + +000000e4 <.LVL31>: + e4: c22a sw a0,4(sp) + +000000e6 <.LVL32>: + e6: 4582 lw a1,0(sp) + e8: 4522 lw a0,8(sp) + +000000ea <.LVL33>: + ea: 00000097 auipc ra,0x0 + ee: 000080e7 jalr ra # ea <.LVL33> + +000000f2 <.LVL34>: + f2: 4732 lw a4,12(sp) + f4: 4692 lw a3,4(sp) + f6: 0542 sll a0,a0,0x10 + f8: 8c49 or s0,s0,a0 + +000000fa <.LVL35>: + fa: 863a mv a2,a4 + fc: 00d47c63 bgeu s0,a3,114 <.L10> + 100: 42c2 lw t0,16(sp) + 102: fff70613 add a2,a4,-1 + +00000106 <.LVL36>: + 106: 9416 add s0,s0,t0 + +00000108 <.LVL37>: + 108: 00546663 bltu s0,t0,114 <.L10> + +0000010c <.LVL38>: + 10c: 00d47463 bgeu s0,a3,114 <.L10> + 110: ffe70613 add a2,a4,-2 + +00000114 <.L10>: + 114: 01049793 sll a5,s1,0x10 + 118: 8fd1 or a5,a5,a2 + +0000011a <.L55>: + 11a: 4481 li s1,0 + 11c: a211 j 220 <.L13> + +0000011e <.L4>: + 11e: 01000537 lui a0,0x1000 + +00000122 <.LVL42>: + 122: 47c1 li a5,16 + 124: f0a667e3 bltu a2,a0,32 <.L5> + 128: 47e1 li a5,24 + 12a: b721 j 32 <.L5> + +0000012c <.L3>: + 12c: 4781 li a5,0 + +0000012e <.LBE39>: + 12e: ca09 beqz a2,140 <.L14> + +00000130 <.LBB40>: + 130: 67c1 lui a5,0x10 + 132: 0ef67f63 bgeu a2,a5,230 <.L15> + +00000136 <.LVL45>: + 136: 10063793 sltiu a5,a2,256 + 13a: 0017c793 xor a5,a5,1 + 13e: 078e sll a5,a5,0x3 + +00000140 <.L14>: + 140: 00f65733 srl a4,a2,a5 + 144: 96ba add a3,a3,a4 + 146: 0006c703 lbu a4,0(a3) + 14a: 02000693 li a3,32 + 14e: 97ba add a5,a5,a4 + +00000150 <.LVL47>: + 150: 40f68733 sub a4,a3,a5 + +00000154 <.LBE40>: + 154: 0ef69563 bne a3,a5,23e <.L16> + 158: 40c58633 sub a2,a1,a2 + +0000015c <.LVL49>: + 15c: 4485 li s1,1 + +0000015e <.L17>: + 15e: 0102d793 srl a5,t0,0x10 + 162: c03e sw a5,0(sp) + +00000164 <.LVL51>: + 164: 4582 lw a1,0(sp) + 166: 01029793 sll a5,t0,0x10 + +0000016a <.LVL52>: + 16a: 83c1 srl a5,a5,0x10 + 16c: 8532 mv a0,a2 + 16e: ca16 sw t0,20(sp) + 170: c23e sw a5,4(sp) + +00000172 <.LVL53>: + 172: c832 sw a2,16(sp) + 174: 00000097 auipc ra,0x0 + 178: 000080e7 jalr ra # 174 <.LVL53+0x2> + +0000017c <.LVL54>: + 17c: 85aa mv a1,a0 + 17e: c62a sw a0,12(sp) + 180: 4512 lw a0,4(sp) + +00000182 <.LVL55>: + 182: 00000097 auipc ra,0x0 + 186: 000080e7 jalr ra # 182 <.LVL55> + +0000018a <.LVL56>: + 18a: 4642 lw a2,16(sp) + 18c: 4582 lw a1,0(sp) + 18e: c42a sw a0,8(sp) + +00000190 <.LVL57>: + 190: 8532 mv a0,a2 + +00000192 <.LVL58>: + 192: 00000097 auipc ra,0x0 + 196: 000080e7 jalr ra # 192 <.LVL58> + +0000019a <.LVL59>: + 19a: 43b2 lw t2,12(sp) + 19c: 4322 lw t1,8(sp) + 19e: 0542 sll a0,a0,0x10 + 1a0: 01045693 srl a3,s0,0x10 + 1a4: 8ec9 or a3,a3,a0 + +000001a6 <.LVL60>: + 1a6: 42d2 lw t0,20(sp) + 1a8: 879e mv a5,t2 + 1aa: 0066fc63 bgeu a3,t1,1c2 <.L24> + 1ae: 9696 add a3,a3,t0 + +000001b0 <.LVL61>: + 1b0: fff38793 add a5,t2,-1 + +000001b4 <.LVL62>: + 1b4: 0056e763 bltu a3,t0,1c2 <.L24> + 1b8: 0066f563 bgeu a3,t1,1c2 <.L24> + 1bc: ffe38793 add a5,t2,-2 + 1c0: 9696 add a3,a3,t0 + +000001c2 <.L24>: + 1c2: 4582 lw a1,0(sp) + 1c4: ca3e sw a5,20(sp) + +000001c6 <.LVL65>: + 1c6: 406687b3 sub a5,a3,t1 + +000001ca <.LVL66>: + 1ca: 853e mv a0,a5 + 1cc: c43e sw a5,8(sp) + +000001ce <.LVL67>: + 1ce: c816 sw t0,16(sp) + +000001d0 <.LVL68>: + 1d0: 00000097 auipc ra,0x0 + 1d4: 000080e7 jalr ra # 1d0 <.LVL68> + +000001d8 <.LVL69>: + 1d8: 85aa mv a1,a0 + 1da: c62a sw a0,12(sp) + 1dc: 4512 lw a0,4(sp) + +000001de <.LVL70>: + 1de: 0442 sll s0,s0,0x10 + +000001e0 <.LVL71>: + 1e0: 8041 srl s0,s0,0x10 + 1e2: 00000097 auipc ra,0x0 + 1e6: 000080e7 jalr ra # 1e2 <.LVL71+0x2> + +000001ea <.LVL72>: + 1ea: 4582 lw a1,0(sp) + 1ec: c22a sw a0,4(sp) + +000001ee <.LVL73>: + 1ee: 4522 lw a0,8(sp) + +000001f0 <.LVL74>: + 1f0: 00000097 auipc ra,0x0 + 1f4: 000080e7 jalr ra # 1f0 <.LVL74> + +000001f8 <.LVL75>: + 1f8: 46b2 lw a3,12(sp) + 1fa: 4612 lw a2,4(sp) + 1fc: 0542 sll a0,a0,0x10 + 1fe: 8c49 or s0,s0,a0 + +00000200 <.LVL76>: + 200: 47d2 lw a5,20(sp) + 202: 85b6 mv a1,a3 + 204: 00c47c63 bgeu s0,a2,21c <.L27> + 208: 42c2 lw t0,16(sp) + 20a: fff68593 add a1,a3,-1 + +0000020e <.LVL77>: + 20e: 9416 add s0,s0,t0 + +00000210 <.LVL78>: + 210: 00546663 bltu s0,t0,21c <.L27> + +00000214 <.LVL79>: + 214: 00c47463 bgeu s0,a2,21c <.L27> + 218: ffe68593 add a1,a3,-2 + +0000021c <.L27>: + 21c: 07c2 sll a5,a5,0x10 + 21e: 8fcd or a5,a5,a1 + +00000220 <.L13>: + 220: 5092 lw ra,36(sp) + 222: 5402 lw s0,32(sp) + 224: 85a6 mv a1,s1 + 226: 853e mv a0,a5 + 228: 44f2 lw s1,28(sp) + 22a: 02810113 add sp,sp,40 + 22e: 8082 ret + +00000230 <.L15>: + 230: 01000737 lui a4,0x1000 + 234: 47c1 li a5,16 + 236: f0e665e3 bltu a2,a4,140 <.L14> + 23a: 47e1 li a5,24 + 23c: b711 j 140 <.L14> + +0000023e <.L16>: + 23e: 00f5d4b3 srl s1,a1,a5 + 242: 00e595b3 sll a1,a1,a4 + +00000246 <.LVL84>: + 246: 00f357b3 srl a5,t1,a5 + +0000024a <.LVL85>: + 24a: 00e612b3 sll t0,a2,a4 + +0000024e <.LVL86>: + 24e: 8fcd or a5,a5,a1 + 250: c23e sw a5,4(sp) + +00000252 <.LBB43>: + 252: 0102d793 srl a5,t0,0x10 + +00000256 <.LVL88>: + 256: c03e sw a5,0(sp) + 258: 4582 lw a1,0(sp) + 25a: 01029793 sll a5,t0,0x10 + 25e: 83c1 srl a5,a5,0x10 + 260: 8526 mv a0,s1 + +00000262 <.LVL89>: + 262: ca16 sw t0,20(sp) + 264: c43e sw a5,8(sp) + +00000266 <.LBE43>: + 266: 00e31433 sll s0,t1,a4 + +0000026a <.LBB44>: + 26a: 00000097 auipc ra,0x0 + 26e: 000080e7 jalr ra # 26a <.LBB44> + +00000272 <.LVL91>: + 272: 85aa mv a1,a0 + 274: c82a sw a0,16(sp) + 276: 4522 lw a0,8(sp) + +00000278 <.LVL92>: + 278: 00000097 auipc ra,0x0 + 27c: 000080e7 jalr ra # 278 <.LVL92> + +00000280 <.LVL93>: + 280: 4582 lw a1,0(sp) + 282: c62a sw a0,12(sp) + +00000284 <.LVL94>: + 284: 8526 mv a0,s1 + +00000286 <.LVL95>: + 286: 00000097 auipc ra,0x0 + 28a: 000080e7 jalr ra # 286 <.LVL95> + +0000028e <.LVL96>: + 28e: 4792 lw a5,4(sp) + 290: 4642 lw a2,16(sp) + 292: 46b2 lw a3,12(sp) + 294: 0542 sll a0,a0,0x10 + 296: 83c1 srl a5,a5,0x10 + 298: 8fc9 or a5,a5,a0 + +0000029a <.LVL97>: + 29a: 42d2 lw t0,20(sp) + 29c: 84b2 mv s1,a2 + +0000029e <.LVL98>: + 29e: 00d7fc63 bgeu a5,a3,2b6 <.L18> + 2a2: 9796 add a5,a5,t0 + +000002a4 <.LVL99>: + 2a4: fff60493 add s1,a2,-1 + +000002a8 <.LVL100>: + 2a8: 0057e763 bltu a5,t0,2b6 <.L18> + 2ac: 00d7f563 bgeu a5,a3,2b6 <.L18> + 2b0: ffe60493 add s1,a2,-2 + 2b4: 9796 add a5,a5,t0 + +000002b6 <.L18>: + 2b6: 4582 lw a1,0(sp) + 2b8: 8f95 sub a5,a5,a3 + +000002ba <.LVL103>: + 2ba: 853e mv a0,a5 + 2bc: ca16 sw t0,20(sp) + +000002be <.LVL104>: + 2be: c63e sw a5,12(sp) + +000002c0 <.LVL105>: + 2c0: 00000097 auipc ra,0x0 + 2c4: 000080e7 jalr ra # 2c0 <.LVL105> + +000002c8 <.LVL106>: + 2c8: 85aa mv a1,a0 + 2ca: c82a sw a0,16(sp) + 2cc: 4522 lw a0,8(sp) + +000002ce <.LVL107>: + 2ce: 00000097 auipc ra,0x0 + 2d2: 000080e7 jalr ra # 2ce <.LVL107> + +000002d6 <.LVL108>: + 2d6: 4582 lw a1,0(sp) + 2d8: c42a sw a0,8(sp) + +000002da <.LVL109>: + 2da: 4532 lw a0,12(sp) + +000002dc <.LVL110>: + 2dc: 00000097 auipc ra,0x0 + 2e0: 000080e7 jalr ra # 2dc <.LVL110> + +000002e4 <.LVL111>: + 2e4: 00415603 lhu a2,4(sp) + 2e8: 46c2 lw a3,16(sp) + 2ea: 47a2 lw a5,8(sp) + 2ec: 0542 sll a0,a0,0x10 + 2ee: 8e49 or a2,a2,a0 + +000002f0 <.LVL112>: + 2f0: 42d2 lw t0,20(sp) + 2f2: 85b6 mv a1,a3 + 2f4: 00f67c63 bgeu a2,a5,30c <.L21> + +000002f8 <.LVL113>: + 2f8: 9616 add a2,a2,t0 + +000002fa <.LVL114>: + 2fa: fff68593 add a1,a3,-1 + +000002fe <.LVL115>: + 2fe: 00566763 bltu a2,t0,30c <.L21> + 302: 00f67563 bgeu a2,a5,30c <.L21> + 306: ffe68593 add a1,a3,-2 + 30a: 9616 add a2,a2,t0 + +0000030c <.L21>: + 30c: 01049713 sll a4,s1,0x10 + 310: 8e1d sub a2,a2,a5 + 312: 00b764b3 or s1,a4,a1 + +00000316 <.LVL119>: + 316: b5a1 j 15e <.L17> + +00000318 <.L2>: + 318: 1cd5ea63 bltu a1,a3,4ec <.L50> + +0000031c <.LBB45>: + 31c: 67c1 lui a5,0x10 + 31e: 02f6ff63 bgeu a3,a5,35c <.L30> + 322: 1006b793 sltiu a5,a3,256 + 326: 0017c793 xor a5,a5,1 + 32a: 078e sll a5,a5,0x3 + +0000032c <.L31>: + 32c: 00000737 lui a4,0x0 + 330: 00f6d533 srl a0,a3,a5 + +00000334 <.LVL123>: + 334: 00070713 mv a4,a4 + 338: 972a add a4,a4,a0 + 33a: 00074503 lbu a0,0(a4) # 0 <__udivdi3> + 33e: 953e add a0,a0,a5 + 340: 02000793 li a5,32 + +00000344 <.LVL124>: + 344: 40a784b3 sub s1,a5,a0 + +00000348 <.LBE45>: + 348: 02a79163 bne a5,a0,36a <.L32> + 34c: 4785 li a5,1 + 34e: ecb6e9e3 bltu a3,a1,220 <.L13> + 352: 00c33633 sltu a2,t1,a2 + +00000356 <.LVL126>: + 356: 00164793 xor a5,a2,1 + 35a: b5d9 j 220 <.L13> + +0000035c <.L30>: + 35c: 01000737 lui a4,0x1000 + 360: 47c1 li a5,16 + 362: fce6e5e3 bltu a3,a4,32c <.L31> + 366: 47e1 li a5,24 + 368: b7d1 j 32c <.L31> + +0000036a <.L32>: + 36a: 009697b3 sll a5,a3,s1 + 36e: 00a656b3 srl a3,a2,a0 + +00000372 <.LVL129>: + 372: 00f6e433 or s0,a3,a5 + +00000376 <.LVL130>: + 376: 009617b3 sll a5,a2,s1 + 37a: c03e sw a5,0(sp) + +0000037c <.LVL131>: + 37c: 00a5d7b3 srl a5,a1,a0 + +00000380 <.LVL132>: + 380: c23e sw a5,4(sp) + +00000382 <.LVL133>: + 382: 00a35533 srl a0,t1,a0 + +00000386 <.LVL134>: + 386: 009595b3 sll a1,a1,s1 + +0000038a <.LVL135>: + 38a: 00b567b3 or a5,a0,a1 + +0000038e <.LBB26>: + 38e: 4512 lw a0,4(sp) + +00000390 <.LBE26>: + 390: c43e sw a5,8(sp) + +00000392 <.LBB27>: + 392: 01041793 sll a5,s0,0x10 + +00000396 <.LVL138>: + 396: 83c1 srl a5,a5,0x10 + 398: 01045593 srl a1,s0,0x10 + +0000039c <.LBE27>: + 39c: ca1a sw t1,20(sp) + +0000039e <.LBB28>: + 39e: c63e sw a5,12(sp) + +000003a0 <.LVL140>: + 3a0: 00000097 auipc ra,0x0 + 3a4: 000080e7 jalr ra # 3a0 <.LVL140> + +000003a8 <.LVL141>: + 3a8: 85aa mv a1,a0 + 3aa: c82a sw a0,16(sp) + 3ac: 01041513 sll a0,s0,0x10 + +000003b0 <.LVL142>: + 3b0: 8141 srl a0,a0,0x10 + 3b2: 00000097 auipc ra,0x0 + 3b6: 000080e7 jalr ra # 3b2 <.LVL142+0x2> + +000003ba <.LVL143>: + 3ba: c62a sw a0,12(sp) + +000003bc <.LVL144>: + 3bc: 4512 lw a0,4(sp) + +000003be <.LVL145>: + 3be: 01045593 srl a1,s0,0x10 + 3c2: 00000097 auipc ra,0x0 + 3c6: 000080e7 jalr ra # 3c2 <.LVL145+0x4> + +000003ca <.LVL146>: + 3ca: 47a2 lw a5,8(sp) + 3cc: 43c2 lw t2,16(sp) + 3ce: 42b2 lw t0,12(sp) + 3d0: 0107d613 srl a2,a5,0x10 + 3d4: 0542 sll a0,a0,0x10 + 3d6: 8e49 or a2,a2,a0 + +000003d8 <.LVL147>: + 3d8: 4352 lw t1,20(sp) + 3da: 879e mv a5,t2 + 3dc: 00567c63 bgeu a2,t0,3f4 <.L33> + 3e0: 9622 add a2,a2,s0 + +000003e2 <.LVL148>: + 3e2: fff38793 add a5,t2,-1 + +000003e6 <.LVL149>: + 3e6: 00866763 bltu a2,s0,3f4 <.L33> + 3ea: 00567563 bgeu a2,t0,3f4 <.L33> + 3ee: ffe38793 add a5,t2,-2 + 3f2: 9622 add a2,a2,s0 + +000003f4 <.L33>: + 3f4: ca3e sw a5,20(sp) + +000003f6 <.LVL152>: + 3f6: 405607b3 sub a5,a2,t0 + 3fa: 853e mv a0,a5 + 3fc: 01045593 srl a1,s0,0x10 + 400: cc1a sw t1,24(sp) + 402: c23e sw a5,4(sp) + +00000404 <.LVL153>: + 404: 00000097 auipc ra,0x0 + 408: 000080e7 jalr ra # 404 <.LVL153> + +0000040c <.LVL154>: + 40c: 85aa mv a1,a0 + 40e: c82a sw a0,16(sp) + 410: 01041513 sll a0,s0,0x10 + +00000414 <.LVL155>: + 414: 8141 srl a0,a0,0x10 + 416: 00000097 auipc ra,0x0 + 41a: 000080e7 jalr ra # 416 <.LVL155+0x2> + +0000041e <.LVL156>: + 41e: c62a sw a0,12(sp) + +00000420 <.LVL157>: + 420: 4512 lw a0,4(sp) + +00000422 <.LVL158>: + 422: 01045593 srl a1,s0,0x10 + 426: 00000097 auipc ra,0x0 + 42a: 000080e7 jalr ra # 426 <.LVL158+0x4> + +0000042e <.LVL159>: + 42e: 00815603 lhu a2,8(sp) + 432: 43c2 lw t2,16(sp) + 434: 4732 lw a4,12(sp) + 436: 0542 sll a0,a0,0x10 + 438: 8e49 or a2,a2,a0 + +0000043a <.LVL160>: + 43a: 47d2 lw a5,20(sp) + 43c: 4362 lw t1,24(sp) + 43e: 859e mv a1,t2 + 440: 00e67c63 bgeu a2,a4,458 <.L36> + 444: 9622 add a2,a2,s0 + +00000446 <.LVL161>: + 446: fff38593 add a1,t2,-1 + +0000044a <.LVL162>: + 44a: 00866763 bltu a2,s0,458 <.L36> + 44e: 00e67563 bgeu a2,a4,458 <.L36> + 452: ffe38593 add a1,t2,-2 + 456: 9622 add a2,a2,s0 + +00000458 <.L36>: + 458: 40e60733 sub a4,a2,a4 + +0000045c <.LBB29>: + 45c: 4602 lw a2,0(sp) + 45e: 66c1 lui a3,0x10 + +00000460 <.LBB34>: + 460: 07c2 sll a5,a5,0x10 + 462: 8fcd or a5,a5,a1 + +00000464 <.LBB35>: + 464: fff68293 add t0,a3,-1 # ffff <.LLST66+0xf1f8> + 468: 0057f433 and s0,a5,t0 + +0000046c <.LVL167>: + 46c: 005672b3 and t0,a2,t0 + +00000470 <.LVL168>: + 470: 8241 srl a2,a2,0x10 + 472: c032 sw a2,0(sp) + +00000474 <.LBB30>: + 474: 8522 mv a0,s0 + 476: 8596 mv a1,t0 + +00000478 <.LVL170>: + 478: 00000097 auipc ra,0x0 + 47c: 000080e7 jalr ra # 478 <.LVL170> + +00000480 <.LVL171>: + 480: 83aa mv t2,a0 + +00000482 <.LBB31>: + 482: 4582 lw a1,0(sp) + 484: 8522 mv a0,s0 + 486: 00000097 auipc ra,0x0 + 48a: 000080e7 jalr ra # 486 <.LBB31+0x4> + 48e: 842a mv s0,a0 + +00000490 <.LBB32>: + 490: 8596 mv a1,t0 + 492: 0107d513 srl a0,a5,0x10 + +00000496 <.LVL174>: + 496: 00000097 auipc ra,0x0 + 49a: 000080e7 jalr ra # 496 <.LVL174> + +0000049e <.LVL175>: + 49e: 82aa mv t0,a0 + +000004a0 <.LBB33>: + 4a0: 4582 lw a1,0(sp) + 4a2: 0107d513 srl a0,a5,0x10 + +000004a6 <.LVL177>: + 4a6: 00000097 auipc ra,0x0 + 4aa: 000080e7 jalr ra # 4a6 <.LVL177> + +000004ae <.LBE33>: + 4ae: 0103d613 srl a2,t2,0x10 + 4b2: 005406b3 add a3,s0,t0 + 4b6: 00d60433 add s0,a2,a3 + +000004ba <.LVL179>: + 4ba: 00547463 bgeu s0,t0,4c2 <.L39> + 4be: 66c1 lui a3,0x10 + +000004c0 <.LVL180>: + 4c0: 9536 add a0,a0,a3 + +000004c2 <.L39>: + 4c2: 01045693 srl a3,s0,0x10 + 4c6: 96aa add a3,a3,a0 + +000004c8 <.LBE35>: + 4c8: 02d76063 bltu a4,a3,4e8 <.L40> + 4cc: c4d717e3 bne a4,a3,11a <.L55> + +000004d0 <.LBB36>: + 4d0: 6741 lui a4,0x10 + +000004d2 <.LVL183>: + 4d2: 177d add a4,a4,-1 # ffff <.LLST66+0xf1f8> + +000004d4 <.LVL184>: + 4d4: 8c79 and s0,s0,a4 + +000004d6 <.LVL185>: + 4d6: 0442 sll s0,s0,0x10 + 4d8: 00e3f733 and a4,t2,a4 + +000004dc <.LBE36>: + 4dc: 00931333 sll t1,t1,s1 + +000004e0 <.LBB37>: + 4e0: 943a add s0,s0,a4 + +000004e2 <.LBE37>: + 4e2: 4481 li s1,0 + +000004e4 <.LVL187>: + 4e4: d2837ee3 bgeu t1,s0,220 <.L13> + +000004e8 <.L40>: + 4e8: 17fd add a5,a5,-1 # ffff <.LLST66+0xf1f8> + +000004ea <.LBE47>: + 4ea: b905 j 11a <.L55> + +000004ec <.L50>: + 4ec: 4481 li s1,0 + 4ee: 4781 li a5,0 + 4f0: bb05 j 220 <.L13> + +_umoddi3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__umoddi3>: + 0: fcc10113 add sp,sp,-52 + 4: d622 sw s0,44(sp) + 6: d806 sw ra,48(sp) + 8: d426 sw s1,40(sp) + +0000000a <.LBB54>: + a: 842a mv s0,a0 + +0000000c <.LVL1>: + c: 872e mv a4,a1 + +0000000e <.LVL2>: + e: 24069263 bnez a3,252 <.L2> + 12: 00000337 lui t1,0x0 + 16: 84b2 mv s1,a2 + 18: 00030313 mv t1,t1 + 1c: 10c5f163 bgeu a1,a2,11e <.L3> + +00000020 <.LBB22>: + 20: 66c1 lui a3,0x10 + +00000022 <.LVL4>: + 22: 0ed67763 bgeu a2,a3,110 <.L4> + 26: 10063693 sltiu a3,a2,256 + 2a: 0016c693 xor a3,a3,1 + 2e: 068e sll a3,a3,0x3 + +00000030 <.L5>: + 30: 00d652b3 srl t0,a2,a3 + 34: 9316 add t1,t1,t0 + 36: 00034303 lbu t1,0(t1) # 0 <__umoddi3> + 3a: 969a add a3,a3,t1 + +0000003c <.LVL6>: + 3c: 02000313 li t1,32 + 40: 40d307b3 sub a5,t1,a3 + 44: c03e sw a5,0(sp) + +00000046 <.LBE22>: + 46: 00d30b63 beq t1,a3,5c <.L6> + 4a: 00f59733 sll a4,a1,a5 + 4e: 00d556b3 srl a3,a0,a3 + 52: 00f614b3 sll s1,a2,a5 + +00000056 <.LVL8>: + 56: 8f55 or a4,a4,a3 + +00000058 <.LVL9>: + 58: 00f51433 sll s0,a0,a5 + +0000005c <.L6>: + 5c: 01049793 sll a5,s1,0x10 + +00000060 <.LVL11>: + 60: 83c1 srl a5,a5,0x10 + 62: 853a mv a0,a4 + +00000064 <.LVL12>: + 64: 0104d593 srl a1,s1,0x10 + 68: c43a sw a4,8(sp) + 6a: c23e sw a5,4(sp) + +0000006c <.LVL13>: + 6c: 00000097 auipc ra,0x0 + 70: 000080e7 jalr ra # 6c <.LVL13> + +00000074 <.LVL14>: + 74: 01049593 sll a1,s1,0x10 + 78: 81c1 srl a1,a1,0x10 + 7a: 00000097 auipc ra,0x0 + 7e: 000080e7 jalr ra # 7a <.LVL14+0x6> + +00000082 <.LVL15>: + 82: 4722 lw a4,8(sp) + 84: c22a sw a0,4(sp) + +00000086 <.LVL16>: + 86: 0104d593 srl a1,s1,0x10 + 8a: 853a mv a0,a4 + +0000008c <.L75>: + 8c: 00000097 auipc ra,0x0 + 90: 000080e7 jalr ra # 8c <.L75> + +00000094 <.LVL18>: + 94: 4692 lw a3,4(sp) + 96: 0542 sll a0,a0,0x10 + 98: 01045713 srl a4,s0,0x10 + 9c: 8f49 or a4,a4,a0 + +0000009e <.LVL19>: + 9e: 00d77863 bgeu a4,a3,ae <.L24> + a2: 9726 add a4,a4,s1 + a4: 00976563 bltu a4,s1,ae <.L24> + a8: 00d77363 bgeu a4,a3,ae <.L24> + ac: 9726 add a4,a4,s1 + +000000ae <.L24>: + ae: 40d707b3 sub a5,a4,a3 + b2: 853e mv a0,a5 + b4: 0104d593 srl a1,s1,0x10 + b8: c23e sw a5,4(sp) + +000000ba <.LVL23>: + ba: 00000097 auipc ra,0x0 + be: 000080e7 jalr ra # ba <.LVL23> + +000000c2 <.LVL24>: + c2: 01049593 sll a1,s1,0x10 + c6: 81c1 srl a1,a1,0x10 + c8: 00000097 auipc ra,0x0 + cc: 000080e7 jalr ra # c8 <.LVL24+0x6> + +000000d0 <.LVL25>: + d0: c42a sw a0,8(sp) + +000000d2 <.LVL26>: + d2: 4512 lw a0,4(sp) + +000000d4 <.LVL27>: + d4: 0104d593 srl a1,s1,0x10 + d8: 0442 sll s0,s0,0x10 + da: 00000097 auipc ra,0x0 + de: 000080e7 jalr ra # da <.LVL27+0x6> + +000000e2 <.LVL28>: + e2: 4722 lw a4,8(sp) + e4: 0542 sll a0,a0,0x10 + e6: 8041 srl s0,s0,0x10 + e8: 8c49 or s0,s0,a0 + +000000ea <.LVL29>: + ea: 00e47863 bgeu s0,a4,fa <.L27> + +000000ee <.LVL30>: + ee: 9426 add s0,s0,s1 + f0: 00946563 bltu s0,s1,fa <.L27> + f4: 00e47363 bgeu s0,a4,fa <.L27> + +000000f8 <.LVL32>: + f8: 9426 add s0,s0,s1 + +000000fa <.L27>: + fa: 4782 lw a5,0(sp) + +000000fc <.LBB25>: + fc: 8c19 sub s0,s0,a4 + +000000fe <.LBE25>: + fe: 4581 li a1,0 + 100: 00f45533 srl a0,s0,a5 + +00000104 <.L30>: + 104: 50c2 lw ra,48(sp) + 106: 5432 lw s0,44(sp) + 108: 54a2 lw s1,40(sp) + 10a: 03410113 add sp,sp,52 + 10e: 8082 ret + +00000110 <.L4>: + 110: 010002b7 lui t0,0x1000 + 114: 46c1 li a3,16 + 116: f0566de3 bltu a2,t0,30 <.L5> + 11a: 46e1 li a3,24 + 11c: bf11 j 30 <.L5> + +0000011e <.L3>: + 11e: 4701 li a4,0 + +00000120 <.LBE27>: + 120: ca09 beqz a2,132 <.L14> + +00000122 <.LBB28>: + 122: 6741 lui a4,0x10 + 124: 04e67f63 bgeu a2,a4,182 <.L15> + +00000128 <.LVL39>: + 128: 10063713 sltiu a4,a2,256 + 12c: 00174713 xor a4,a4,1 + 130: 070e sll a4,a4,0x3 + +00000132 <.L14>: + 132: 00e656b3 srl a3,a2,a4 + 136: 9336 add t1,t1,a3 + 138: 00034683 lbu a3,0(t1) + 13c: 9736 add a4,a4,a3 + +0000013e <.LVL41>: + 13e: 02000693 li a3,32 + 142: 40e687b3 sub a5,a3,a4 + 146: c03e sw a5,0(sp) + +00000148 <.LBE28>: + 148: 04e69463 bne a3,a4,190 <.L16> + 14c: 40c58633 sub a2,a1,a2 + +00000150 <.L17>: + 150: 01049793 sll a5,s1,0x10 + 154: 83c1 srl a5,a5,0x10 + 156: 8532 mv a0,a2 + 158: 0104d593 srl a1,s1,0x10 + 15c: c432 sw a2,8(sp) + 15e: c23e sw a5,4(sp) + +00000160 <.LVL44>: + 160: 00000097 auipc ra,0x0 + 164: 000080e7 jalr ra # 160 <.LVL44> + +00000168 <.LVL45>: + 168: 01049593 sll a1,s1,0x10 + 16c: 81c1 srl a1,a1,0x10 + 16e: 00000097 auipc ra,0x0 + 172: 000080e7 jalr ra # 16e <.LVL45+0x6> + +00000176 <.LVL46>: + 176: 4622 lw a2,8(sp) + 178: c22a sw a0,4(sp) + +0000017a <.LVL47>: + 17a: 0104d593 srl a1,s1,0x10 + 17e: 8532 mv a0,a2 + +00000180 <.LVL48>: + 180: b731 j 8c <.L75> + +00000182 <.L15>: + 182: 010006b7 lui a3,0x1000 + +00000186 <.LVL50>: + 186: 4741 li a4,16 + 188: fad665e3 bltu a2,a3,132 <.L14> + 18c: 4761 li a4,24 + 18e: b755 j 132 <.L14> + +00000190 <.L16>: + 190: 4782 lw a5,0(sp) + +00000192 <.LVL52>: + 192: 00f614b3 sll s1,a2,a5 + +00000196 <.LVL53>: + 196: 00e5d7b3 srl a5,a1,a4 + 19a: c23e sw a5,4(sp) + +0000019c <.LVL54>: + 19c: 4782 lw a5,0(sp) + +0000019e <.LVL55>: + 19e: 00e55733 srl a4,a0,a4 + +000001a2 <.LVL56>: + 1a2: 00f595b3 sll a1,a1,a5 + +000001a6 <.LVL57>: + 1a6: 00b767b3 or a5,a4,a1 + 1aa: c43e sw a5,8(sp) + +000001ac <.LVL58>: + 1ac: 4782 lw a5,0(sp) + +000001ae <.LBB31>: + 1ae: 0104d593 srl a1,s1,0x10 + +000001b2 <.LBE31>: + 1b2: 00f51433 sll s0,a0,a5 + +000001b6 <.LBB32>: + 1b6: 4512 lw a0,4(sp) + +000001b8 <.LVL61>: + 1b8: 01049793 sll a5,s1,0x10 + 1bc: 83c1 srl a5,a5,0x10 + 1be: c63e sw a5,12(sp) + +000001c0 <.LVL62>: + 1c0: 00000097 auipc ra,0x0 + 1c4: 000080e7 jalr ra # 1c0 <.LVL62> + +000001c8 <.LVL63>: + 1c8: 01049593 sll a1,s1,0x10 + 1cc: 81c1 srl a1,a1,0x10 + 1ce: 00000097 auipc ra,0x0 + 1d2: 000080e7 jalr ra # 1ce <.LVL63+0x6> + +000001d6 <.LVL64>: + 1d6: c62a sw a0,12(sp) + +000001d8 <.LVL65>: + 1d8: 4512 lw a0,4(sp) + +000001da <.LVL66>: + 1da: 0104d593 srl a1,s1,0x10 + 1de: 00000097 auipc ra,0x0 + 1e2: 000080e7 jalr ra # 1de <.LVL66+0x4> + +000001e6 <.LVL67>: + 1e6: 47a2 lw a5,8(sp) + 1e8: 46b2 lw a3,12(sp) + 1ea: 0542 sll a0,a0,0x10 + 1ec: 0107d713 srl a4,a5,0x10 + 1f0: 8f49 or a4,a4,a0 + +000001f2 <.LVL68>: + 1f2: 00d77863 bgeu a4,a3,202 <.L18> + +000001f6 <.LVL69>: + 1f6: 9726 add a4,a4,s1 + 1f8: 00976563 bltu a4,s1,202 <.L18> + 1fc: 00d77363 bgeu a4,a3,202 <.L18> + +00000200 <.LVL71>: + 200: 9726 add a4,a4,s1 + +00000202 <.L18>: + 202: 40d707b3 sub a5,a4,a3 + 206: 853e mv a0,a5 + 208: 0104d593 srl a1,s1,0x10 + 20c: c23e sw a5,4(sp) + +0000020e <.LVL73>: + 20e: 00000097 auipc ra,0x0 + 212: 000080e7 jalr ra # 20e <.LVL73> + +00000216 <.LVL74>: + 216: 01049593 sll a1,s1,0x10 + 21a: 81c1 srl a1,a1,0x10 + 21c: 00000097 auipc ra,0x0 + 220: 000080e7 jalr ra # 21c <.LVL74+0x6> + +00000224 <.LVL75>: + 224: c62a sw a0,12(sp) + +00000226 <.LVL76>: + 226: 4512 lw a0,4(sp) + +00000228 <.LVL77>: + 228: 0104d593 srl a1,s1,0x10 + 22c: 00000097 auipc ra,0x0 + 230: 000080e7 jalr ra # 22c <.LVL77+0x4> + +00000234 <.LVL78>: + 234: 00815603 lhu a2,8(sp) + 238: 4732 lw a4,12(sp) + 23a: 0542 sll a0,a0,0x10 + 23c: 8e49 or a2,a2,a0 + +0000023e <.LVL79>: + 23e: 00e67863 bgeu a2,a4,24e <.L21> + 242: 9626 add a2,a2,s1 + 244: 00966563 bltu a2,s1,24e <.L21> + 248: 00e67363 bgeu a2,a4,24e <.L21> + 24c: 9626 add a2,a2,s1 + +0000024e <.L21>: + 24e: 8e19 sub a2,a2,a4 + +00000250 <.LVL82>: + 250: b701 j 150 <.L17> + +00000252 <.L2>: + 252: ead5e9e3 bltu a1,a3,104 <.L30> + +00000256 <.LBB33>: + 256: 67c1 lui a5,0x10 + 258: 04f6f863 bgeu a3,a5,2a8 <.L32> + 25c: 1006b793 sltiu a5,a3,256 + 260: 0017c793 xor a5,a5,1 + 264: 078e sll a5,a5,0x3 + +00000266 <.L33>: + 266: 00000337 lui t1,0x0 + 26a: 00f6d2b3 srl t0,a3,a5 + 26e: 00030313 mv t1,t1 + 272: 9316 add t1,t1,t0 + 274: 00034303 lbu t1,0(t1) # 0 <__umoddi3> + 278: 933e add t1,t1,a5 + 27a: 02000793 li a5,32 + +0000027e <.LVL86>: + 27e: 406784b3 sub s1,a5,t1 + 282: c026 sw s1,0(sp) + +00000284 <.LBE33>: + 284: 02679963 bne a5,t1,2b6 <.L34> + 288: 00b6e463 bltu a3,a1,290 <.L35> + 28c: 00c56b63 bltu a0,a2,2a2 <.L36> + +00000290 <.L35>: + 290: 40c50633 sub a2,a0,a2 + +00000294 <.LVL89>: + 294: 40d586b3 sub a3,a1,a3 + +00000298 <.LVL90>: + 298: 00c53733 sltu a4,a0,a2 + 29c: 8432 mv s0,a2 + +0000029e <.LVL91>: + 29e: 40e68733 sub a4,a3,a4 + +000002a2 <.L36>: + 2a2: 8522 mv a0,s0 + +000002a4 <.LVL93>: + 2a4: 85ba mv a1,a4 + 2a6: bdb9 j 104 <.L30> + +000002a8 <.L32>: + 2a8: 01000337 lui t1,0x1000 + 2ac: 47c1 li a5,16 + 2ae: fa66ece3 bltu a3,t1,266 <.L33> + 2b2: 47e1 li a5,24 + 2b4: bf4d j 266 <.L33> + +000002b6 <.L34>: + 2b6: 4782 lw a5,0(sp) + 2b8: 0065d4b3 srl s1,a1,t1 + +000002bc <.LVL97>: + 2bc: 00665733 srl a4,a2,t1 + 2c0: 00f696b3 sll a3,a3,a5 + +000002c4 <.LVL98>: + 2c4: 00f617b3 sll a5,a2,a5 + 2c8: c43e sw a5,8(sp) + 2ca: 4782 lw a5,0(sp) + 2cc: 8f55 or a4,a4,a3 + +000002ce <.LVL99>: + 2ce: d21a sw t1,36(sp) + 2d0: 00f595b3 sll a1,a1,a5 + +000002d4 <.LVL100>: + 2d4: 006557b3 srl a5,a0,t1 + 2d8: 8fcd or a5,a5,a1 + 2da: c83e sw a5,16(sp) + +000002dc <.LVL101>: + 2dc: 4782 lw a5,0(sp) + +000002de <.LBB37>: + 2de: d03a sw a4,32(sp) + +000002e0 <.LBE37>: + 2e0: 00f517b3 sll a5,a0,a5 + 2e4: c63e sw a5,12(sp) + +000002e6 <.LBB38>: + 2e6: 01075793 srl a5,a4,0x10 + +000002ea <.LVL104>: + 2ea: c23e sw a5,4(sp) + +000002ec <.LVL105>: + 2ec: 4592 lw a1,4(sp) + 2ee: 01071793 sll a5,a4,0x10 + +000002f2 <.LVL106>: + 2f2: 83c1 srl a5,a5,0x10 + 2f4: 8526 mv a0,s1 + +000002f6 <.LVL107>: + 2f6: ca3e sw a5,20(sp) + +000002f8 <.LVL108>: + 2f8: 00000097 auipc ra,0x0 + 2fc: 000080e7 jalr ra # 2f8 <.LVL108> + +00000300 <.LVL109>: + 300: 85aa mv a1,a0 + 302: ce2a sw a0,28(sp) + 304: 4552 lw a0,20(sp) + +00000306 <.LVL110>: + 306: 00000097 auipc ra,0x0 + 30a: 000080e7 jalr ra # 306 <.LVL110> + +0000030e <.LVL111>: + 30e: 4592 lw a1,4(sp) + 310: cc2a sw a0,24(sp) + +00000312 <.LVL112>: + 312: 8526 mv a0,s1 + +00000314 <.LVL113>: + 314: 00000097 auipc ra,0x0 + 318: 000080e7 jalr ra # 314 <.LVL113> + +0000031c <.LVL114>: + 31c: 47c2 lw a5,16(sp) + 31e: 4672 lw a2,28(sp) + 320: 46e2 lw a3,24(sp) + 322: 0542 sll a0,a0,0x10 + 324: 0107d493 srl s1,a5,0x10 + +00000328 <.LVL115>: + 328: 8cc9 or s1,s1,a0 + +0000032a <.LVL116>: + 32a: 5702 lw a4,32(sp) + 32c: 5312 lw t1,36(sp) + 32e: 8432 mv s0,a2 + 330: 00d4fc63 bgeu s1,a3,348 <.L39> + +00000334 <.LVL117>: + 334: 94ba add s1,s1,a4 + +00000336 <.LVL118>: + 336: fff60413 add s0,a2,-1 + +0000033a <.LVL119>: + 33a: 00e4e763 bltu s1,a4,348 <.L39> + 33e: 00d4f563 bgeu s1,a3,348 <.L39> + 342: ffe60413 add s0,a2,-2 + 346: 94ba add s1,s1,a4 + +00000348 <.L39>: + 348: 4592 lw a1,4(sp) + 34a: 40d487b3 sub a5,s1,a3 + 34e: 853e mv a0,a5 + 350: d23a sw a4,36(sp) + 352: d01a sw t1,32(sp) + +00000354 <.LVL122>: + 354: cc3e sw a5,24(sp) + +00000356 <.LVL123>: + 356: 00000097 auipc ra,0x0 + 35a: 000080e7 jalr ra # 356 <.LVL123> + +0000035e <.LVL124>: + 35e: 85aa mv a1,a0 + 360: ce2a sw a0,28(sp) + 362: 4552 lw a0,20(sp) + +00000364 <.LVL125>: + 364: 00000097 auipc ra,0x0 + 368: 000080e7 jalr ra # 364 <.LVL125> + +0000036c <.LVL126>: + 36c: 4592 lw a1,4(sp) + 36e: 84aa mv s1,a0 + +00000370 <.LVL127>: + 370: 4562 lw a0,24(sp) + 372: 00000097 auipc ra,0x0 + 376: 000080e7 jalr ra # 372 <.LVL127+0x2> + +0000037a <.LVL128>: + 37a: 01015583 lhu a1,16(sp) + 37e: 4672 lw a2,28(sp) + 380: 0542 sll a0,a0,0x10 + 382: 8dc9 or a1,a1,a0 + +00000384 <.LVL129>: + 384: 5302 lw t1,32(sp) + 386: 5712 lw a4,36(sp) + 388: 8532 mv a0,a2 + 38a: 0095fc63 bgeu a1,s1,3a2 <.L42> + +0000038e <.LVL130>: + 38e: 95ba add a1,a1,a4 + +00000390 <.LVL131>: + 390: fff60513 add a0,a2,-1 + +00000394 <.LVL132>: + 394: 00e5e763 bltu a1,a4,3a2 <.L42> + 398: 0095f563 bgeu a1,s1,3a2 <.L42> + 39c: ffe60513 add a0,a2,-2 + 3a0: 95ba add a1,a1,a4 + +000003a2 <.L42>: + 3a2: 4622 lw a2,8(sp) + +000003a4 <.LBB44>: + 3a4: 01041793 sll a5,s0,0x10 + +000003a8 <.LBB45>: + 3a8: 66c1 lui a3,0x10 + +000003aa <.LBB46>: + 3aa: 8fc9 or a5,a5,a0 + +000003ac <.LBB47>: + 3ac: fff68393 add t2,a3,-1 # ffff <.LLST64+0xf395> + +000003b0 <.LBB48>: + 3b0: 409582b3 sub t0,a1,s1 + +000003b4 <.LBB49>: + 3b4: 0077f4b3 and s1,a5,t2 + +000003b8 <.LVL136>: + 3b8: 007673b3 and t2,a2,t2 + 3bc: 83c1 srl a5,a5,0x10 + +000003be <.LVL137>: + 3be: 01065413 srl s0,a2,0x10 + +000003c2 <.LBB40>: + 3c2: 8526 mv a0,s1 + +000003c4 <.LVL139>: + 3c4: 859e mv a1,t2 + 3c6: 00000097 auipc ra,0x0 + 3ca: 000080e7 jalr ra # 3c6 <.LVL139+0x2> + 3ce: c22a sw a0,4(sp) + +000003d0 <.LBB41>: + 3d0: 85a2 mv a1,s0 + 3d2: 8526 mv a0,s1 + +000003d4 <.LVL141>: + 3d4: 00000097 auipc ra,0x0 + 3d8: 000080e7 jalr ra # 3d4 <.LVL141> + 3dc: 84aa mv s1,a0 + +000003de <.LBB42>: + 3de: 859e mv a1,t2 + 3e0: 853e mv a0,a5 + 3e2: 00000097 auipc ra,0x0 + 3e6: 000080e7 jalr ra # 3e2 <.LBB42+0x4> + 3ea: 83aa mv t2,a0 + +000003ec <.LBB43>: + 3ec: 85a2 mv a1,s0 + 3ee: 853e mv a0,a5 + 3f0: 00000097 auipc ra,0x0 + 3f4: 000080e7 jalr ra # 3f0 <.LBB43+0x4> + +000003f8 <.LBE43>: + 3f8: 4792 lw a5,4(sp) + +000003fa <.LVL145>: + 3fa: 949e add s1,s1,t2 + +000003fc <.LVL146>: + 3fc: 0107d413 srl s0,a5,0x10 + 400: 9426 add s0,s0,s1 + +00000402 <.LVL147>: + 402: 00747463 bgeu s0,t2,40a <.L45> + 406: 66c1 lui a3,0x10 + +00000408 <.LVL148>: + 408: 9536 add a0,a0,a3 + +0000040a <.L45>: + 40a: 01045793 srl a5,s0,0x10 + 40e: 4692 lw a3,4(sp) + 410: 953e add a0,a0,a5 + +00000412 <.LVL150>: + 412: 67c1 lui a5,0x10 + +00000414 <.LVL151>: + 414: 17fd add a5,a5,-1 # ffff <.LLST64+0xf395> + +00000416 <.LVL152>: + 416: 8c7d and s0,s0,a5 + +00000418 <.LVL153>: + 418: 0442 sll s0,s0,0x10 + 41a: 8ff5 and a5,a5,a3 + +0000041c <.LVL154>: + 41c: 943e add s0,s0,a5 + +0000041e <.LBE49>: + 41e: 00a2e763 bltu t0,a0,42c <.L46> + 422: 00a29e63 bne t0,a0,43e <.L47> + 426: 47b2 lw a5,12(sp) + 428: 0087fb63 bgeu a5,s0,43e <.L47> + +0000042c <.L46>: + 42c: 47a2 lw a5,8(sp) + 42e: 40f407b3 sub a5,s0,a5 + 432: 00f436b3 sltu a3,s0,a5 + 436: 843e mv s0,a5 + +00000438 <.LVL156>: + 438: 00e687b3 add a5,a3,a4 + 43c: 8d1d sub a0,a0,a5 + +0000043e <.L47>: + 43e: 47b2 lw a5,12(sp) + 440: 40a285b3 sub a1,t0,a0 + 444: 40878433 sub s0,a5,s0 + +00000448 <.LVL158>: + 448: 0087b7b3 sltu a5,a5,s0 + 44c: 8d9d sub a1,a1,a5 + +0000044e <.LBE51>: + 44e: 4782 lw a5,0(sp) + 450: 00659333 sll t1,a1,t1 + +00000454 <.LVL160>: + 454: 00f45433 srl s0,s0,a5 + +00000458 <.LVL161>: + 458: 00836533 or a0,t1,s0 + +0000045c <.LVL162>: + 45c: 00f5d5b3 srl a1,a1,a5 + +00000460 <.LVL163>: + 460: b155 j 104 <.L30> + +_udivmoddi4.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__udivmoddi4>: + 0: 7179 add sp,sp,-48 + 2: d422 sw s0,40(sp) + 4: d606 sw ra,44(sp) + 6: d226 sw s1,36(sp) + 8: c03a sw a4,0(sp) + a: c436 sw a3,8(sp) + +0000000c <.LVL1>: + c: 842a mv s0,a0 + +0000000e <.LVL2>: + e: 832e mv t1,a1 + +00000010 <.LVL3>: + 10: 2c069f63 bnez a3,2ee <.L2> + 14: 000006b7 lui a3,0x0 + +00000018 <.LVL4>: + 18: 84b2 mv s1,a2 + 1a: 00068693 mv a3,a3 + 1e: 12c5f763 bgeu a1,a2,14c <.L3> + +00000022 <.LBB2>: + 22: 67c1 lui a5,0x10 + 24: 10f67d63 bgeu a2,a5,13e <.L4> + 28: 10063793 sltiu a5,a2,256 + 2c: 0017c793 xor a5,a5,1 + 30: 078e sll a5,a5,0x3 + +00000032 <.L5>: + 32: 00f652b3 srl t0,a2,a5 + 36: 9696 add a3,a3,t0 + 38: 0006c683 lbu a3,0(a3) # 0 <__udivmoddi4> + 3c: 97b6 add a5,a5,a3 + +0000003e <.LVL7>: + 3e: 02000693 li a3,32 + 42: 40f68733 sub a4,a3,a5 + +00000046 <.LVL8>: + 46: c23a sw a4,4(sp) + +00000048 <.LBE2>: + 48: 00f68c63 beq a3,a5,60 <.L6> + 4c: 00e59333 sll t1,a1,a4 + +00000050 <.LVL10>: + 50: 00f557b3 srl a5,a0,a5 + 54: 00e614b3 sll s1,a2,a4 + +00000058 <.LVL11>: + 58: 0067e333 or t1,a5,t1 + +0000005c <.LVL12>: + 5c: 00e51433 sll s0,a0,a4 + +00000060 <.L6>: + 60: 01049793 sll a5,s1,0x10 + 64: 83c1 srl a5,a5,0x10 + 66: 851a mv a0,t1 + +00000068 <.LVL14>: + 68: 0104d593 srl a1,s1,0x10 + 6c: c63e sw a5,12(sp) + +0000006e <.LVL15>: + 6e: ca1a sw t1,20(sp) + 70: 00000097 auipc ra,0x0 + 74: 000080e7 jalr ra # 70 <.LVL15+0x2> + +00000078 <.LVL16>: + 78: 85aa mv a1,a0 + 7a: c82a sw a0,16(sp) + 7c: 01049513 sll a0,s1,0x10 + +00000080 <.LVL17>: + 80: 8141 srl a0,a0,0x10 + 82: 00000097 auipc ra,0x0 + 86: 000080e7 jalr ra # 82 <.LVL17+0x2> + +0000008a <.LVL18>: + 8a: 4352 lw t1,20(sp) + 8c: c62a sw a0,12(sp) + +0000008e <.LVL19>: + 8e: 0104d593 srl a1,s1,0x10 + 92: 851a mv a0,t1 + +00000094 <.LVL20>: + 94: 00000097 auipc ra,0x0 + 98: 000080e7 jalr ra # 94 <.LVL20> + +0000009c <.LVL21>: + 9c: 42c2 lw t0,16(sp) + 9e: 4632 lw a2,12(sp) + a0: 0542 sll a0,a0,0x10 + a2: 01045693 srl a3,s0,0x10 + a6: 8ec9 or a3,a3,a0 + +000000a8 <.LVL22>: + a8: 8796 mv a5,t0 + aa: 00c6fc63 bgeu a3,a2,c2 <.L7> + ae: 96a6 add a3,a3,s1 + +000000b0 <.LVL23>: + b0: fff28793 add a5,t0,-1 + +000000b4 <.LVL24>: + b4: 0096e763 bltu a3,s1,c2 <.L7> + b8: 00c6f563 bgeu a3,a2,c2 <.L7> + bc: ffe28793 add a5,t0,-2 + c0: 96a6 add a3,a3,s1 + +000000c2 <.L7>: + c2: cc3e sw a5,24(sp) + +000000c4 <.LVL27>: + c4: 40c687b3 sub a5,a3,a2 + +000000c8 <.L87>: + c8: 853e mv a0,a5 + ca: 0104d593 srl a1,s1,0x10 + ce: c63e sw a5,12(sp) + +000000d0 <.LVL29>: + d0: 00000097 auipc ra,0x0 + d4: 000080e7 jalr ra # d0 <.LVL29> + +000000d8 <.LVL30>: + d8: 85aa mv a1,a0 + da: ca2a sw a0,20(sp) + +000000dc <.LVL31>: + dc: 01049513 sll a0,s1,0x10 + +000000e0 <.LVL32>: + e0: 8141 srl a0,a0,0x10 + e2: 00000097 auipc ra,0x0 + e6: 000080e7 jalr ra # e2 <.LVL32+0x2> + +000000ea <.LVL33>: + ea: c82a sw a0,16(sp) + +000000ec <.LVL34>: + ec: 4532 lw a0,12(sp) + +000000ee <.LVL35>: + ee: 0104d593 srl a1,s1,0x10 + f2: 0442 sll s0,s0,0x10 + +000000f4 <.LVL36>: + f4: 00000097 auipc ra,0x0 + f8: 000080e7 jalr ra # f4 <.LVL36> + +000000fc <.LVL37>: + fc: 4652 lw a2,20(sp) + fe: 46c2 lw a3,16(sp) + 100: 0542 sll a0,a0,0x10 + 102: 8041 srl s0,s0,0x10 + 104: 8c49 or s0,s0,a0 + +00000106 <.LVL38>: + 106: 47e2 lw a5,24(sp) + 108: 85b2 mv a1,a2 + 10a: 00d47c63 bgeu s0,a3,122 <.L27> + 10e: 9426 add s0,s0,s1 + +00000110 <.LVL39>: + 110: fff60593 add a1,a2,-1 + +00000114 <.LVL40>: + 114: 00946763 bltu s0,s1,122 <.L27> + 118: 00d47563 bgeu s0,a3,122 <.L27> + 11c: ffe60593 add a1,a2,-2 + 120: 9426 add s0,s0,s1 + +00000122 <.L27>: + 122: 4702 lw a4,0(sp) + +00000124 <.LBB5>: + 124: 07c2 sll a5,a5,0x10 + 126: 8c15 sub s0,s0,a3 + 128: 8fcd or a5,a5,a1 + +0000012a <.LBE5>: + 12a: 1a071a63 bnez a4,2de <.L30> + +0000012e <.L32>: + 12e: 4722 lw a4,8(sp) + +00000130 <.L31>: + 130: 50b2 lw ra,44(sp) + 132: 5422 lw s0,40(sp) + 134: 5492 lw s1,36(sp) + 136: 853e mv a0,a5 + 138: 85ba mv a1,a4 + 13a: 6145 add sp,sp,48 + +0000013c <.LVL47>: + 13c: 8082 ret + +0000013e <.L4>: + 13e: 010002b7 lui t0,0x1000 + 142: 47c1 li a5,16 + 144: ee5667e3 bltu a2,t0,32 <.L5> + 148: 47e1 li a5,24 + 14a: b5e5 j 32 <.L5> + +0000014c <.L3>: + 14c: 4781 li a5,0 + +0000014e <.LBE22>: + 14e: ca09 beqz a2,160 <.L14> + +00000150 <.LBB23>: + 150: 67c1 lui a5,0x10 + 152: 08f67d63 bgeu a2,a5,1ec <.L15> + +00000156 <.LVL51>: + 156: 10063793 sltiu a5,a2,256 + 15a: 0017c793 xor a5,a5,1 + 15e: 078e sll a5,a5,0x3 + +00000160 <.L14>: + 160: 00f65333 srl t1,a2,a5 + 164: 969a add a3,a3,t1 + 166: 0006c683 lbu a3,0(a3) + 16a: 97b6 add a5,a5,a3 + +0000016c <.LVL53>: + 16c: 02000693 li a3,32 + 170: 40f68733 sub a4,a3,a5 + +00000174 <.LVL54>: + 174: c23a sw a4,4(sp) + +00000176 <.LBE23>: + 176: 08f69263 bne a3,a5,1fa <.L16> + 17a: 40c58633 sub a2,a1,a2 + +0000017e <.LVL56>: + 17e: 4785 li a5,1 + +00000180 <.L80>: + 180: c43e sw a5,8(sp) + +00000182 <.LBB25>: + 182: 01049793 sll a5,s1,0x10 + +00000186 <.LVL59>: + 186: 83c1 srl a5,a5,0x10 + 188: 8532 mv a0,a2 + 18a: 0104d593 srl a1,s1,0x10 + 18e: c63e sw a5,12(sp) + +00000190 <.LVL60>: + 190: ca32 sw a2,20(sp) + 192: 00000097 auipc ra,0x0 + 196: 000080e7 jalr ra # 192 <.LVL60+0x2> + +0000019a <.LVL61>: + 19a: 85aa mv a1,a0 + 19c: c82a sw a0,16(sp) + 19e: 01049513 sll a0,s1,0x10 + +000001a2 <.LVL62>: + 1a2: 8141 srl a0,a0,0x10 + 1a4: 00000097 auipc ra,0x0 + 1a8: 000080e7 jalr ra # 1a4 <.LVL62+0x2> + +000001ac <.LVL63>: + 1ac: 4652 lw a2,20(sp) + 1ae: c62a sw a0,12(sp) + +000001b0 <.LVL64>: + 1b0: 0104d593 srl a1,s1,0x10 + 1b4: 8532 mv a0,a2 + +000001b6 <.LVL65>: + 1b6: 00000097 auipc ra,0x0 + 1ba: 000080e7 jalr ra # 1b6 <.LVL65> + +000001be <.LVL66>: + 1be: 42c2 lw t0,16(sp) + 1c0: 4332 lw t1,12(sp) + 1c2: 0542 sll a0,a0,0x10 + 1c4: 01045693 srl a3,s0,0x10 + 1c8: 8ec9 or a3,a3,a0 + +000001ca <.LVL67>: + 1ca: 8796 mv a5,t0 + 1cc: 0066fc63 bgeu a3,t1,1e4 <.L24> + 1d0: 96a6 add a3,a3,s1 + +000001d2 <.LVL68>: + 1d2: fff28793 add a5,t0,-1 # ffffff <.LLST46+0xfff21d> + +000001d6 <.LVL69>: + 1d6: 0096e763 bltu a3,s1,1e4 <.L24> + 1da: 0066f563 bgeu a3,t1,1e4 <.L24> + 1de: ffe28793 add a5,t0,-2 + 1e2: 96a6 add a3,a3,s1 + +000001e4 <.L24>: + 1e4: cc3e sw a5,24(sp) + +000001e6 <.LVL72>: + 1e6: 406687b3 sub a5,a3,t1 + 1ea: bdf9 j c8 <.L87> + +000001ec <.L15>: + 1ec: 01000337 lui t1,0x1000 + +000001f0 <.LVL74>: + 1f0: 47c1 li a5,16 + 1f2: f66667e3 bltu a2,t1,160 <.L14> + 1f6: 47e1 li a5,24 + 1f8: b7a5 j 160 <.L14> + +000001fa <.L16>: + 1fa: 4712 lw a4,4(sp) + +000001fc <.LVL76>: + 1fc: 00e614b3 sll s1,a2,a4 + +00000200 <.LVL77>: + 200: 00f5d733 srl a4,a1,a5 + 204: c43a sw a4,8(sp) + +00000206 <.LVL78>: + 206: 4712 lw a4,4(sp) + +00000208 <.LVL79>: + 208: 00f557b3 srl a5,a0,a5 + +0000020c <.LVL80>: + 20c: 00e595b3 sll a1,a1,a4 + +00000210 <.LVL81>: + 210: 00e51433 sll s0,a0,a4 + +00000214 <.LVL82>: + 214: 8fcd or a5,a5,a1 + +00000216 <.LBB27>: + 216: 4522 lw a0,8(sp) + +00000218 <.LBE27>: + 218: c63e sw a5,12(sp) + +0000021a <.LBB28>: + 21a: 01049793 sll a5,s1,0x10 + +0000021e <.LVL85>: + 21e: 83c1 srl a5,a5,0x10 + 220: 0104d593 srl a1,s1,0x10 + 224: c83e sw a5,16(sp) + +00000226 <.LVL86>: + 226: 00000097 auipc ra,0x0 + 22a: 000080e7 jalr ra # 226 <.LVL86> + +0000022e <.LVL87>: + 22e: 85aa mv a1,a0 + 230: ca2a sw a0,20(sp) + 232: 01049513 sll a0,s1,0x10 + +00000236 <.LVL88>: + 236: 8141 srl a0,a0,0x10 + 238: 00000097 auipc ra,0x0 + 23c: 000080e7 jalr ra # 238 <.LVL88+0x2> + +00000240 <.LVL89>: + 240: c82a sw a0,16(sp) + +00000242 <.LVL90>: + 242: 4522 lw a0,8(sp) + +00000244 <.LVL91>: + 244: 0104d593 srl a1,s1,0x10 + 248: 00000097 auipc ra,0x0 + 24c: 000080e7 jalr ra # 248 <.LVL91+0x4> + +00000250 <.LVL92>: + 250: 47b2 lw a5,12(sp) + 252: 4352 lw t1,20(sp) + 254: 4642 lw a2,16(sp) + 256: 0542 sll a0,a0,0x10 + 258: 83c1 srl a5,a5,0x10 + 25a: 8fc9 or a5,a5,a0 + +0000025c <.LVL93>: + 25c: 869a mv a3,t1 + 25e: 00c7fc63 bgeu a5,a2,276 <.L18> + 262: 97a6 add a5,a5,s1 + +00000264 <.LVL94>: + 264: fff30693 add a3,t1,-1 # ffffff <.LLST46+0xfff21d> + +00000268 <.LVL95>: + 268: 0097e763 bltu a5,s1,276 <.L18> + 26c: 00c7f563 bgeu a5,a2,276 <.L18> + 270: ffe30693 add a3,t1,-2 + 274: 97a6 add a5,a5,s1 + +00000276 <.L18>: + 276: 8f91 sub a5,a5,a2 + +00000278 <.LVL98>: + 278: 853e mv a0,a5 + 27a: 0104d593 srl a1,s1,0x10 + 27e: cc36 sw a3,24(sp) + +00000280 <.LVL99>: + 280: c43e sw a5,8(sp) + +00000282 <.LVL100>: + 282: 00000097 auipc ra,0x0 + 286: 000080e7 jalr ra # 282 <.LVL100> + +0000028a <.LVL101>: + 28a: 85aa mv a1,a0 + 28c: ca2a sw a0,20(sp) + 28e: 01049513 sll a0,s1,0x10 + +00000292 <.LVL102>: + 292: 8141 srl a0,a0,0x10 + 294: 00000097 auipc ra,0x0 + 298: 000080e7 jalr ra # 294 <.LVL102+0x2> + +0000029c <.LVL103>: + 29c: c82a sw a0,16(sp) + +0000029e <.LVL104>: + 29e: 4522 lw a0,8(sp) + +000002a0 <.LVL105>: + 2a0: 0104d593 srl a1,s1,0x10 + 2a4: 00000097 auipc ra,0x0 + 2a8: 000080e7 jalr ra # 2a4 <.LVL105+0x4> + +000002ac <.LVL106>: + 2ac: 00c15603 lhu a2,12(sp) + 2b0: 4352 lw t1,20(sp) + 2b2: 47c2 lw a5,16(sp) + 2b4: 0542 sll a0,a0,0x10 + 2b6: 8e49 or a2,a2,a0 + +000002b8 <.LVL107>: + 2b8: 46e2 lw a3,24(sp) + 2ba: 859a mv a1,t1 + 2bc: 00f67c63 bgeu a2,a5,2d4 <.L21> + 2c0: 9626 add a2,a2,s1 + +000002c2 <.LVL108>: + 2c2: fff30593 add a1,t1,-1 + +000002c6 <.LVL109>: + 2c6: 00966763 bltu a2,s1,2d4 <.L21> + 2ca: 00f67563 bgeu a2,a5,2d4 <.L21> + 2ce: ffe30593 add a1,t1,-2 + 2d2: 9626 add a2,a2,s1 + +000002d4 <.L21>: + 2d4: 06c2 sll a3,a3,0x10 + 2d6: 8e1d sub a2,a2,a5 + 2d8: 00b6e7b3 or a5,a3,a1 + 2dc: b555 j 180 <.L80> + +000002de <.L30>: + 2de: 4712 lw a4,4(sp) + 2e0: 00e45433 srl s0,s0,a4 + +000002e4 <.LVL114>: + 2e4: 4702 lw a4,0(sp) + 2e6: c300 sw s0,0(a4) + 2e8: 00072223 sw zero,4(a4) + 2ec: b589 j 12e <.L32> + +000002ee <.L2>: + 2ee: 00d5fb63 bgeu a1,a3,304 <.L33> + +000002f2 <.LVL116>: + 2f2: 4782 lw a5,0(sp) + 2f4: e781 bnez a5,2fc <.L34> + +000002f6 <.L35>: + 2f6: 4701 li a4,0 + +000002f8 <.LVL117>: + 2f8: 4781 li a5,0 + 2fa: bd1d j 130 <.L31> + +000002fc <.L34>: + 2fc: 4782 lw a5,0(sp) + 2fe: c388 sw a0,0(a5) + 300: c3cc sw a1,4(a5) + 302: bfd5 j 2f6 <.L35> + +00000304 <.L33>: + 304: 67c1 lui a5,0x10 + 306: 04f6fe63 bgeu a3,a5,362 <.L36> + 30a: 1006b793 sltiu a5,a3,256 + 30e: 0017c793 xor a5,a5,1 + 312: 078e sll a5,a5,0x3 + +00000314 <.L37>: + 314: 00000737 lui a4,0x0 + 318: 00f6d2b3 srl t0,a3,a5 + 31c: 00070713 mv a4,a4 + 320: 9716 add a4,a4,t0 + 322: 00074703 lbu a4,0(a4) # 0 <__udivmoddi4> + 326: 00f703b3 add t2,a4,a5 + 32a: 02000793 li a5,32 + +0000032e <.LVL121>: + 32e: 40778733 sub a4,a5,t2 + +00000332 <.LBE29>: + 332: 02779f63 bne a5,t2,370 <.L38> + 336: 00b6e563 bltu a3,a1,340 <.L39> + 33a: 4781 li a5,0 + 33c: 00c56c63 bltu a0,a2,354 <.L40> + +00000340 <.L39>: + 340: 40c50633 sub a2,a0,a2 + +00000344 <.LVL124>: + 344: 40d586b3 sub a3,a1,a3 + +00000348 <.LVL125>: + 348: 00c53333 sltu t1,a0,a2 + +0000034c <.LVL126>: + 34c: 8432 mv s0,a2 + +0000034e <.LVL127>: + 34e: 40668333 sub t1,a3,t1 + +00000352 <.LBE30>: + 352: 4785 li a5,1 + +00000354 <.L40>: + 354: 4682 lw a3,0(sp) + 356: dc068de3 beqz a3,130 <.L31> + 35a: c280 sw s0,0(a3) + 35c: 0066a223 sw t1,4(a3) + 360: bbc1 j 130 <.L31> + +00000362 <.L36>: + 362: 01000737 lui a4,0x1000 + +00000366 <.LVL131>: + 366: 47c1 li a5,16 + 368: fae6e6e3 bltu a3,a4,314 <.L37> + 36c: 47e1 li a5,24 + 36e: b75d j 314 <.L37> + +00000370 <.L38>: + 370: 007657b3 srl a5,a2,t2 + 374: 00e696b3 sll a3,a3,a4 + +00000378 <.LVL133>: + 378: 00d7e4b3 or s1,a5,a3 + +0000037c <.LVL134>: + 37c: 00e617b3 sll a5,a2,a4 + 380: 0075d433 srl s0,a1,t2 + +00000384 <.LVL135>: + 384: c23e sw a5,4(sp) + +00000386 <.LVL136>: + 386: 00e595b3 sll a1,a1,a4 + 38a: 007557b3 srl a5,a0,t2 + +0000038e <.LVL137>: + 38e: 8fcd or a5,a5,a1 + 390: c63e sw a5,12(sp) + +00000392 <.LVL138>: + 392: 00e517b3 sll a5,a0,a4 + +00000396 <.LVL139>: + 396: c43e sw a5,8(sp) + +00000398 <.LBB8>: + 398: 01049793 sll a5,s1,0x10 + +0000039c <.LVL141>: + 39c: 83c1 srl a5,a5,0x10 + 39e: 0104d593 srl a1,s1,0x10 + 3a2: 8522 mv a0,s0 + +000003a4 <.LBE8>: + 3a4: ce1e sw t2,28(sp) + 3a6: cc3a sw a4,24(sp) + +000003a8 <.LBB9>: + 3a8: c83e sw a5,16(sp) + +000003aa <.LVL143>: + 3aa: 00000097 auipc ra,0x0 + 3ae: 000080e7 jalr ra # 3aa <.LVL143> + +000003b2 <.LVL144>: + 3b2: 85aa mv a1,a0 + 3b4: ca2a sw a0,20(sp) + 3b6: 01049513 sll a0,s1,0x10 + +000003ba <.LVL145>: + 3ba: 8141 srl a0,a0,0x10 + 3bc: 00000097 auipc ra,0x0 + 3c0: 000080e7 jalr ra # 3bc <.LVL145+0x2> + +000003c4 <.LVL146>: + 3c4: c82a sw a0,16(sp) + +000003c6 <.LVL147>: + 3c6: 0104d593 srl a1,s1,0x10 + 3ca: 8522 mv a0,s0 + +000003cc <.LVL148>: + 3cc: 00000097 auipc ra,0x0 + 3d0: 000080e7 jalr ra # 3cc <.LVL148> + +000003d4 <.LVL149>: + 3d4: 47b2 lw a5,12(sp) + 3d6: 4652 lw a2,20(sp) + 3d8: 46c2 lw a3,16(sp) + 3da: 0107d413 srl s0,a5,0x10 + +000003de <.LVL150>: + 3de: 0542 sll a0,a0,0x10 + 3e0: 8c49 or s0,s0,a0 + +000003e2 <.LVL151>: + 3e2: 4762 lw a4,24(sp) + 3e4: 43f2 lw t2,28(sp) + 3e6: 87b2 mv a5,a2 + 3e8: 00d47c63 bgeu s0,a3,400 <.L45> + +000003ec <.LVL152>: + 3ec: 9426 add s0,s0,s1 + +000003ee <.LVL153>: + 3ee: fff60793 add a5,a2,-1 + +000003f2 <.LVL154>: + 3f2: 00946763 bltu s0,s1,400 <.L45> + 3f6: 00d47563 bgeu s0,a3,400 <.L45> + 3fa: ffe60793 add a5,a2,-2 + 3fe: 9426 add s0,s0,s1 + +00000400 <.L45>: + 400: d03e sw a5,32(sp) + 402: 40d407b3 sub a5,s0,a3 + +00000406 <.LVL157>: + 406: 853e mv a0,a5 + 408: 0104d593 srl a1,s1,0x10 + 40c: ce3a sw a4,28(sp) + 40e: cc1e sw t2,24(sp) + 410: c83e sw a5,16(sp) + +00000412 <.LVL158>: + 412: 00000097 auipc ra,0x0 + 416: 000080e7 jalr ra # 412 <.LVL158> + +0000041a <.LVL159>: + 41a: 85aa mv a1,a0 + 41c: ca2a sw a0,20(sp) + 41e: 01049513 sll a0,s1,0x10 + +00000422 <.LVL160>: + 422: 8141 srl a0,a0,0x10 + 424: 00000097 auipc ra,0x0 + 428: 000080e7 jalr ra # 424 <.LVL160+0x2> + +0000042c <.LVL161>: + 42c: 842a mv s0,a0 + +0000042e <.LVL162>: + 42e: 4542 lw a0,16(sp) + 430: 0104d593 srl a1,s1,0x10 + 434: 00000097 auipc ra,0x0 + 438: 000080e7 jalr ra # 434 <.LVL162+0x6> + +0000043c <.LVL163>: + 43c: 00c15583 lhu a1,12(sp) + 440: 4652 lw a2,20(sp) + 442: 0542 sll a0,a0,0x10 + 444: 8dc9 or a1,a1,a0 + +00000446 <.LVL164>: + 446: 43e2 lw t2,24(sp) + 448: 4772 lw a4,28(sp) + 44a: 5782 lw a5,32(sp) + 44c: 8532 mv a0,a2 + 44e: 0085fc63 bgeu a1,s0,466 <.L48> + +00000452 <.LVL165>: + 452: 95a6 add a1,a1,s1 + +00000454 <.LVL166>: + 454: fff60513 add a0,a2,-1 + +00000458 <.LVL167>: + 458: 0095e763 bltu a1,s1,466 <.L48> + 45c: 0085f563 bgeu a1,s0,466 <.L48> + 460: ffe60513 add a0,a2,-2 + 464: 95a6 add a1,a1,s1 + +00000466 <.L48>: + 466: 408586b3 sub a3,a1,s0 + +0000046a <.LBB10>: + 46a: 4592 lw a1,4(sp) + +0000046c <.LBB15>: + 46c: c636 sw a3,12(sp) + +0000046e <.LVL171>: + 46e: 07c2 sll a5,a5,0x10 + +00000470 <.LBB16>: + 470: 66c1 lui a3,0x10 + +00000472 <.LBB17>: + 472: 8fc9 or a5,a5,a0 + +00000474 <.LBB18>: + 474: fff68313 add t1,a3,-1 # ffff <.LLST46+0xf21d> + 478: 0067f433 and s0,a5,t1 + +0000047c <.LVL174>: + 47c: 0065f333 and t1,a1,t1 + +00000480 <.LVL175>: + 480: 0105d293 srl t0,a1,0x10 + +00000484 <.LBB11>: + 484: 8522 mv a0,s0 + +00000486 <.LVL176>: + 486: 859a mv a1,t1 + 488: 00000097 auipc ra,0x0 + 48c: 000080e7 jalr ra # 488 <.LVL176+0x2> + 490: c82a sw a0,16(sp) + +00000492 <.LBB12>: + 492: 8596 mv a1,t0 + 494: 8522 mv a0,s0 + +00000496 <.LVL178>: + 496: 00000097 auipc ra,0x0 + 49a: 000080e7 jalr ra # 496 <.LVL178> + 49e: 842a mv s0,a0 + +000004a0 <.LBB13>: + 4a0: 859a mv a1,t1 + 4a2: 0107d513 srl a0,a5,0x10 + +000004a6 <.LVL180>: + 4a6: 00000097 auipc ra,0x0 + 4aa: 000080e7 jalr ra # 4a6 <.LVL180> + +000004ae <.LVL181>: + 4ae: 832a mv t1,a0 + +000004b0 <.LBB14>: + 4b0: 8596 mv a1,t0 + 4b2: 0107d513 srl a0,a5,0x10 + +000004b6 <.LVL183>: + 4b6: 00000097 auipc ra,0x0 + 4ba: 000080e7 jalr ra # 4b6 <.LVL183> + +000004be <.LBE14>: + 4be: 45c2 lw a1,16(sp) + 4c0: 941a add s0,s0,t1 + +000004c2 <.LVL185>: + 4c2: 0105d693 srl a3,a1,0x10 + 4c6: 96a2 add a3,a3,s0 + +000004c8 <.LVL186>: + 4c8: 0066f463 bgeu a3,t1,4d0 <.L51> + 4cc: 6641 lui a2,0x10 + +000004ce <.LVL187>: + 4ce: 9532 add a0,a0,a2 + +000004d0 <.L51>: + 4d0: 0106d613 srl a2,a3,0x10 + 4d4: 45c2 lw a1,16(sp) + 4d6: 9532 add a0,a0,a2 + +000004d8 <.LVL189>: + 4d8: 6641 lui a2,0x10 + +000004da <.LVL190>: + 4da: 167d add a2,a2,-1 # ffff <.LLST46+0xf21d> + +000004dc <.LVL191>: + 4dc: 8ef1 and a3,a3,a2 + +000004de <.LVL192>: + 4de: 06c2 sll a3,a3,0x10 + 4e0: 8e6d and a2,a2,a1 + +000004e2 <.LVL193>: + 4e2: 96b2 add a3,a3,a2 + +000004e4 <.LBE18>: + 4e4: 4632 lw a2,12(sp) + 4e6: 00a66763 bltu a2,a0,4f4 <.L52> + 4ea: 00a61f63 bne a2,a0,508 <.L53> + 4ee: 4622 lw a2,8(sp) + 4f0: 00d67c63 bgeu a2,a3,508 <.L53> + +000004f4 <.L52>: + 4f4: 4612 lw a2,4(sp) + 4f6: 17fd add a5,a5,-1 # ffff <.LLST46+0xf21d> + +000004f8 <.LBB19>: + 4f8: 40c68633 sub a2,a3,a2 + 4fc: 00c6b5b3 sltu a1,a3,a2 + 500: 86b2 mv a3,a2 + +00000502 <.LVL196>: + 502: 00958633 add a2,a1,s1 + +00000506 <.LVL197>: + 506: 8d11 sub a0,a0,a2 + +00000508 <.L53>: + 508: 4602 lw a2,0(sp) + 50a: c60d beqz a2,534 <.L56> + +0000050c <.LBB20>: + 50c: 4622 lw a2,8(sp) + 50e: 40d606b3 sub a3,a2,a3 + +00000512 <.LVL199>: + 512: 4632 lw a2,12(sp) + 514: 40a604b3 sub s1,a2,a0 + +00000518 <.LVL200>: + 518: 4622 lw a2,8(sp) + 51a: 00d63633 sltu a2,a2,a3 + 51e: 8c91 sub s1,s1,a2 + +00000520 <.LBE20>: + 520: 00749633 sll a2,s1,t2 + 524: 00e6d6b3 srl a3,a3,a4 + +00000528 <.LVL202>: + 528: 00e4d4b3 srl s1,s1,a4 + +0000052c <.LVL203>: + 52c: 4702 lw a4,0(sp) + +0000052e <.LVL204>: + 52e: 8ed1 or a3,a3,a2 + 530: c314 sw a3,0(a4) + 532: c344 sw s1,4(a4) + +00000534 <.L56>: + 534: 4701 li a4,0 + 536: beed j 130 <.L31> + +_udiv_w_sdiv.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__udiv_w_sdiv>: + 0: 4501 li a0,0 + +00000002 <.LVL1>: + 2: 8082 ret + +adddf3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__adddf3>: + 0: 00100737 lui a4,0x100 + 4: 177d add a4,a4,-1 # fffff <.LLST32+0xfef49> + +00000006 <.LBE2>: + 6: 1131 add sp,sp,-20 + +00000008 <.LBB3>: + 8: 00b777b3 and a5,a4,a1 + +0000000c <.LBB4>: + c: 0146d313 srl t1,a3,0x14 + 10: 8f75 and a4,a4,a3 + +00000012 <.LBE4>: + 12: c622 sw s0,12(sp) + 14: c426 sw s1,8(sp) + +00000016 <.LBB5>: + 16: 01f5d413 srl s0,a1,0x1f + 1a: 0145d493 srl s1,a1,0x14 + +0000001e <.LBE5>: + 1e: 00379593 sll a1,a5,0x3 + 22: 01d55793 srl a5,a0,0x1d + +00000026 <.LBB7>: + 26: 7ff4f493 and s1,s1,2047 + +0000002a <.LBE7>: + 2a: 8fcd or a5,a5,a1 + +0000002c <.LBB9>: + 2c: 7ff37313 and t1,t1,2047 + +00000030 <.LBE9>: + 30: 01d65593 srl a1,a2,0x1d + 34: 070e sll a4,a4,0x3 + 36: c806 sw ra,16(sp) + +00000038 <.LBB11>: + 38: 82fd srl a3,a3,0x1f + +0000003a <.LBE11>: + 3a: 050e sll a0,a0,0x3 + +0000003c <.LBB13>: + 3c: 8dd9 or a1,a1,a4 + +0000003e <.LVL6>: + 3e: 060e sll a2,a2,0x3 + +00000040 <.LVL7>: + 40: 406482b3 sub t0,s1,t1 + 44: 26d41963 bne s0,a3,2b6 <.L2> + +00000048 <.LBB15>: + 48: 12505263 blez t0,16c <.L3> + +0000004c <.LVL9>: + 4c: 06031e63 bnez t1,c8 <.L4> + 50: 00c5e733 or a4,a1,a2 + 54: 5a070c63 beqz a4,60c <.L107> + 58: fff28713 add a4,t0,-1 + +0000005c <.LVL10>: + 5c: ef39 bnez a4,ba <.L6> + +0000005e <.L160>: + 5e: 962a add a2,a2,a0 + +00000060 <.LVL12>: + 60: 00a63733 sltu a4,a2,a0 + +00000064 <.LVL13>: + 64: 95be add a1,a1,a5 + +00000066 <.LVL14>: + 66: 00e587b3 add a5,a1,a4 + +0000006a <.LBE16>: + 6a: 00800737 lui a4,0x800 + 6e: 8f7d and a4,a4,a5 + +00000070 <.LBB17>: + 70: 8532 mv a0,a2 + +00000072 <.LBE17>: + 72: 22071463 bnez a4,29a <.L98> + +00000076 <.L153>: + 76: 4485 li s1,1 + +00000078 <.L5>: + 78: 00757713 and a4,a0,7 + 7c: cf01 beqz a4,94 <.L87> + 7e: 00f57713 and a4,a0,15 + 82: 4691 li a3,4 + 84: 00d70863 beq a4,a3,94 <.L87> + +00000088 <.LBB57>: + 88: 00450713 add a4,a0,4 + 8c: 00a736b3 sltu a3,a4,a0 + 90: 97b6 add a5,a5,a3 + +00000092 <.LVL19>: + 92: 853a mv a0,a4 + +00000094 <.L87>: + 94: 00800737 lui a4,0x800 + 98: 8f7d and a4,a4,a5 + 9a: 56070f63 beqz a4,618 <.L90> + +0000009e <.LVL21>: + 9e: 0485 add s1,s1,1 + +000000a0 <.LVL22>: + a0: 7ff00713 li a4,2047 + a4: 08e48463 beq s1,a4,12c <.L124> + a8: ff800737 lui a4,0xff800 + ac: 177d add a4,a4,-1 # ff7fffff <.LLST32+0xff7fef49> + ae: 8ff9 and a5,a5,a4 + +000000b0 <.LVL23>: + b0: 810d srl a0,a0,0x3 + +000000b2 <.LVL24>: + b2: 01d79713 sll a4,a5,0x1d + b6: 8f49 or a4,a4,a0 + b8: ab11 j 5cc <.L157> + +000000ba <.L6>: + ba: 7ff00693 li a3,2047 + +000000be <.LVL26>: + be: 06d29963 bne t0,a3,130 <.L10> + +000000c2 <.L121>: + c2: 7ff00493 li s1,2047 + +000000c6 <.LVL28>: + c6: bf4d j 78 <.L5> + +000000c8 <.L4>: + c8: 7ff00713 li a4,2047 + cc: fae486e3 beq s1,a4,78 <.L5> + +000000d0 <.LVL30>: + d0: 03800713 li a4,56 + d4: 06574263 blt a4,t0,138 <.L95> + d8: 00800737 lui a4,0x800 + dc: 8dd9 or a1,a1,a4 + +000000de <.LVL31>: + de: 8716 mv a4,t0 + +000000e0 <.L12>: + e0: 46fd li a3,31 + e2: 04e6ce63 blt a3,a4,13e <.L13> + e6: 02000313 li t1,32 + +000000ea <.LVL33>: + ea: 40e30333 sub t1,t1,a4 + ee: 006596b3 sll a3,a1,t1 + f2: 00e652b3 srl t0,a2,a4 + f6: 00661333 sll t1,a2,t1 + fa: 0056e6b3 or a3,a3,t0 + fe: 00603333 snez t1,t1 + 102: 0066e6b3 or a3,a3,t1 + +00000106 <.LVL34>: + 106: 00e5d733 srl a4,a1,a4 + +0000010a <.L11>: + 10a: 9536 add a0,a0,a3 + +0000010c <.LVL36>: + 10c: 973e add a4,a4,a5 + +0000010e <.LVL37>: + 10e: 00d536b3 sltu a3,a0,a3 + +00000112 <.LVL38>: + 112: 00d707b3 add a5,a4,a3 + +00000116 <.L17>: + 116: 00800737 lui a4,0x800 + 11a: 8f7d and a4,a4,a5 + 11c: df31 beqz a4,78 <.L5> + +0000011e <.LVL40>: + 11e: 0485 add s1,s1,1 + +00000120 <.LVL41>: + 120: 7ff00713 li a4,2047 + 124: 16e49c63 bne s1,a4,29c <.L9> + +00000128 <.L35>: + 128: 7ff00493 li s1,2047 + +0000012c <.L124>: + 12c: 4781 li a5,0 + 12e: a299 j 274 <.L158> + +00000130 <.L10>: + 130: 03800693 li a3,56 + 134: fae6d6e3 bge a3,a4,e0 <.L12> + +00000138 <.L95>: + 138: 4701 li a4,0 + 13a: 4685 li a3,1 + 13c: b7f9 j 10a <.L11> + +0000013e <.L13>: + 13e: fe070693 add a3,a4,-32 # 7fffe0 <.LLST32+0x7fef2a> + 142: 02000293 li t0,32 + 146: 00d5d6b3 srl a3,a1,a3 + 14a: 4301 li t1,0 + +0000014c <.LVL46>: + 14c: 00570863 beq a4,t0,15c <.L14> + 150: 04000313 li t1,64 + 154: 40e30333 sub t1,t1,a4 + 158: 00659333 sll t1,a1,t1 + +0000015c <.L14>: + 15c: 00c36333 or t1,t1,a2 + 160: 00603333 snez t1,t1 + 164: 0066e6b3 or a3,a3,t1 + +00000168 <.LVL47>: + 168: 4701 li a4,0 + +0000016a <.LVL48>: + 16a: b745 j 10a <.L11> + +0000016c <.L3>: + 16c: 0a028c63 beqz t0,224 <.L18> + 170: 409306b3 sub a3,t1,s1 + +00000174 <.LVL50>: + 174: e085 bnez s1,194 <.L19> + 176: 00a7e733 or a4,a5,a0 + 17a: 48070263 beqz a4,5fe <.L97> + 17e: fff68713 add a4,a3,-1 + +00000182 <.LVL51>: + 182: ec070ee3 beqz a4,5e <.L160> + 186: 7ff00293 li t0,2047 + 18a: 04569f63 bne a3,t0,1e8 <.L146> + +0000018e <.L105>: + 18e: 87ae mv a5,a1 + +00000190 <.LVL53>: + 190: 8532 mv a0,a2 + +00000192 <.LVL54>: + 192: bf05 j c2 <.L121> + +00000194 <.L19>: + 194: 7ff00713 li a4,2047 + 198: fee30be3 beq t1,a4,18e <.L105> + +0000019c <.LVL56>: + 19c: 03800713 li a4,56 + 1a0: 04d74863 blt a4,a3,1f0 <.L102> + 1a4: 00800737 lui a4,0x800 + 1a8: 8fd9 or a5,a5,a4 + +000001aa <.LVL57>: + 1aa: 8736 mv a4,a3 + +000001ac <.L25>: + 1ac: 46fd li a3,31 + 1ae: 04e6c463 blt a3,a4,1f6 <.L26> + 1b2: 02000293 li t0,32 + 1b6: 40e282b3 sub t0,t0,a4 + 1ba: 005796b3 sll a3,a5,t0 + 1be: 00e553b3 srl t2,a0,a4 + 1c2: 005512b3 sll t0,a0,t0 + 1c6: 0076e6b3 or a3,a3,t2 + 1ca: 005032b3 snez t0,t0 + 1ce: 0056e6b3 or a3,a3,t0 + +000001d2 <.LVL59>: + 1d2: 00e7d733 srl a4,a5,a4 + +000001d6 <.L24>: + 1d6: 9636 add a2,a2,a3 + +000001d8 <.LVL61>: + 1d8: 972e add a4,a4,a1 + +000001da <.LVL62>: + 1da: 00d636b3 sltu a3,a2,a3 + +000001de <.LVL63>: + 1de: 8532 mv a0,a2 + +000001e0 <.LVL64>: + 1e0: 00d707b3 add a5,a4,a3 + +000001e4 <.LBB73>: + 1e4: 849a mv s1,t1 + +000001e6 <.LBB74>: + 1e6: bf05 j 116 <.L17> + +000001e8 <.L146>: + 1e8: 03800693 li a3,56 + 1ec: fce6d0e3 bge a3,a4,1ac <.L25> + +000001f0 <.L102>: + 1f0: 4701 li a4,0 + 1f2: 4685 li a3,1 + 1f4: b7cd j 1d6 <.L24> + +000001f6 <.L26>: + 1f6: fe070693 add a3,a4,-32 # 7fffe0 <.LLST32+0x7fef2a> + 1fa: 02000393 li t2,32 + 1fe: 00d7d6b3 srl a3,a5,a3 + 202: 4281 li t0,0 + 204: 00770863 beq a4,t2,214 <.L27> + 208: 04000293 li t0,64 + 20c: 40e282b3 sub t0,t0,a4 + 210: 005792b3 sll t0,a5,t0 + +00000214 <.L27>: + 214: 00a2e2b3 or t0,t0,a0 + 218: 005032b3 snez t0,t0 + 21c: 0056e6b3 or a3,a3,t0 + +00000220 <.LVL70>: + 220: 4701 li a4,0 + +00000222 <.LVL71>: + 222: bf55 j 1d6 <.L24> + +00000224 <.L18>: + 224: 00148713 add a4,s1,1 + 228: 7fe77693 and a3,a4,2046 + +0000022c <.LVL73>: + 22c: e6b1 bnez a3,278 <.L30> + 22e: 00a7e733 or a4,a5,a0 + 232: e885 bnez s1,262 <.L31> + +00000234 <.LVL74>: + 234: 3c070963 beqz a4,606 <.L104> + 238: 00c5e733 or a4,a1,a2 + 23c: e2070ee3 beqz a4,78 <.L5> + +00000240 <.LBB25>: + 240: 962a add a2,a2,a0 + +00000242 <.LVL75>: + 242: 00a63733 sltu a4,a2,a0 + 246: 95be add a1,a1,a5 + +00000248 <.LVL76>: + 248: 00e587b3 add a5,a1,a4 + +0000024c <.LBE25>: + 24c: 00800737 lui a4,0x800 + 250: 8f7d and a4,a4,a5 + +00000252 <.LBB26>: + 252: 8532 mv a0,a2 + +00000254 <.LBE26>: + 254: e20702e3 beqz a4,78 <.L5> + 258: ff800737 lui a4,0xff800 + 25c: 177d add a4,a4,-1 # ff7fffff <.LLST32+0xff7fef49> + 25e: 8ff9 and a5,a5,a4 + +00000260 <.LVL79>: + 260: bd19 j 76 <.L153> + +00000262 <.L31>: + 262: d715 beqz a4,18e <.L105> + 264: 8e4d or a2,a2,a1 + +00000266 <.LVL81>: + 266: e4060ee3 beqz a2,c2 <.L121> + +0000026a <.L156>: + 26a: 4401 li s0,0 + +0000026c <.LBB76>: + 26c: 7ff00493 li s1,2047 + +00000270 <.LBB77>: + 270: 000807b7 lui a5,0x80 + +00000274 <.L158>: + 274: 4701 li a4,0 + 276: aea1 j 5ce <.L34> + +00000278 <.L30>: + 278: 7ff00693 li a3,2047 + 27c: ead706e3 beq a4,a3,128 <.L35> + 280: 962a add a2,a2,a0 + +00000282 <.LBB29>: + 282: 00a63533 sltu a0,a2,a0 + +00000286 <.LVL88>: + 286: 95be add a1,a1,a5 + +00000288 <.LVL89>: + 288: 95aa add a1,a1,a0 + +0000028a <.LBE29>: + 28a: 01f59513 sll a0,a1,0x1f + 28e: 8205 srl a2,a2,0x1 + +00000290 <.LVL90>: + 290: 8d51 or a0,a0,a2 + 292: 0015d793 srl a5,a1,0x1 + +00000296 <.LVL91>: + 296: 84ba mv s1,a4 + +00000298 <.LVL92>: + 298: b3c5 j 78 <.L5> + +0000029a <.L98>: + 29a: 4489 li s1,2 + +0000029c <.L9>: + 29c: ff800737 lui a4,0xff800 + 2a0: 177d add a4,a4,-1 # ff7fffff <.LLST32+0xff7fef49> + 2a2: 8ff9 and a5,a5,a4 + +000002a4 <.LVL95>: + 2a4: 00155713 srl a4,a0,0x1 + 2a8: 8905 and a0,a0,1 + 2aa: 8f49 or a4,a4,a0 + 2ac: 01f79513 sll a0,a5,0x1f + 2b0: 8d59 or a0,a0,a4 + 2b2: 8385 srl a5,a5,0x1 + 2b4: b3d1 j 78 <.L5> + +000002b6 <.L2>: + 2b6: 0c505d63 blez t0,390 <.L38> + +000002ba <.LVL97>: + 2ba: 02031f63 bnez t1,2f8 <.L39> + 2be: 00c5e733 or a4,a1,a2 + 2c2: 34070563 beqz a4,60c <.L107> + 2c6: fff28713 add a4,t0,-1 + +000002ca <.LVL98>: + 2ca: ef01 bnez a4,2e2 <.L40> + +000002cc <.LBB33>: + 2cc: 40c50633 sub a2,a0,a2 + +000002d0 <.LVL99>: + 2d0: 00c53733 sltu a4,a0,a2 + +000002d4 <.LVL100>: + 2d4: 40b785b3 sub a1,a5,a1 + +000002d8 <.LVL101>: + 2d8: 8532 mv a0,a2 + +000002da <.LVL102>: + 2da: 40e587b3 sub a5,a1,a4 + +000002de <.L150>: + 2de: 4485 li s1,1 + +000002e0 <.LBB81>: + 2e0: a0b5 j 34c <.L43> + +000002e2 <.L40>: + 2e2: 7ff00693 li a3,2047 + +000002e6 <.LVL106>: + 2e6: dcd28ee3 beq t0,a3,c2 <.L121> + +000002ea <.L44>: + 2ea: 03800693 li a3,56 + 2ee: 02e6d163 bge a3,a4,310 <.L46> + +000002f2 <.L110>: + 2f2: 4701 li a4,0 + 2f4: 4685 li a3,1 + 2f6: a091 j 33a <.L45> + +000002f8 <.L39>: + 2f8: 7ff00713 li a4,2047 + 2fc: d6e48ee3 beq s1,a4,78 <.L5> + +00000300 <.LVL109>: + 300: 03800713 li a4,56 + 304: fe5747e3 blt a4,t0,2f2 <.L110> + 308: 00800737 lui a4,0x800 + 30c: 8dd9 or a1,a1,a4 + +0000030e <.LVL110>: + 30e: 8716 mv a4,t0 + +00000310 <.L46>: + 310: 46fd li a3,31 + 312: 04e6c863 blt a3,a4,362 <.L47> + 316: 02000313 li t1,32 + +0000031a <.LVL112>: + 31a: 40e30333 sub t1,t1,a4 + 31e: 006596b3 sll a3,a1,t1 + 322: 00e652b3 srl t0,a2,a4 + 326: 00661333 sll t1,a2,t1 + 32a: 0056e6b3 or a3,a3,t0 + 32e: 00603333 snez t1,t1 + 332: 0066e6b3 or a3,a3,t1 + +00000336 <.LVL113>: + 336: 00e5d733 srl a4,a1,a4 + +0000033a <.L45>: + 33a: 40d506b3 sub a3,a0,a3 + +0000033e <.LVL115>: + 33e: 00d53633 sltu a2,a0,a3 + 342: 40e78733 sub a4,a5,a4 + +00000346 <.LVL116>: + 346: 8536 mv a0,a3 + +00000348 <.LVL117>: + 348: 40c707b3 sub a5,a4,a2 + +0000034c <.L43>: + 34c: 00800337 lui t1,0x800 + 350: 0067f733 and a4,a5,t1 + 354: d20702e3 beqz a4,78 <.L5> + +00000358 <.LBB36>: + 358: 137d add t1,t1,-1 # 7fffff <.LLST32+0x7fef49> + 35a: 0067f333 and t1,a5,t1 + +0000035e <.LVL119>: + 35e: 82aa mv t0,a0 + 360: a24d j 502 <.L77> + +00000362 <.L47>: + 362: fe070693 add a3,a4,-32 # 7fffe0 <.LLST32+0x7fef2a> + 366: 02000293 li t0,32 + 36a: 00d5d6b3 srl a3,a1,a3 + 36e: 4301 li t1,0 + +00000370 <.LVL121>: + 370: 00570863 beq a4,t0,380 <.L48> + 374: 04000313 li t1,64 + 378: 40e30333 sub t1,t1,a4 + 37c: 00659333 sll t1,a1,t1 + +00000380 <.L48>: + 380: 00c36333 or t1,t1,a2 + 384: 00603333 snez t1,t1 + 388: 0066e6b3 or a3,a3,t1 + +0000038c <.LVL122>: + 38c: 4701 li a4,0 + +0000038e <.LVL123>: + 38e: b775 j 33a <.L45> + +00000390 <.L38>: + 390: 0c028863 beqz t0,460 <.L51> + 394: 409302b3 sub t0,t1,s1 + +00000398 <.LVL125>: + 398: e895 bnez s1,3cc <.L52> + 39a: 00a7e733 or a4,a5,a0 + 39e: 26070963 beqz a4,610 <.L112> + 3a2: fff28713 add a4,t0,-1 + +000003a6 <.LVL126>: + 3a6: eb11 bnez a4,3ba <.L53> + +000003a8 <.LBB43>: + 3a8: 40a60533 sub a0,a2,a0 + +000003ac <.LVL128>: + 3ac: 8d9d sub a1,a1,a5 + +000003ae <.LVL129>: + 3ae: 00a63633 sltu a2,a2,a0 + +000003b2 <.LVL130>: + 3b2: 40c587b3 sub a5,a1,a2 + +000003b6 <.LBE43>: + 3b6: 8436 mv s0,a3 + +000003b8 <.LVL132>: + 3b8: b71d j 2de <.L150> + +000003ba <.L53>: + 3ba: 7ff00393 li t2,2047 + 3be: 06729363 bne t0,t2,424 <.L148> + +000003c2 <.L114>: + 3c2: 87ae mv a5,a1 + +000003c4 <.LVL135>: + 3c4: 8532 mv a0,a2 + +000003c6 <.LBB83>: + 3c6: 7ff00493 li s1,2047 + +000003ca <.LVL137>: + 3ca: a855 j 47e <.L152> + +000003cc <.L52>: + 3cc: 7ff00713 li a4,2047 + 3d0: fee309e3 beq t1,a4,3c2 <.L114> + +000003d4 <.LVL139>: + 3d4: 03800713 li a4,56 + 3d8: 04574a63 blt a4,t0,42c <.L116> + 3dc: 00800737 lui a4,0x800 + 3e0: 8fd9 or a5,a5,a4 + +000003e2 <.LVL140>: + 3e2: 8716 mv a4,t0 + +000003e4 <.L58>: + 3e4: 42fd li t0,31 + 3e6: 04e2c663 blt t0,a4,432 <.L59> + 3ea: 02000393 li t2,32 + 3ee: 40e383b3 sub t2,t2,a4 + 3f2: 00e55433 srl s0,a0,a4 + +000003f6 <.LVL142>: + 3f6: 007792b3 sll t0,a5,t2 + 3fa: 007513b3 sll t2,a0,t2 + 3fe: 0082e2b3 or t0,t0,s0 + 402: 007033b3 snez t2,t2 + 406: 0072e533 or a0,t0,t2 + 40a: 00e7d733 srl a4,a5,a4 + +0000040e <.L57>: + 40e: 40a60533 sub a0,a2,a0 + +00000412 <.LVL145>: + 412: 40e58733 sub a4,a1,a4 + +00000416 <.LVL146>: + 416: 00a63633 sltu a2,a2,a0 + +0000041a <.LVL147>: + 41a: 40c707b3 sub a5,a4,a2 + +0000041e <.LBB84>: + 41e: 849a mv s1,t1 + +00000420 <.LBB85>: + 420: 8436 mv s0,a3 + 422: b72d j 34c <.L43> + +00000424 <.L148>: + 424: 03800293 li t0,56 + 428: fae2dee3 bge t0,a4,3e4 <.L58> + +0000042c <.L116>: + 42c: 4701 li a4,0 + 42e: 4505 li a0,1 + +00000430 <.LVL152>: + 430: bff9 j 40e <.L57> + +00000432 <.L59>: + 432: fe070293 add t0,a4,-32 # 7fffe0 <.LLST32+0x7fef2a> + 436: 02000413 li s0,32 + +0000043a <.LVL154>: + 43a: 0057d2b3 srl t0,a5,t0 + 43e: 4381 li t2,0 + 440: 00870863 beq a4,s0,450 <.L60> + 444: 04000393 li t2,64 + 448: 40e383b3 sub t2,t2,a4 + 44c: 007793b3 sll t2,a5,t2 + +00000450 <.L60>: + 450: 00a3e3b3 or t2,t2,a0 + 454: 007033b3 snez t2,t2 + 458: 0072e533 or a0,t0,t2 + +0000045c <.LVL155>: + 45c: 4701 li a4,0 + +0000045e <.LVL156>: + 45e: bf45 j 40e <.L57> + +00000460 <.L51>: + 460: 00148713 add a4,s1,1 + 464: 7fe77713 and a4,a4,2046 + 468: e72d bnez a4,4d2 <.L63> + +0000046a <.LBB86>: + 46a: 00a7e333 or t1,a5,a0 + +0000046e <.LVL158>: + 46e: 00c5e733 or a4,a1,a2 + +00000472 <.LBB87>: + 472: e4a9 bnez s1,4bc <.L64> + +00000474 <.LVL159>: + 474: 00031763 bnez t1,482 <.L65> + +00000478 <.LVL160>: + 478: c77d beqz a4,566 <.L161> + +0000047a <.LBE87>: + 47a: 87ae mv a5,a1 + +0000047c <.LVL161>: + 47c: 8532 mv a0,a2 + +0000047e <.L152>: + 47e: 8436 mv s0,a3 + +00000480 <.LVL163>: + 480: bee5 j 78 <.L5> + +00000482 <.L65>: + 482: be070be3 beqz a4,78 <.L5> + +00000486 <.LBB47>: + 486: 40c502b3 sub t0,a0,a2 + +0000048a <.LVL165>: + 48a: 00553733 sltu a4,a0,t0 + 48e: 40b78333 sub t1,a5,a1 + 492: 40e30333 sub t1,t1,a4 + +00000496 <.LBE47>: + 496: 00800737 lui a4,0x800 + 49a: 00e37733 and a4,t1,a4 + 49e: cb09 beqz a4,4b0 <.L68> + +000004a0 <.LBB48>: + 4a0: 40a60533 sub a0,a2,a0 + +000004a4 <.LVL168>: + 4a4: 8d9d sub a1,a1,a5 + +000004a6 <.LVL169>: + 4a6: 00a63633 sltu a2,a2,a0 + +000004aa <.LVL170>: + 4aa: 40c587b3 sub a5,a1,a2 + +000004ae <.LBE48>: + 4ae: bfc1 j 47e <.L152> + +000004b0 <.L68>: + 4b0: 0062e733 or a4,t0,t1 + 4b4: cb4d beqz a4,566 <.L161> + 4b6: 879a mv a5,t1 + +000004b8 <.LBB49>: + 4b8: 8516 mv a0,t0 + +000004ba <.LVL174>: + 4ba: be7d j 78 <.L5> + +000004bc <.L64>: + 4bc: 00031863 bnez t1,4cc <.L71> + 4c0: 16070c63 beqz a4,638 <.L120> + +000004c4 <.LBE89>: + 4c4: 87ae mv a5,a1 + +000004c6 <.LVL176>: + 4c6: 8532 mv a0,a2 + +000004c8 <.LBB91>: + 4c8: 8436 mv s0,a3 + +000004ca <.LVL178>: + 4ca: bee5 j c2 <.L121> + +000004cc <.L71>: + 4cc: be070be3 beqz a4,c2 <.L121> + 4d0: bb69 j 26a <.L156> + +000004d2 <.L63>: + 4d2: 40c50733 sub a4,a0,a2 + 4d6: 00e533b3 sltu t2,a0,a4 + 4da: 40b78333 sub t1,a5,a1 + +000004de <.LVL181>: + 4de: 40730333 sub t1,t1,t2 + +000004e2 <.LBE50>: + 4e2: 008003b7 lui t2,0x800 + 4e6: 007373b3 and t2,t1,t2 + +000004ea <.LBB51>: + 4ea: 82ba mv t0,a4 + +000004ec <.LBE51>: + 4ec: 06038963 beqz t2,55e <.L74> + +000004f0 <.LBB52>: + 4f0: 40a60533 sub a0,a2,a0 + +000004f4 <.LVL183>: + 4f4: 8d9d sub a1,a1,a5 + +000004f6 <.LVL184>: + 4f6: 00a63633 sltu a2,a2,a0 + +000004fa <.LVL185>: + 4fa: 82aa mv t0,a0 + +000004fc <.LVL186>: + 4fc: 40c58333 sub t1,a1,a2 + +00000500 <.LBE52>: + 500: 8436 mv s0,a3 + +00000502 <.L77>: + 502: 06030463 beqz t1,56a <.L78> + 506: 851a mv a0,t1 + 508: c216 sw t0,4(sp) + 50a: c01a sw t1,0(sp) + 50c: 00000097 auipc ra,0x0 + 510: 000080e7 jalr ra # 50c <.L77+0xa> + +00000514 <.LVL189>: + 514: 4302 lw t1,0(sp) + 516: 4292 lw t0,4(sp) + 518: ff850793 add a5,a0,-8 + +0000051c <.L79>: + 51c: 02000713 li a4,32 + 520: 8f1d sub a4,a4,a5 + 522: 00f31333 sll t1,t1,a5 + +00000526 <.LVL191>: + 526: 00e2d733 srl a4,t0,a4 + 52a: 00676733 or a4,a4,t1 + +0000052e <.LVL192>: + 52e: 00f29333 sll t1,t0,a5 + +00000532 <.LVL193>: + 532: 0a97cf63 blt a5,s1,5f0 <.L81> + 536: 8f85 sub a5,a5,s1 + +00000538 <.LVL194>: + 538: 00178613 add a2,a5,1 # 80001 <.LLST32+0x7ef4b> + +0000053c <.L82>: + 53c: 02000693 li a3,32 + 540: 8e91 sub a3,a3,a2 + 542: 00d71533 sll a0,a4,a3 + 546: 00c357b3 srl a5,t1,a2 + 54a: 00d316b3 sll a3,t1,a3 + 54e: 8d5d or a0,a0,a5 + 550: 00d036b3 snez a3,a3 + 554: 8d55 or a0,a0,a3 + +00000556 <.LVL196>: + 556: 00c757b3 srl a5,a4,a2 + +0000055a <.L154>: + 55a: 4481 li s1,0 + +0000055c <.LVL198>: + 55c: be31 j 78 <.L5> + +0000055e <.L74>: + 55e: 00676733 or a4,a4,t1 + 562: f345 bnez a4,502 <.L77> + 564: 4481 li s1,0 + +00000566 <.L161>: + 566: 4781 li a5,0 + +00000568 <.LVL201>: + 568: a0f1 j 634 <.L155> + +0000056a <.L78>: + 56a: 8516 mv a0,t0 + 56c: c21a sw t1,4(sp) + 56e: c016 sw t0,0(sp) + 570: 00000097 auipc ra,0x0 + 574: 000080e7 jalr ra # 570 <.L78+0x6> + +00000578 <.LVL203>: + 578: 01850793 add a5,a0,24 + +0000057c <.LVL204>: + 57c: 46fd li a3,31 + 57e: 4282 lw t0,0(sp) + 580: 4312 lw t1,4(sp) + 582: f8f6dde3 bge a3,a5,51c <.L79> + +00000586 <.LVL205>: + 586: 1561 add a0,a0,-8 + 588: 00a29733 sll a4,t0,a0 + +0000058c <.LVL206>: + 58c: 0297c963 blt a5,s1,5be <.L83> + 590: 8f85 sub a5,a5,s1 + +00000592 <.LVL207>: + 592: 00178613 add a2,a5,1 + +00000596 <.LVL208>: + 596: fac6d3e3 bge a3,a2,53c <.L82> + 59a: 1785 add a5,a5,-31 + 59c: 02000693 li a3,32 + 5a0: 00f757b3 srl a5,a4,a5 + 5a4: 4501 li a0,0 + 5a6: 00d60763 beq a2,a3,5b4 <.L85> + 5aa: 04000513 li a0,64 + 5ae: 8d11 sub a0,a0,a2 + 5b0: 00a71533 sll a0,a4,a0 + +000005b4 <.L85>: + 5b4: 00a03533 snez a0,a0 + 5b8: 8d5d or a0,a0,a5 + +000005ba <.LVL209>: + 5ba: 4781 li a5,0 + 5bc: bf79 j 55a <.L154> + +000005be <.L83>: + 5be: 8c9d sub s1,s1,a5 + 5c0: ff8007b7 lui a5,0xff800 + +000005c4 <.LVL212>: + 5c4: 17fd add a5,a5,-1 # ff7fffff <.LLST32+0xff7fef49> + 5c6: 8ff9 and a5,a5,a4 + +000005c8 <.LBB94>: + 5c8: 01d79713 sll a4,a5,0x1d + +000005cc <.L157>: + 5cc: 838d srl a5,a5,0x3 + +000005ce <.L34>: + 5ce: 04d2 sll s1,s1,0x14 + 5d0: 7ff006b7 lui a3,0x7ff00 + 5d4: 07b2 sll a5,a5,0xc + +000005d6 <.LVL216>: + 5d6: 83b1 srl a5,a5,0xc + 5d8: 8cf5 and s1,s1,a3 + 5da: 8cdd or s1,s1,a5 + 5dc: 047e sll s0,s0,0x1f + +000005de <.LVL217>: + 5de: 0084e7b3 or a5,s1,s0 + +000005e2 <.LBE95>: + 5e2: 40c2 lw ra,16(sp) + 5e4: 4432 lw s0,12(sp) + 5e6: 44a2 lw s1,8(sp) + 5e8: 853a mv a0,a4 + 5ea: 85be mv a1,a5 + 5ec: 0151 add sp,sp,20 + 5ee: 8082 ret + +000005f0 <.L81>: + 5f0: 8c9d sub s1,s1,a5 + 5f2: ff8007b7 lui a5,0xff800 + +000005f6 <.LVL221>: + 5f6: 17fd add a5,a5,-1 # ff7fffff <.LLST32+0xff7fef49> + 5f8: 8ff9 and a5,a5,a4 + +000005fa <.LVL222>: + 5fa: 851a mv a0,t1 + 5fc: bcb5 j 78 <.L5> + +000005fe <.L97>: + 5fe: 87ae mv a5,a1 + +00000600 <.LVL224>: + 600: 8532 mv a0,a2 + +00000602 <.LBB98>: + 602: 84b6 mv s1,a3 + +00000604 <.LVL226>: + 604: bc95 j 78 <.L5> + +00000606 <.L104>: + 606: 87ae mv a5,a1 + +00000608 <.LVL228>: + 608: 8532 mv a0,a2 + +0000060a <.LVL229>: + 60a: b4bd j 78 <.L5> + +0000060c <.L107>: + 60c: 8496 mv s1,t0 + +0000060e <.LVL231>: + 60e: b4ad j 78 <.L5> + +00000610 <.L112>: + 610: 87ae mv a5,a1 + +00000612 <.LVL233>: + 612: 8532 mv a0,a2 + +00000614 <.LBB102>: + 614: 8496 mv s1,t0 + +00000616 <.LVL235>: + 616: b5a5 j 47e <.L152> + +00000618 <.L90>: + 618: 01d79693 sll a3,a5,0x1d + 61c: 810d srl a0,a0,0x3 + +0000061e <.LVL237>: + 61e: 7ff00613 li a2,2047 + 622: 8ec9 or a3,a3,a0 + +00000624 <.LVL238>: + 624: 838d srl a5,a5,0x3 + 626: 00c49f63 bne s1,a2,644 <.L125> + +0000062a <.LVL240>: + 62a: 8edd or a3,a3,a5 + 62c: 000807b7 lui a5,0x80 + 630: ae068ce3 beqz a3,128 <.L35> + +00000634 <.L155>: + 634: 4401 li s0,0 + 636: bf61 j 5ce <.L34> + +00000638 <.L120>: + 638: 4401 li s0,0 + +0000063a <.LBB104>: + 63a: 7ff00493 li s1,2047 + +0000063e <.LBB105>: + 63e: 000807b7 lui a5,0x80 + +00000642 <.LVL244>: + 642: b771 j 5ce <.L34> + +00000644 <.L125>: + 644: 8736 mv a4,a3 + 646: b761 j 5ce <.L34> + +divdf3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__divdf3>: + 0: fc410113 add sp,sp,-60 + 4: d826 sw s1,48(sp) + 6: 84ae mv s1,a1 + +00000008 <.LBB3>: + 8: 00c59713 sll a4,a1,0xc + c: 01f4d793 srl a5,s1,0x1f + 10: 81d1 srl a1,a1,0x14 + +00000012 <.LBE3>: + 12: da22 sw s0,52(sp) + 14: 832a mv t1,a0 + 16: 842a mv s0,a0 + +00000018 <.LBB4>: + 18: dc06 sw ra,56(sp) + +0000001a <.LBB5>: + 1a: 7ff5f513 and a0,a1,2047 + +0000001e <.LVL2>: + 1e: c03e sw a5,0(sp) + 20: 8331 srl a4,a4,0xc + +00000022 <.LBE5>: + 22: c549 beqz a0,ac <.L2> + 24: 7ff00793 li a5,2047 + 28: 0ef50f63 beq a0,a5,126 <.L3> + +0000002c <.LVL4>: + 2c: 070e sll a4,a4,0x3 + +0000002e <.LVL5>: + 2e: 01d35793 srl a5,t1,0x1d + 32: 8fd9 or a5,a5,a4 + 34: 00800737 lui a4,0x800 + 38: 8fd9 or a5,a5,a4 + +0000003a <.LVL6>: + 3a: 00331413 sll s0,t1,0x3 + +0000003e <.LVL7>: + 3e: c0150593 add a1,a0,-1023 + +00000042 <.L103>: + 42: 4481 li s1,0 + +00000044 <.L4>: + 44: 00c69713 sll a4,a3,0xc + 48: 00c75393 srl t2,a4,0xc + +0000004c <.LVL10>: + 4c: 0146d713 srl a4,a3,0x14 + 50: 82fd srl a3,a3,0x1f + 52: 7ff77713 and a4,a4,2047 + +00000056 <.LVL11>: + 56: c236 sw a3,4(sp) + +00000058 <.LBE10>: + 58: cb65 beqz a4,148 <.L9> + 5a: 7ff00693 li a3,2047 + 5e: 16d70563 beq a4,a3,1c8 <.L10> + +00000062 <.LVL13>: + 62: 00339513 sll a0,t2,0x3 + 66: 01d65693 srl a3,a2,0x1d + 6a: 8ec9 or a3,a3,a0 + 6c: 00800537 lui a0,0x800 + 70: 00a6e3b3 or t2,a3,a0 + +00000074 <.LVL14>: + 74: 00361693 sll a3,a2,0x3 + +00000078 <.LVL15>: + 78: c0170613 add a2,a4,-1023 # 7ffc01 <.LLST25+0x7fec19> + +0000007c <.L104>: + 7c: 4501 li a0,0 + +0000007e <.L11>: + 7e: 4702 lw a4,0(sp) + 80: 4312 lw t1,4(sp) + 82: 00674733 xor a4,a4,t1 + 86: c63a sw a4,12(sp) + +00000088 <.LVL18>: + 88: 40c58733 sub a4,a1,a2 + +0000008c <.LVL19>: + 8c: c43a sw a4,8(sp) + +0000008e <.LVL20>: + 8e: 00249713 sll a4,s1,0x2 + +00000092 <.LVL21>: + 92: 8f49 or a4,a4,a0 + 94: 177d add a4,a4,-1 + 96: 4639 li a2,14 + +00000098 <.LVL22>: + 98: 16e66963 bltu a2,a4,20a <.L16> + 9c: 00000637 lui a2,0x0 + a0: 070a sll a4,a4,0x2 + a2: 00060613 mv a2,a2 + a6: 9732 add a4,a4,a2 + a8: 4318 lw a4,0(a4) + aa: 8702 jr a4 + +000000ac <.L2>: + ac: 006767b3 or a5,a4,t1 + b0: c3d9 beqz a5,136 <.L71> + +000000b2 <.LBB15>: + b2: c836 sw a3,16(sp) + b4: c632 sw a2,12(sp) + b6: c329 beqz a4,f8 <.L5> + b8: 853a mv a0,a4 + +000000ba <.LVL24>: + ba: c41a sw t1,8(sp) + bc: c23a sw a4,4(sp) + be: 00000097 auipc ra,0x0 + c2: 000080e7 jalr ra # be <.LVL24+0x4> + +000000c6 <.LVL25>: + c6: 4712 lw a4,4(sp) + c8: 4322 lw t1,8(sp) + ca: 4632 lw a2,12(sp) + cc: 46c2 lw a3,16(sp) + ce: 82aa mv t0,a0 + +000000d0 <.LVL26>: + d0: ff550393 add t2,a0,-11 # 7ffff5 <.LLST25+0x7ff00d> + +000000d4 <.L6>: + d4: 47f5 li a5,29 + d6: ff828593 add a1,t0,-8 + da: 407787b3 sub a5,a5,t2 + de: 00b71733 sll a4,a4,a1 + +000000e2 <.LVL28>: + e2: 00f357b3 srl a5,t1,a5 + e6: 8fd9 or a5,a5,a4 + +000000e8 <.LVL29>: + e8: 00b31733 sll a4,t1,a1 + +000000ec <.L8>: + ec: c0d00593 li a1,-1011 + f0: 405585b3 sub a1,a1,t0 + +000000f4 <.LVL31>: + f4: 843a mv s0,a4 + f6: b7b1 j 42 <.L103> + +000000f8 <.L5>: + f8: 851a mv a0,t1 + +000000fa <.LVL33>: + fa: c43a sw a4,8(sp) + fc: c21a sw t1,4(sp) + fe: 00000097 auipc ra,0x0 + 102: 000080e7 jalr ra # fe <.LVL33+0x4> + +00000106 <.LVL34>: + 106: 01550393 add t2,a0,21 + 10a: 47f1 li a5,28 + 10c: 4312 lw t1,4(sp) + 10e: 4722 lw a4,8(sp) + 110: 4632 lw a2,12(sp) + 112: 46c2 lw a3,16(sp) + 114: 02050293 add t0,a0,32 + +00000118 <.LVL35>: + 118: fa77dee3 bge a5,t2,d4 <.L6> + +0000011c <.LVL36>: + 11c: ff850793 add a5,a0,-8 + 120: 00f317b3 sll a5,t1,a5 + +00000124 <.LVL37>: + 124: b7e1 j ec <.L8> + +00000126 <.L3>: + 126: 006767b3 or a5,a4,t1 + 12a: cb91 beqz a5,13e <.L72> + +0000012c <.LBB16>: + 12c: 87ba mv a5,a4 + 12e: 7ff00593 li a1,2047 + +00000132 <.LBE16>: + 132: 448d li s1,3 + 134: bf01 j 44 <.L4> + +00000136 <.L71>: + 136: 4401 li s0,0 + 138: 4581 li a1,0 + +0000013a <.LBE17>: + 13a: 4485 li s1,1 + 13c: b721 j 44 <.L4> + +0000013e <.L72>: + 13e: 4401 li s0,0 + 140: 7ff00593 li a1,2047 + +00000144 <.LBE18>: + 144: 4489 li s1,2 + 146: bdfd j 44 <.L4> + +00000148 <.L9>: + 148: 00c3e6b3 or a3,t2,a2 + 14c: c6d1 beqz a3,1d8 <.L73> + +0000014e <.LBB19>: + 14e: 04038563 beqz t2,198 <.L12> + 152: 851e mv a0,t2 + 154: ca32 sw a2,20(sp) + 156: c82e sw a1,16(sp) + 158: c63e sw a5,12(sp) + 15a: c41e sw t2,8(sp) + 15c: 00000097 auipc ra,0x0 + 160: 000080e7 jalr ra # 15c <.LBB19+0xe> + +00000164 <.LVL40>: + 164: 43a2 lw t2,8(sp) + 166: 47b2 lw a5,12(sp) + 168: 45c2 lw a1,16(sp) + 16a: 4652 lw a2,20(sp) + 16c: 86aa mv a3,a0 + +0000016e <.LVL41>: + 16e: ff550293 add t0,a0,-11 + +00000172 <.L13>: + 172: 4775 li a4,29 + 174: ff868513 add a0,a3,-8 + 178: 40570733 sub a4,a4,t0 + 17c: 00a393b3 sll t2,t2,a0 + +00000180 <.LVL43>: + 180: 00e65733 srl a4,a2,a4 + 184: 00776733 or a4,a4,t2 + +00000188 <.LVL44>: + 188: 00a613b3 sll t2,a2,a0 + +0000018c <.L15>: + 18c: c0d00613 li a2,-1011 + 190: 8e15 sub a2,a2,a3 + +00000192 <.LVL46>: + 192: 869e mv a3,t2 + 194: 83ba mv t2,a4 + +00000196 <.LVL47>: + 196: b5dd j 7c <.L104> + +00000198 <.L12>: + 198: 8532 mv a0,a2 + 19a: ca1e sw t2,20(sp) + 19c: c82e sw a1,16(sp) + 19e: c63e sw a5,12(sp) + 1a0: c432 sw a2,8(sp) + 1a2: 00000097 auipc ra,0x0 + 1a6: 000080e7 jalr ra # 1a2 <.L12+0xa> + +000001aa <.LVL49>: + 1aa: 01550293 add t0,a0,21 + 1ae: 4771 li a4,28 + 1b0: 4622 lw a2,8(sp) + 1b2: 47b2 lw a5,12(sp) + 1b4: 45c2 lw a1,16(sp) + 1b6: 43d2 lw t2,20(sp) + 1b8: 02050693 add a3,a0,32 + +000001bc <.LVL50>: + 1bc: fa575be3 bge a4,t0,172 <.L13> + +000001c0 <.LVL51>: + 1c0: 1561 add a0,a0,-8 + 1c2: 00a61733 sll a4,a2,a0 + +000001c6 <.LVL52>: + 1c6: b7d9 j 18c <.L15> + +000001c8 <.L10>: + 1c8: 00c3e6b3 or a3,t2,a2 + 1cc: ca91 beqz a3,1e0 <.L74> + 1ce: 86b2 mv a3,a2 + 1d0: 450d li a0,3 + +000001d2 <.LBB20>: + 1d2: 7ff00613 li a2,2047 + +000001d6 <.LVL54>: + 1d6: b565 j 7e <.L11> + +000001d8 <.L73>: + 1d8: 4381 li t2,0 + +000001da <.LVL56>: + 1da: 4601 li a2,0 + +000001dc <.LBE20>: + 1dc: 4505 li a0,1 + 1de: b545 j 7e <.L11> + +000001e0 <.L74>: + 1e0: 4381 li t2,0 + +000001e2 <.LVL59>: + 1e2: 7ff00613 li a2,2047 + +000001e6 <.LBE21>: + 1e6: 4509 li a0,2 + 1e8: bd59 j 7e <.L11> + +000001ea <.L19>: + 1ea: 4702 lw a4,0(sp) + 1ec: 83be mv t2,a5 + +000001ee <.LVL62>: + 1ee: 86a2 mv a3,s0 + +000001f0 <.LVL63>: + 1f0: c63a sw a4,12(sp) + +000001f2 <.L23>: + 1f2: 4789 li a5,2 + 1f4: 46f48f63 beq s1,a5,672 <.L88> + 1f8: 478d li a5,3 + 1fa: 46f48563 beq s1,a5,664 <.L86> + 1fe: 4785 li a5,1 + 200: 34f49363 bne s1,a5,546 <.L44> + +00000204 <.L90>: + 204: 4381 li t2,0 + 206: 4681 li a3,0 + 208: a13d j 636 <.L105> + +0000020a <.L16>: + 20a: 00f3e663 bltu t2,a5,216 <.L24> + 20e: 3a779963 bne a5,t2,5c0 <.L25> + 212: 3ad46763 bltu s0,a3,5c0 <.L25> + +00000216 <.L24>: + 216: 01f79593 sll a1,a5,0x1f + +0000021a <.LVL68>: + 21a: 00145613 srl a2,s0,0x1 + +0000021e <.LVL69>: + 21e: 01f41713 sll a4,s0,0x1f + +00000222 <.LVL70>: + 222: 8385 srl a5,a5,0x1 + +00000224 <.LVL71>: + 224: 00c5e433 or s0,a1,a2 + +00000228 <.L26>: + 228: 00839613 sll a2,t2,0x8 + 22c: d03a sw a4,32(sp) + +0000022e <.LVL73>: + 22e: 00869713 sll a4,a3,0x8 + +00000232 <.LVL74>: + 232: c03a sw a4,0(sp) + +00000234 <.LBB31>: + 234: 01065713 srl a4,a2,0x10 + +00000238 <.LBE31>: + 238: 0186d593 srl a1,a3,0x18 + +0000023c <.LBB33>: + 23c: c23a sw a4,4(sp) + +0000023e <.LBE33>: + 23e: 00c5e333 or t1,a1,a2 + +00000242 <.LBB35>: + 242: 4592 lw a1,4(sp) + 244: 01031713 sll a4,t1,0x10 + +00000248 <.LVL78>: + 248: 8341 srl a4,a4,0x10 + 24a: 853e mv a0,a5 + +0000024c <.LVL79>: + 24c: ce1a sw t1,28(sp) + 24e: cc3a sw a4,24(sp) + +00000250 <.LVL80>: + 250: ca3e sw a5,20(sp) + 252: 00000097 auipc ra,0x0 + 256: 000080e7 jalr ra # 252 <.LVL80+0x2> + +0000025a <.LVL81>: + 25a: 85aa mv a1,a0 + 25c: c82a sw a0,16(sp) + 25e: 4562 lw a0,24(sp) + +00000260 <.LVL82>: + 260: 00000097 auipc ra,0x0 + 264: 000080e7 jalr ra # 260 <.LVL82> + +00000268 <.LVL83>: + 268: 47d2 lw a5,20(sp) + 26a: 4592 lw a1,4(sp) + 26c: 84aa mv s1,a0 + +0000026e <.LVL84>: + 26e: 853e mv a0,a5 + 270: 00000097 auipc ra,0x0 + 274: 000080e7 jalr ra # 270 <.LVL84+0x2> + +00000278 <.LVL85>: + 278: 46c2 lw a3,16(sp) + 27a: 0542 sll a0,a0,0x10 + 27c: 01045613 srl a2,s0,0x10 + 280: 8e49 or a2,a2,a0 + +00000282 <.LVL86>: + 282: 4372 lw t1,28(sp) + 284: 5702 lw a4,32(sp) + 286: 87b6 mv a5,a3 + 288: 00967c63 bgeu a2,s1,2a0 <.L27> + 28c: 961a add a2,a2,t1 + +0000028e <.LVL87>: + 28e: fff68793 add a5,a3,-1 + +00000292 <.LVL88>: + 292: 00666763 bltu a2,t1,2a0 <.L27> + 296: 00967563 bgeu a2,s1,2a0 <.L27> + 29a: ffe68793 add a5,a3,-2 + 29e: 961a add a2,a2,t1 + +000002a0 <.L27>: + 2a0: 4592 lw a1,4(sp) + 2a2: d03e sw a5,32(sp) + +000002a4 <.LVL91>: + 2a4: 409607b3 sub a5,a2,s1 + +000002a8 <.LVL92>: + 2a8: 853e mv a0,a5 + 2aa: d21a sw t1,36(sp) + 2ac: ce3a sw a4,28(sp) + +000002ae <.LVL93>: + 2ae: c83e sw a5,16(sp) + +000002b0 <.LVL94>: + 2b0: 00000097 auipc ra,0x0 + 2b4: 000080e7 jalr ra # 2b0 <.LVL94> + +000002b8 <.LVL95>: + 2b8: 85aa mv a1,a0 + 2ba: ca2a sw a0,20(sp) + +000002bc <.LVL96>: + 2bc: 4562 lw a0,24(sp) + +000002be <.LVL97>: + 2be: 0442 sll s0,s0,0x10 + +000002c0 <.LVL98>: + 2c0: 8041 srl s0,s0,0x10 + 2c2: 00000097 auipc ra,0x0 + 2c6: 000080e7 jalr ra # 2c2 <.LVL98+0x2> + +000002ca <.LVL99>: + 2ca: 4592 lw a1,4(sp) + 2cc: 84aa mv s1,a0 + 2ce: 4542 lw a0,16(sp) + 2d0: 00000097 auipc ra,0x0 + 2d4: 000080e7 jalr ra # 2d0 <.LVL99+0x6> + +000002d8 <.LVL101>: + 2d8: 4652 lw a2,20(sp) + 2da: 0542 sll a0,a0,0x10 + 2dc: 8c49 or s0,s0,a0 + +000002de <.LVL102>: + 2de: 4772 lw a4,28(sp) + 2e0: 5782 lw a5,32(sp) + 2e2: 5312 lw t1,36(sp) + 2e4: 85b2 mv a1,a2 + 2e6: 00947c63 bgeu s0,s1,2fe <.L30> + +000002ea <.LVL103>: + 2ea: 941a add s0,s0,t1 + +000002ec <.LVL104>: + 2ec: fff60593 add a1,a2,-1 # ffffffff <.LLST25+0xfffff017> + +000002f0 <.LVL105>: + 2f0: 00646763 bltu s0,t1,2fe <.L30> + 2f4: 00947563 bgeu s0,s1,2fe <.L30> + 2f8: ffe60593 add a1,a2,-2 + 2fc: 941a add s0,s0,t1 + +000002fe <.L30>: + 2fe: 07c2 sll a5,a5,0x10 + 300: 00b7e2b3 or t0,a5,a1 + +00000304 <.LBB36>: + 304: 4782 lw a5,0(sp) + 306: 4602 lw a2,0(sp) + 308: 63c1 lui t2,0x10 + 30a: fff38693 add a3,t2,-1 # ffff <.LLST25+0xf017> + 30e: 83c1 srl a5,a5,0x10 + 310: c83e sw a5,16(sp) + +00000312 <.LVL108>: + 312: 00d2f7b3 and a5,t0,a3 + 316: 8ef1 and a3,a3,a2 + +00000318 <.LBB41>: + 318: 8c05 sub s0,s0,s1 + +0000031a <.LBB37>: + 31a: 853e mv a0,a5 + 31c: ca36 sw a3,20(sp) + 31e: 85b6 mv a1,a3 + +00000320 <.LVL110>: + 320: 00000097 auipc ra,0x0 + 324: 000080e7 jalr ra # 320 <.LVL110> + 328: 84aa mv s1,a0 + +0000032a <.LBB38>: + 32a: 45c2 lw a1,16(sp) + 32c: 853e mv a0,a5 + 32e: 00000097 auipc ra,0x0 + 332: 000080e7 jalr ra # 32e <.LBB38+0x4> + 336: 87aa mv a5,a0 + +00000338 <.LBB39>: + 338: 45d2 lw a1,20(sp) + 33a: 0102d513 srl a0,t0,0x10 + +0000033e <.LVL113>: + 33e: 00000097 auipc ra,0x0 + 342: 000080e7 jalr ra # 33e <.LVL113> + 346: ce2a sw a0,28(sp) + +00000348 <.LBB40>: + 348: 45c2 lw a1,16(sp) + 34a: 0102d513 srl a0,t0,0x10 + +0000034e <.LVL115>: + 34e: 00000097 auipc ra,0x0 + 352: 000080e7 jalr ra # 34e <.LVL115> + +00000356 <.LBE40>: + 356: 4672 lw a2,28(sp) + 358: 0104d693 srl a3,s1,0x10 + 35c: 97b2 add a5,a5,a2 + +0000035e <.LVL117>: + 35e: 97b6 add a5,a5,a3 + +00000360 <.LVL118>: + 360: 00c7f363 bgeu a5,a2,366 <.L33> + 364: 951e add a0,a0,t2 + +00000366 <.L33>: + 366: 0107d693 srl a3,a5,0x10 + 36a: 9536 add a0,a0,a3 + +0000036c <.LVL120>: + 36c: 66c1 lui a3,0x10 + 36e: 16fd add a3,a3,-1 # ffff <.LLST25+0xf017> + 370: 8ff5 and a5,a5,a3 + +00000372 <.LVL121>: + 372: 07c2 sll a5,a5,0x10 + 374: 8cf5 and s1,s1,a3 + +00000376 <.LVL122>: + 376: 94be add s1,s1,a5 + +00000378 <.LBE42>: + 378: 00a46763 bltu s0,a0,386 <.L34> + +0000037c <.LBB43>: + 37c: 8396 mv t2,t0 + +0000037e <.LBE43>: + 37e: 04a41363 bne s0,a0,3c4 <.L35> + 382: 04977163 bgeu a4,s1,3c4 <.L35> + +00000386 <.L34>: + 386: 4782 lw a5,0(sp) + 388: fff28393 add t2,t0,-1 + +0000038c <.LBB44>: + 38c: 97ba add a5,a5,a4 + 38e: 00e7b6b3 sltu a3,a5,a4 + 392: 00668633 add a2,a3,t1 + 396: 9432 add s0,s0,a2 + +00000398 <.LVL125>: + 398: 873e mv a4,a5 + +0000039a <.LBE44>: + 39a: 00836563 bltu t1,s0,3a4 <.L38> + 39e: 02831363 bne t1,s0,3c4 <.L35> + 3a2: e28d bnez a3,3c4 <.L35> + +000003a4 <.L38>: + 3a4: 00a46663 bltu s0,a0,3b0 <.L39> + 3a8: 00851e63 bne a0,s0,3c4 <.L35> + 3ac: 0097fc63 bgeu a5,s1,3c4 <.L35> + +000003b0 <.L39>: + 3b0: 4702 lw a4,0(sp) + +000003b2 <.LVL127>: + 3b2: ffe28393 add t2,t0,-2 + +000003b6 <.LBB45>: + 3b6: 97ba add a5,a5,a4 + +000003b8 <.LVL129>: + 3b8: 873e mv a4,a5 + +000003ba <.LVL130>: + 3ba: 4782 lw a5,0(sp) + 3bc: 00f737b3 sltu a5,a4,a5 + 3c0: 979a add a5,a5,t1 + 3c2: 943e add s0,s0,a5 + +000003c4 <.L35>: + 3c4: 409704b3 sub s1,a4,s1 + +000003c8 <.LVL132>: + 3c8: 8c09 sub s0,s0,a0 + +000003ca <.LVL133>: + 3ca: 00973733 sltu a4,a4,s1 + +000003ce <.LVL134>: + 3ce: 8c19 sub s0,s0,a4 + +000003d0 <.LBE46>: + 3d0: d41a sw t1,40(sp) + 3d2: 56fd li a3,-1 + 3d4: 16830963 beq t1,s0,546 <.L44> + +000003d8 <.LBB47>: + 3d8: 4592 lw a1,4(sp) + 3da: 8522 mv a0,s0 + +000003dc <.LVL136>: + 3dc: d21e sw t2,36(sp) + +000003de <.LBB48>: + 3de: 00000097 auipc ra,0x0 + 3e2: 000080e7 jalr ra # 3de <.LBB48> + +000003e6 <.LVL138>: + 3e6: 85aa mv a1,a0 + 3e8: d02a sw a0,32(sp) + +000003ea <.LVL139>: + 3ea: 4562 lw a0,24(sp) + +000003ec <.LVL140>: + 3ec: 00000097 auipc ra,0x0 + 3f0: 000080e7 jalr ra # 3ec <.LVL140> + +000003f4 <.LVL141>: + 3f4: 4592 lw a1,4(sp) + 3f6: ce2a sw a0,28(sp) + +000003f8 <.LVL142>: + 3f8: 8522 mv a0,s0 + +000003fa <.LVL143>: + 3fa: 00000097 auipc ra,0x0 + 3fe: 000080e7 jalr ra # 3fa <.LVL143> + +00000402 <.LVL144>: + 402: 5682 lw a3,32(sp) + 404: 47f2 lw a5,28(sp) + 406: 0542 sll a0,a0,0x10 + 408: 0104d413 srl s0,s1,0x10 + +0000040c <.LVL145>: + 40c: 8c49 or s0,s0,a0 + +0000040e <.LVL146>: + 40e: 5392 lw t2,36(sp) + 410: 5322 lw t1,40(sp) + 412: 8736 mv a4,a3 + 414: 00f47c63 bgeu s0,a5,42c <.L45> + +00000418 <.LVL147>: + 418: 941a add s0,s0,t1 + +0000041a <.LVL148>: + 41a: fff68713 add a4,a3,-1 + +0000041e <.LVL149>: + 41e: 00646763 bltu s0,t1,42c <.L45> + 422: 00f47563 bgeu s0,a5,42c <.L45> + 426: ffe68713 add a4,a3,-2 + 42a: 941a add s0,s0,t1 + +0000042c <.L45>: + 42c: 4592 lw a1,4(sp) + 42e: 40f407b3 sub a5,s0,a5 + 432: 853e mv a0,a5 + 434: d61a sw t1,44(sp) + 436: d43a sw a4,40(sp) + 438: d21e sw t2,36(sp) + +0000043a <.LVL152>: + 43a: ce3e sw a5,28(sp) + +0000043c <.LVL153>: + 43c: 00000097 auipc ra,0x0 + 440: 000080e7 jalr ra # 43c <.LVL153> + +00000444 <.LVL154>: + 444: 85aa mv a1,a0 + 446: d02a sw a0,32(sp) + 448: 4562 lw a0,24(sp) + +0000044a <.LVL155>: + 44a: 00000097 auipc ra,0x0 + 44e: 000080e7 jalr ra # 44a <.LVL155> + +00000452 <.LVL156>: + 452: 4592 lw a1,4(sp) + 454: 842a mv s0,a0 + +00000456 <.LVL157>: + 456: 4572 lw a0,28(sp) + 458: 00000097 auipc ra,0x0 + 45c: 000080e7 jalr ra # 458 <.LVL157+0x2> + +00000460 <.LVL158>: + 460: 5602 lw a2,32(sp) + 462: 01049793 sll a5,s1,0x10 + 466: 0542 sll a0,a0,0x10 + 468: 83c1 srl a5,a5,0x10 + 46a: 8fc9 or a5,a5,a0 + +0000046c <.LVL159>: + 46c: 5392 lw t2,36(sp) + 46e: 5722 lw a4,40(sp) + 470: 5332 lw t1,44(sp) + 472: 85b2 mv a1,a2 + 474: 0087fc63 bgeu a5,s0,48c <.L48> + +00000478 <.LVL160>: + 478: 979a add a5,a5,t1 + +0000047a <.LVL161>: + 47a: fff60593 add a1,a2,-1 + +0000047e <.LVL162>: + 47e: 0067e763 bltu a5,t1,48c <.L48> + 482: 0087f563 bgeu a5,s0,48c <.L48> + 486: ffe60593 add a1,a2,-2 + 48a: 979a add a5,a5,t1 + +0000048c <.L48>: + 48c: 0742 sll a4,a4,0x10 + 48e: 8f4d or a4,a4,a1 + 490: 01071293 sll t0,a4,0x10 + 494: 0102d293 srl t0,t0,0x10 + +00000498 <.LBB49>: + 498: 45d2 lw a1,20(sp) + +0000049a <.LBB55>: + 49a: 8f81 sub a5,a5,s0 + +0000049c <.LBB51>: + 49c: 8516 mv a0,t0 + 49e: 00000097 auipc ra,0x0 + 4a2: 000080e7 jalr ra # 49e <.LBB51+0x2> + 4a6: 84aa mv s1,a0 + +000004a8 <.LBB52>: + 4a8: 45c2 lw a1,16(sp) + 4aa: 8516 mv a0,t0 + 4ac: 00000097 auipc ra,0x0 + 4b0: 000080e7 jalr ra # 4ac <.LBB52+0x4> + 4b4: 82aa mv t0,a0 + +000004b6 <.LBB53>: + 4b6: 45d2 lw a1,20(sp) + 4b8: 01075513 srl a0,a4,0x10 + 4bc: 00000097 auipc ra,0x0 + 4c0: 000080e7 jalr ra # 4bc <.LBB53+0x6> + 4c4: 842a mv s0,a0 + +000004c6 <.LBB54>: + 4c6: 45c2 lw a1,16(sp) + 4c8: 01075513 srl a0,a4,0x10 + 4cc: 00000097 auipc ra,0x0 + 4d0: 000080e7 jalr ra # 4cc <.LBB54+0x6> + +000004d4 <.LBE54>: + 4d4: 0104d613 srl a2,s1,0x10 + 4d8: 008286b3 add a3,t0,s0 + 4dc: 00d602b3 add t0,a2,a3 + +000004e0 <.LVL171>: + 4e0: 0082f463 bgeu t0,s0,4e8 <.L51> + 4e4: 66c1 lui a3,0x10 + 4e6: 9536 add a0,a0,a3 + +000004e8 <.L51>: + 4e8: 0102d693 srl a3,t0,0x10 + 4ec: 9536 add a0,a0,a3 + +000004ee <.LVL173>: + 4ee: 66c1 lui a3,0x10 + 4f0: 16fd add a3,a3,-1 # ffff <.LLST25+0xf017> + 4f2: 00d2f2b3 and t0,t0,a3 + +000004f6 <.LVL174>: + 4f6: 02c2 sll t0,t0,0x10 + 4f8: 8ee5 and a3,a3,s1 + 4fa: 92b6 add t0,t0,a3 + +000004fc <.LBE56>: + 4fc: 00a7e763 bltu a5,a0,50a <.L52> + +00000500 <.LBB57>: + 500: 86ba mv a3,a4 + +00000502 <.LBE57>: + 502: 04a79063 bne a5,a0,542 <.L53> + +00000506 <.LVL176>: + 506: 04028063 beqz t0,546 <.L44> + +0000050a <.L52>: + 50a: 979a add a5,a5,t1 + +0000050c <.LVL178>: + 50c: fff70693 add a3,a4,-1 + +00000510 <.LBB58>: + 510: 863e mv a2,a5 + +00000512 <.LBE58>: + 512: 0267e363 bltu a5,t1,538 <.L56> + 516: 00a7e763 bltu a5,a0,524 <.L57> + 51a: 02a79463 bne a5,a0,542 <.L53> + 51e: 4602 lw a2,0(sp) + +00000520 <.LVL181>: + 520: 00567e63 bgeu a2,t0,53c <.L58> + +00000524 <.L57>: + 524: ffe70693 add a3,a4,-2 + +00000528 <.LBB59>: + 528: 4702 lw a4,0(sp) + +0000052a <.LVL183>: + 52a: 4602 lw a2,0(sp) + 52c: 0706 sll a4,a4,0x1 + +0000052e <.LVL184>: + 52e: 00c73633 sltu a2,a4,a2 + 532: 961a add a2,a2,t1 + 534: 963e add a2,a2,a5 + +00000536 <.LVL185>: + 536: c03a sw a4,0(sp) + +00000538 <.L56>: + 538: 00a61563 bne a2,a0,542 <.L53> + +0000053c <.L58>: + 53c: 4782 lw a5,0(sp) + 53e: 00f28463 beq t0,a5,546 <.L44> + +00000542 <.L53>: + 542: 0016e693 or a3,a3,1 + +00000546 <.L44>: + 546: 47a2 lw a5,8(sp) + 548: 3ff78793 add a5,a5,1023 + +0000054c <.LVL190>: + 54c: 08f05363 blez a5,5d2 <.L59> + 550: 0076f713 and a4,a3,7 + 554: cf01 beqz a4,56c <.L60> + 556: 00f6f713 and a4,a3,15 + 55a: 4611 li a2,4 + 55c: 00c70863 beq a4,a2,56c <.L60> + +00000560 <.LBB60>: + 560: 00468713 add a4,a3,4 + 564: 00d73633 sltu a2,a4,a3 + 568: 93b2 add t2,t2,a2 + 56a: 86ba mv a3,a4 + +0000056c <.L60>: + 56c: 01000737 lui a4,0x1000 + 570: 00e3f733 and a4,t2,a4 + 574: cb09 beqz a4,586 <.L63> + 576: ff0007b7 lui a5,0xff000 + +0000057a <.LVL192>: + 57a: 17fd add a5,a5,-1 # feffffff <.LLST25+0xfefff017> + 57c: 00f3f3b3 and t2,t2,a5 + 580: 47a2 lw a5,8(sp) + 582: 40078793 add a5,a5,1024 + +00000586 <.L63>: + 586: 7fe00713 li a4,2046 + 58a: 0ef74463 blt a4,a5,672 <.L88> + 58e: 0036d713 srl a4,a3,0x3 + +00000592 <.LVL195>: + 592: 01d39693 sll a3,t2,0x1d + +00000596 <.LVL196>: + 596: 8ed9 or a3,a3,a4 + +00000598 <.LVL197>: + 598: 0033d393 srl t2,t2,0x3 + +0000059c <.L17>: + 59c: 4732 lw a4,12(sp) + 59e: 03b2 sll t2,t2,0xc + +000005a0 <.LBE63>: + 5a0: 50e2 lw ra,56(sp) + 5a2: 5452 lw s0,52(sp) + +000005a4 <.LBB64>: + 5a4: 07d2 sll a5,a5,0x14 + +000005a6 <.LVL200>: + 5a6: 00c3d393 srl t2,t2,0xc + 5aa: 0077e7b3 or a5,a5,t2 + 5ae: 077e sll a4,a4,0x1f + 5b0: 00e7e633 or a2,a5,a4 + +000005b4 <.LBE64>: + 5b4: 54c2 lw s1,48(sp) + 5b6: 8536 mv a0,a3 + 5b8: 85b2 mv a1,a2 + 5ba: 03c10113 add sp,sp,60 + +000005be <.LVL202>: + 5be: 8082 ret + +000005c0 <.L25>: + 5c0: 4722 lw a4,8(sp) + 5c2: 177d add a4,a4,-1 # ffffff <.LLST25+0xfff017> + 5c4: c43a sw a4,8(sp) + +000005c6 <.LVL204>: + 5c6: 4701 li a4,0 + +000005c8 <.LVL205>: + 5c8: b185 j 228 <.L26> + +000005ca <.L20>: + 5ca: 4792 lw a5,4(sp) + +000005cc <.LBE66>: + 5cc: 84aa mv s1,a0 + +000005ce <.LBB67>: + 5ce: c63e sw a5,12(sp) + +000005d0 <.LBE67>: + 5d0: b10d j 1f2 <.L23> + +000005d2 <.L59>: + 5d2: 4605 li a2,1 + 5d4: cb89 beqz a5,5e6 <.L64> + 5d6: 8e1d sub a2,a2,a5 + +000005d8 <.LVL211>: + 5d8: 03800713 li a4,56 + 5dc: c2c744e3 blt a4,a2,204 <.L90> + 5e0: 477d li a4,31 + 5e2: 04c74c63 blt a4,a2,63a <.L65> + +000005e6 <.L64>: + 5e6: 47a2 lw a5,8(sp) + 5e8: 41e78713 add a4,a5,1054 + 5ec: 00c6d7b3 srl a5,a3,a2 + 5f0: 00e696b3 sll a3,a3,a4 + 5f4: 00d036b3 snez a3,a3 + 5f8: 00e39733 sll a4,t2,a4 + 5fc: 8ed9 or a3,a3,a4 + 5fe: 8fd5 or a5,a5,a3 + +00000600 <.LVL213>: + 600: 00c3d3b3 srl t2,t2,a2 + +00000604 <.L66>: + 604: 0077f713 and a4,a5,7 + 608: cf01 beqz a4,620 <.L68> + 60a: 00f7f713 and a4,a5,15 + 60e: 4691 li a3,4 + 610: 00d70863 beq a4,a3,620 <.L68> + +00000614 <.LBB25>: + 614: 00478713 add a4,a5,4 + 618: 00f736b3 sltu a3,a4,a5 + 61c: 93b6 add t2,t2,a3 + +0000061e <.LVL215>: + 61e: 87ba mv a5,a4 + +00000620 <.L68>: + 620: 00800737 lui a4,0x800 + 624: 00e3f733 and a4,t2,a4 + 628: eb31 bnez a4,67c <.L92> + +0000062a <.LVL217>: + 62a: 01d39693 sll a3,t2,0x1d + 62e: 838d srl a5,a5,0x3 + +00000630 <.LVL218>: + 630: 8edd or a3,a3,a5 + +00000632 <.LVL219>: + 632: 0033d393 srl t2,t2,0x3 + +00000636 <.L105>: + 636: 4781 li a5,0 + 638: b795 j 59c <.L17> + +0000063a <.L65>: + 63a: 5705 li a4,-31 + 63c: 40f707b3 sub a5,a4,a5 + 640: 02000593 li a1,32 + 644: 00f3d7b3 srl a5,t2,a5 + 648: 4701 li a4,0 + 64a: 00b60763 beq a2,a1,658 <.L67> + 64e: 4722 lw a4,8(sp) + 650: 43e70713 add a4,a4,1086 # 80043e <.LLST25+0x7ff456> + 654: 00e39733 sll a4,t2,a4 + +00000658 <.L67>: + 658: 8f55 or a4,a4,a3 + 65a: 00e03733 snez a4,a4 + 65e: 8fd9 or a5,a5,a4 + +00000660 <.LVL222>: + 660: 4381 li t2,0 + 662: b74d j 604 <.L66> + +00000664 <.L86>: + 664: 000803b7 lui t2,0x80 + 668: 4681 li a3,0 + 66a: 7ff00793 li a5,2047 + 66e: c602 sw zero,12(sp) + +00000670 <.LVL224>: + 670: b735 j 59c <.L17> + +00000672 <.L88>: + 672: 4381 li t2,0 + 674: 4681 li a3,0 + 676: 7ff00793 li a5,2047 + 67a: b70d j 59c <.L17> + +0000067c <.L92>: + 67c: 4381 li t2,0 + +0000067e <.LVL227>: + 67e: 4681 li a3,0 + 680: 4785 li a5,1 + +00000682 <.LVL228>: + 682: bf29 j 59c <.L17> + +eqdf2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__eqdf2>: + 0: 1151 add sp,sp,-12 + +00000002 <.LBB3>: + 2: 0145d713 srl a4,a1,0x14 + 6: 001007b7 lui a5,0x100 + a: 17fd add a5,a5,-1 # fffff <.LASF16+0xffe4a> + +0000000c <.LBB4>: + c: 0146d393 srl t2,a3,0x14 + +00000010 <.LBE4>: + 10: c422 sw s0,8(sp) + 12: c226 sw s1,4(sp) + +00000014 <.LBB5>: + 14: 7ff77713 and a4,a4,2047 + 18: c032 sw a2,0(sp) + +0000001a <.LBE5>: + 1a: 7ff00413 li s0,2047 + +0000001e <.LBB6>: + 1e: 00b7f333 and t1,a5,a1 + +00000022 <.LBE6>: + 22: 82aa mv t0,a0 + +00000024 <.LBB7>: + 24: 8ff5 and a5,a5,a3 + +00000026 <.LBB8>: + 26: 81fd srl a1,a1,0x1f + +00000028 <.LBB9>: + 28: 7ff3f393 and t2,t2,2047 + 2c: 82fd srl a3,a3,0x1f + +0000002e <.LBE9>: + 2e: 00870963 beq a4,s0,40 <.L2> + 32: 4505 li a0,1 + +00000034 <.LVL5>: + 34: 02839463 bne t2,s0,5c <.L13> + +00000038 <.L1>: + 38: 4422 lw s0,8(sp) + 3a: 4492 lw s1,4(sp) + 3c: 0131 add sp,sp,12 + 3e: 8082 ret + +00000040 <.L2>: + 40: 4505 li a0,1 + +00000042 <.LVL8>: + 42: fee39be3 bne t2,a4,38 <.L1> + 46: 00f367b3 or a5,t1,a5 + +0000004a <.LVL9>: + 4a: 8fd1 or a5,a5,a2 + 4c: 0057e7b3 or a5,a5,t0 + 50: f7e5 bnez a5,38 <.L1> + 52: 40d58533 sub a0,a1,a3 + 56: 00a03533 snez a0,a0 + 5a: bff9 j 38 <.L1> + +0000005c <.L13>: + 5c: 4505 li a0,1 + 5e: fc771de3 bne a4,t2,38 <.L1> + 62: fcf31be3 bne t1,a5,38 <.L1> + 66: 4782 lw a5,0(sp) + +00000068 <.LVL11>: + 68: fcf298e3 bne t0,a5,38 <.L1> + 6c: 00d58863 beq a1,a3,7c <.L11> + 70: f761 bnez a4,38 <.L1> + 72: 00536333 or t1,t1,t0 + +00000076 <.LVL12>: + 76: 00603533 snez a0,t1 + 7a: bf7d j 38 <.L1> + +0000007c <.L11>: + 7c: 4501 li a0,0 + 7e: bf6d j 38 <.L1> + +gedf2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__gedf2>: + 0: 1161 add sp,sp,-8 + +00000002 <.LBB3>: + 2: 0145d293 srl t0,a1,0x14 + 6: 001007b7 lui a5,0x100 + a: 17fd add a5,a5,-1 # fffff <.LASF16+0xffe26> + +0000000c <.LBE3>: + c: c026 sw s1,0(sp) + e: 872a mv a4,a0 + 10: 83aa mv t2,a0 + +00000012 <.LBB4>: + 12: c222 sw s0,4(sp) + +00000014 <.LBB5>: + 14: 0146d513 srl a0,a3,0x14 + +00000018 <.LBB6>: + 18: 7ff2f293 and t0,t0,2047 + +0000001c <.LBE6>: + 1c: 7ff00493 li s1,2047 + +00000020 <.LBB7>: + 20: 00b7f333 and t1,a5,a1 + +00000024 <.LBB8>: + 24: 7ff57513 and a0,a0,2047 + 28: 8ff5 and a5,a5,a3 + +0000002a <.LBB9>: + 2a: 81fd srl a1,a1,0x1f + +0000002c <.LBB10>: + 2c: 82fd srl a3,a3,0x1f + +0000002e <.LBE10>: + 2e: 02929663 bne t0,s1,5a <.L2> + 32: 00e36333 or t1,t1,a4 + +00000036 <.LVL6>: + 36: 08031863 bnez t1,c6 <.L24> + 3a: 00550663 beq a0,t0,46 <.L4> + +0000003e <.L20>: + 3e: 4505 li a0,1 + 40: c989 beqz a1,52 <.L1> + 42: 557d li a0,-1 + 44: a039 j 52 <.L1> + +00000046 <.L4>: + 46: 8e5d or a2,a2,a5 + +00000048 <.LVL9>: + 48: 5579 li a0,-2 + +0000004a <.LVL10>: + 4a: e601 bnez a2,52 <.L1> + +0000004c <.LBB12>: + 4c: 4501 li a0,0 + 4e: fed598e3 bne a1,a3,3e <.L20> + +00000052 <.L1>: + 52: 4412 lw s0,4(sp) + 54: 4482 lw s1,0(sp) + 56: 0121 add sp,sp,8 + 58: 8082 ret + +0000005a <.L2>: + 5a: 02951563 bne a0,s1,84 <.L8> + 5e: 8e5d or a2,a2,a5 + +00000060 <.LVL12>: + 60: 5579 li a0,-2 + +00000062 <.LVL13>: + 62: fa65 bnez a2,52 <.L1> + +00000064 <.LBB13>: + 64: 00028863 beqz t0,74 <.L9> + +00000068 <.L61>: + 68: fcd59be3 bne a1,a3,3e <.L20> + +0000006c <.L21>: + 6c: 557d li a0,-1 + 6e: d1f5 beqz a1,52 <.L1> + 70: 852e mv a0,a1 + 72: b7c5 j 52 <.L1> + +00000074 <.L9>: + 74: 00e36333 or t1,t1,a4 + +00000078 <.LVL16>: + 78: fe0318e3 bnez t1,68 <.L61> + +0000007c <.L11>: + 7c: 557d li a0,-1 + 7e: daf1 beqz a3,52 <.L1> + 80: 8536 mv a0,a3 + 82: bfc1 j 52 <.L1> + +00000084 <.L8>: + 84: 8432 mv s0,a2 + 86: 02028363 beqz t0,ac <.L12> + +0000008a <.LVL18>: + 8a: d955 beqz a0,3e <.L20> + +0000008c <.LVL19>: + 8c: fad599e3 bne a1,a3,3e <.L20> + 90: fa5547e3 blt a0,t0,3e <.L20> + 94: fca2cce3 blt t0,a0,6c <.L21> + +00000098 <.L19>: + 98: fa67e3e3 bltu a5,t1,3e <.L20> + 9c: fcf318e3 bne t1,a5,6c <.L21> + a0: f8746fe3 bltu s0,t2,3e <.L20> + a4: 4501 li a0,0 + +000000a6 <.LVL21>: + a6: fa83f6e3 bgeu t2,s0,52 <.L1> + aa: b7c9 j 6c <.L21> + +000000ac <.L12>: + ac: 00e36733 or a4,t1,a4 + +000000b0 <.LVL23>: + b0: c119 beqz a0,b6 <.L14> + +000000b2 <.LVL24>: + b2: d769 beqz a4,7c <.L11> + b4: bf55 j 68 <.L61> + +000000b6 <.L14>: + b6: 8e5d or a2,a2,a5 + +000000b8 <.LVL26>: + b8: c609 beqz a2,c2 <.L15> + +000000ba <.LVL27>: + ba: d369 beqz a4,7c <.L11> + +000000bc <.LVL28>: + bc: fcd58ee3 beq a1,a3,98 <.L19> + c0: bfbd j 3e <.L20> + +000000c2 <.L15>: + c2: db41 beqz a4,52 <.L1> + c4: bfad j 3e <.L20> + +000000c6 <.L24>: + c6: 5579 li a0,-2 + +000000c8 <.LVL31>: + c8: b769 j 52 <.L1> + +ledf2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__ledf2>: + 0: 1161 add sp,sp,-8 + +00000002 <.LBB3>: + 2: 0145d293 srl t0,a1,0x14 + 6: 001007b7 lui a5,0x100 + a: 17fd add a5,a5,-1 # fffff <.LASF16+0xffe26> + +0000000c <.LBE3>: + c: c026 sw s1,0(sp) + e: 872a mv a4,a0 + 10: 83aa mv t2,a0 + +00000012 <.LBB4>: + 12: c222 sw s0,4(sp) + +00000014 <.LBB5>: + 14: 0146d513 srl a0,a3,0x14 + +00000018 <.LBB6>: + 18: 7ff2f293 and t0,t0,2047 + +0000001c <.LBE6>: + 1c: 7ff00493 li s1,2047 + +00000020 <.LBB7>: + 20: 00b7f333 and t1,a5,a1 + +00000024 <.LBB8>: + 24: 7ff57513 and a0,a0,2047 + 28: 8ff5 and a5,a5,a3 + +0000002a <.LBB9>: + 2a: 81fd srl a1,a1,0x1f + +0000002c <.LBB10>: + 2c: 82fd srl a3,a3,0x1f + +0000002e <.LBE10>: + 2e: 02929663 bne t0,s1,5a <.L2> + 32: 00e36333 or t1,t1,a4 + +00000036 <.LVL6>: + 36: 08031863 bnez t1,c6 <.L24> + 3a: 00550663 beq a0,t0,46 <.L4> + +0000003e <.L20>: + 3e: 4505 li a0,1 + 40: c989 beqz a1,52 <.L1> + 42: 557d li a0,-1 + 44: a039 j 52 <.L1> + +00000046 <.L4>: + 46: 8e5d or a2,a2,a5 + +00000048 <.LVL9>: + 48: 4509 li a0,2 + +0000004a <.LVL10>: + 4a: e601 bnez a2,52 <.L1> + +0000004c <.LBB12>: + 4c: 4501 li a0,0 + 4e: fed598e3 bne a1,a3,3e <.L20> + +00000052 <.L1>: + 52: 4412 lw s0,4(sp) + 54: 4482 lw s1,0(sp) + 56: 0121 add sp,sp,8 + 58: 8082 ret + +0000005a <.L2>: + 5a: 02951563 bne a0,s1,84 <.L8> + 5e: 8e5d or a2,a2,a5 + +00000060 <.LVL12>: + 60: 4509 li a0,2 + +00000062 <.LVL13>: + 62: fa65 bnez a2,52 <.L1> + +00000064 <.LBB13>: + 64: 00028863 beqz t0,74 <.L9> + +00000068 <.L61>: + 68: fcd59be3 bne a1,a3,3e <.L20> + +0000006c <.L21>: + 6c: 557d li a0,-1 + 6e: d1f5 beqz a1,52 <.L1> + 70: 852e mv a0,a1 + 72: b7c5 j 52 <.L1> + +00000074 <.L9>: + 74: 00e36333 or t1,t1,a4 + +00000078 <.LVL16>: + 78: fe0318e3 bnez t1,68 <.L61> + +0000007c <.L11>: + 7c: 557d li a0,-1 + 7e: daf1 beqz a3,52 <.L1> + 80: 8536 mv a0,a3 + 82: bfc1 j 52 <.L1> + +00000084 <.L8>: + 84: 8432 mv s0,a2 + 86: 02028363 beqz t0,ac <.L12> + +0000008a <.LVL18>: + 8a: d955 beqz a0,3e <.L20> + +0000008c <.LVL19>: + 8c: fad599e3 bne a1,a3,3e <.L20> + 90: fa5547e3 blt a0,t0,3e <.L20> + 94: fca2cce3 blt t0,a0,6c <.L21> + +00000098 <.L19>: + 98: fa67e3e3 bltu a5,t1,3e <.L20> + 9c: fcf318e3 bne t1,a5,6c <.L21> + a0: f8746fe3 bltu s0,t2,3e <.L20> + a4: 4501 li a0,0 + +000000a6 <.LVL21>: + a6: fa83f6e3 bgeu t2,s0,52 <.L1> + aa: b7c9 j 6c <.L21> + +000000ac <.L12>: + ac: 00e36733 or a4,t1,a4 + +000000b0 <.LVL23>: + b0: c119 beqz a0,b6 <.L14> + +000000b2 <.LVL24>: + b2: d769 beqz a4,7c <.L11> + b4: bf55 j 68 <.L61> + +000000b6 <.L14>: + b6: 8e5d or a2,a2,a5 + +000000b8 <.LVL26>: + b8: c609 beqz a2,c2 <.L15> + +000000ba <.LVL27>: + ba: d369 beqz a4,7c <.L11> + +000000bc <.LVL28>: + bc: fcd58ee3 beq a1,a3,98 <.L19> + c0: bfbd j 3e <.L20> + +000000c2 <.L15>: + c2: db41 beqz a4,52 <.L1> + c4: bfad j 3e <.L20> + +000000c6 <.L24>: + c6: 4509 li a0,2 + +000000c8 <.LVL31>: + c8: b769 j 52 <.L1> + +muldf3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__muldf3>: + 0: fc410113 add sp,sp,-60 + +00000004 <.LBB3>: + 4: 00c59793 sll a5,a1,0xc + +00000008 <.LBE3>: + 8: d826 sw s1,48(sp) + +0000000a <.LBB4>: + a: 0145d313 srl t1,a1,0x14 + e: 00c7d493 srl s1,a5,0xc + +00000012 <.LVL1>: + 12: 01f5d793 srl a5,a1,0x1f + +00000016 <.LBE4>: + 16: da22 sw s0,52(sp) + 18: dc06 sw ra,56(sp) + +0000001a <.LBB5>: + 1a: 7ff37313 and t1,t1,2047 + +0000001e <.LVL2>: + 1e: c43e sw a5,8(sp) + +00000020 <.LBE5>: + 20: 8436 mv s0,a3 + 22: 30030363 beqz t1,328 <.L2> + 26: 7ff00793 li a5,2047 + 2a: 36f30463 beq t1,a5,392 <.L3> + +0000002e <.LVL4>: + 2e: 00349693 sll a3,s1,0x3 + 32: 01d55793 srl a5,a0,0x1d + 36: 8fd5 or a5,a5,a3 + 38: 008006b7 lui a3,0x800 + 3c: 00d7e4b3 or s1,a5,a3 + +00000040 <.LVL5>: + 40: 00351593 sll a1,a0,0x3 + +00000044 <.LVL6>: + 44: c0130313 add t1,t1,-1023 + +00000048 <.L76>: + 48: 4281 li t0,0 + +0000004a <.L4>: + 4a: 01445713 srl a4,s0,0x14 + 4e: 00c41793 sll a5,s0,0xc + 52: 7ff77713 and a4,a4,2047 + 56: 83b1 srl a5,a5,0xc + +00000058 <.LVL9>: + 58: 807d srl s0,s0,0x1f + +0000005a <.LBE10>: + 5a: 34070d63 beqz a4,3b4 <.L9> + 5e: 7ff00693 li a3,2047 + 62: 3cd70a63 beq a4,a3,436 <.L10> + +00000066 <.LVL11>: + 66: 01d65693 srl a3,a2,0x1d + 6a: 078e sll a5,a5,0x3 + +0000006c <.LVL12>: + 6c: 8edd or a3,a3,a5 + 6e: 008007b7 lui a5,0x800 + 72: 8fd5 or a5,a5,a3 + +00000074 <.LVL13>: + 74: 00361693 sll a3,a2,0x3 + +00000078 <.LVL14>: + 78: c0170613 add a2,a4,-1023 + +0000007c <.L77>: + 7c: 4701 li a4,0 + +0000007e <.L11>: + 7e: 4522 lw a0,8(sp) + 80: 961a add a2,a2,t1 + +00000082 <.LVL17>: + 82: d232 sw a2,36(sp) + 84: 0605 add a2,a2,1 + 86: 8d21 xor a0,a0,s0 + 88: c232 sw a2,4(sp) + 8a: 00229613 sll a2,t0,0x2 + 8e: c02a sw a0,0(sp) + +00000090 <.LVL18>: + 90: 8e59 or a2,a2,a4 + 92: 4529 li a0,10 + +00000094 <.LVL19>: + 94: 3ec54d63 blt a0,a2,48e <.L16> + 98: 4509 li a0,2 + 9a: 3ac54f63 blt a0,a2,458 <.L17> + 9e: 167d add a2,a2,-1 + a0: 4505 li a0,1 + a2: 3cc57a63 bgeu a0,a2,476 <.L19> + +000000a6 <.L18>: + a6: 0105d713 srl a4,a1,0x10 + +000000aa <.LVL21>: + aa: c43a sw a4,8(sp) + +000000ac <.LVL22>: + ac: 62c1 lui t0,0x10 + +000000ae <.LVL23>: + ae: 0106d713 srl a4,a3,0x10 + b2: c63a sw a4,12(sp) + +000000b4 <.LBB18>: + b4: fff28713 add a4,t0,-1 # ffff <.LLST81+0xf1c4> + b8: 00e5f633 and a2,a1,a4 + bc: 8ef9 and a3,a3,a4 + +000000be <.LVL25>: + be: ca32 sw a2,20(sp) + c0: 8532 mv a0,a2 + c2: cc36 sw a3,24(sp) + c4: 85b6 mv a1,a3 + +000000c6 <.LVL26>: + c6: 00000097 auipc ra,0x0 + ca: 000080e7 jalr ra # c6 <.LVL26> + ce: 83aa mv t2,a0 + +000000d0 <.LBB19>: + d0: 45b2 lw a1,12(sp) + d2: 4552 lw a0,20(sp) + d4: 00000097 auipc ra,0x0 + d8: 000080e7 jalr ra # d4 <.LBB19+0x4> + dc: 832a mv t1,a0 + +000000de <.LBB20>: + de: 45e2 lw a1,24(sp) + e0: 4522 lw a0,8(sp) + e2: 00000097 auipc ra,0x0 + e6: 000080e7 jalr ra # e2 <.LBB20+0x4> + ea: 842a mv s0,a0 + +000000ec <.LBB21>: + ec: 45b2 lw a1,12(sp) + ee: 4522 lw a0,8(sp) + f0: 00000097 auipc ra,0x0 + f4: 000080e7 jalr ra # f0 <.LBB21+0x4> + +000000f8 <.LBE21>: + f8: 0103d693 srl a3,t2,0x10 + fc: 9322 add t1,t1,s0 + +000000fe <.LBB22>: + fe: d02a sw a0,32(sp) + +00000100 <.LBE22>: + 100: 9336 add t1,t1,a3 + +00000102 <.LVL32>: + 102: 00837563 bgeu t1,s0,10c <.L23> + 106: 005506b3 add a3,a0,t0 + 10a: d036 sw a3,32(sp) + +0000010c <.L23>: + 10c: 01035293 srl t0,t1,0x10 + +00000110 <.LVL34>: + 110: 00e37333 and t1,t1,a4 + +00000114 <.LVL35>: + 114: 0342 sll t1,t1,0x10 + 116: 00e3f6b3 and a3,t2,a4 + 11a: 969a add a3,a3,t1 + 11c: d436 sw a3,40(sp) + +0000011e <.LBB23>: + 11e: 0107d693 srl a3,a5,0x10 + +00000122 <.LVL37>: + 122: 8ff9 and a5,a5,a4 + +00000124 <.LBB24>: + 124: 4552 lw a0,20(sp) + +00000126 <.LBE24>: + 126: c836 sw a3,16(sp) + +00000128 <.LBB25>: + 128: ce3e sw a5,28(sp) + 12a: 85be mv a1,a5 + 12c: 00000097 auipc ra,0x0 + 130: 000080e7 jalr ra # 12c <.LBB25+0x4> + 134: 872a mv a4,a0 + +00000136 <.LBB26>: + 136: 45c2 lw a1,16(sp) + 138: 4552 lw a0,20(sp) + +0000013a <.LVL41>: + 13a: 00000097 auipc ra,0x0 + 13e: 000080e7 jalr ra # 13a <.LVL41> + 142: 87aa mv a5,a0 + +00000144 <.LBB27>: + 144: 45f2 lw a1,28(sp) + 146: 4522 lw a0,8(sp) + +00000148 <.LVL43>: + 148: 00000097 auipc ra,0x0 + 14c: 000080e7 jalr ra # 148 <.LVL43> + 150: 832a mv t1,a0 + +00000152 <.LBB28>: + 152: 45c2 lw a1,16(sp) + 154: 4522 lw a0,8(sp) + 156: 00000097 auipc ra,0x0 + 15a: 000080e7 jalr ra # 156 <.LBB28+0x4> + +0000015e <.LBE28>: + 15e: 01075693 srl a3,a4,0x10 + 162: 979a add a5,a5,t1 + +00000164 <.LVL46>: + 164: 96be add a3,a3,a5 + +00000166 <.LVL47>: + 166: 0066f463 bgeu a3,t1,16e <.L24> + 16a: 67c1 lui a5,0x10 + 16c: 953e add a0,a0,a5 + +0000016e <.L24>: + 16e: 0106d793 srl a5,a3,0x10 + 172: 97aa add a5,a5,a0 + 174: 6341 lui t1,0x10 + +00000176 <.LVL49>: + 176: d63e sw a5,44(sp) + +00000178 <.LVL50>: + 178: fff30793 add a5,t1,-1 # ffff <.LLST81+0xf1c4> + +0000017c <.LVL51>: + 17c: 8efd and a3,a3,a5 + +0000017e <.LVL52>: + 17e: 06c2 sll a3,a3,0x10 + 180: 8f7d and a4,a4,a5 + +00000182 <.LVL53>: + 182: 9736 add a4,a4,a3 + 184: ca3a sw a4,20(sp) + 186: 92ba add t0,t0,a4 + +00000188 <.LBB29>: + 188: 8fe5 and a5,a5,s1 + 18a: 0104d713 srl a4,s1,0x10 + +0000018e <.LBB30>: + 18e: 45e2 lw a1,24(sp) + +00000190 <.LBE30>: + 190: c43a sw a4,8(sp) + +00000192 <.LBB31>: + 192: 853e mv a0,a5 + +00000194 <.LVL57>: + 194: 00000097 auipc ra,0x0 + 198: 000080e7 jalr ra # 194 <.LVL57> + 19c: 872a mv a4,a0 + +0000019e <.LBB32>: + 19e: 45b2 lw a1,12(sp) + 1a0: 853e mv a0,a5 + +000001a2 <.LVL59>: + 1a2: 00000097 auipc ra,0x0 + 1a6: 000080e7 jalr ra # 1a2 <.LVL59> + 1aa: 83aa mv t2,a0 + +000001ac <.LBB33>: + 1ac: 45e2 lw a1,24(sp) + 1ae: 4522 lw a0,8(sp) + 1b0: 00000097 auipc ra,0x0 + 1b4: 000080e7 jalr ra # 1b0 <.LBB33+0x4> + 1b8: 842a mv s0,a0 + +000001ba <.LBB34>: + 1ba: 45b2 lw a1,12(sp) + 1bc: 4522 lw a0,8(sp) + 1be: 00000097 auipc ra,0x0 + 1c2: 000080e7 jalr ra # 1be <.LBB34+0x4> + +000001c6 <.LBE34>: + 1c6: 01075693 srl a3,a4,0x10 + 1ca: 93a2 add t2,t2,s0 + +000001cc <.LVL63>: + 1cc: 93b6 add t2,t2,a3 + +000001ce <.LVL64>: + 1ce: 0083f363 bgeu t2,s0,1d4 <.L25> + 1d2: 951a add a0,a0,t1 + +000001d4 <.L25>: + 1d4: 6441 lui s0,0x10 + +000001d6 <.LVL66>: + 1d6: fff40313 add t1,s0,-1 # ffff <.LLST81+0xf1c4> + 1da: 0103d693 srl a3,t2,0x10 + 1de: 0063f3b3 and t2,t2,t1 + +000001e2 <.LVL67>: + 1e2: 03c2 sll t2,t2,0x10 + 1e4: 00677733 and a4,a4,t1 + +000001e8 <.LVL68>: + 1e8: 971e add a4,a4,t2 + 1ea: 00a684b3 add s1,a3,a0 + +000001ee <.LBB35>: + 1ee: 45f2 lw a1,28(sp) + +000001f0 <.LBB41>: + 1f0: c63a sw a4,12(sp) + +000001f2 <.LBB37>: + 1f2: 853e mv a0,a5 + +000001f4 <.LVL71>: + 1f4: 00000097 auipc ra,0x0 + 1f8: 000080e7 jalr ra # 1f4 <.LVL71> + 1fc: 872a mv a4,a0 + +000001fe <.LBB38>: + 1fe: 45c2 lw a1,16(sp) + 200: 853e mv a0,a5 + +00000202 <.LVL73>: + 202: 00000097 auipc ra,0x0 + 206: 000080e7 jalr ra # 202 <.LVL73> + 20a: 87aa mv a5,a0 + +0000020c <.LBB39>: + 20c: 45f2 lw a1,28(sp) + 20e: 4522 lw a0,8(sp) + +00000210 <.LVL75>: + 210: 00000097 auipc ra,0x0 + 214: 000080e7 jalr ra # 210 <.LVL75> + 218: 83aa mv t2,a0 + +0000021a <.LBB40>: + 21a: 45c2 lw a1,16(sp) + 21c: 4522 lw a0,8(sp) + 21e: 00000097 auipc ra,0x0 + 222: 000080e7 jalr ra # 21e <.LBB40+0x4> + +00000226 <.LBE40>: + 226: 01075693 srl a3,a4,0x10 + 22a: 979e add a5,a5,t2 + +0000022c <.LVL78>: + 22c: 97b6 add a5,a5,a3 + +0000022e <.LVL79>: + 22e: 0077f363 bgeu a5,t2,234 <.L26> + 232: 9522 add a0,a0,s0 + +00000234 <.L26>: + 234: 0067f633 and a2,a5,t1 + 238: 0642 sll a2,a2,0x10 + 23a: 00677733 and a4,a4,t1 + +0000023e <.LBB45>: + 23e: 5682 lw a3,32(sp) + +00000240 <.LBB46>: + 240: 9732 add a4,a4,a2 + +00000242 <.LBB47>: + 242: 45d2 lw a1,20(sp) + 244: 5632 lw a2,44(sp) + 246: 9696 add a3,a3,t0 + +00000248 <.LVL82>: + 248: 00b6b5b3 sltu a1,a3,a1 + +0000024c <.LVL83>: + 24c: 963a add a2,a2,a4 + +0000024e <.LVL84>: + 24e: 95b2 add a1,a1,a2 + 250: 00e63733 sltu a4,a2,a4 + +00000254 <.LVL85>: + 254: 00c5b633 sltu a2,a1,a2 + 258: 8e59 or a2,a2,a4 + +0000025a <.LBB48>: + 25a: 83c1 srl a5,a5,0x10 + +0000025c <.LVL86>: + 25c: 963e add a2,a2,a5 + +0000025e <.LBB49>: + 25e: 47b2 lw a5,12(sp) + 260: 009582b3 add t0,a1,s1 + 264: 00f68733 add a4,a3,a5 + +00000268 <.LVL88>: + 268: 00d736b3 sltu a3,a4,a3 + +0000026c <.LVL89>: + 26c: 00d28333 add t1,t0,a3 + +00000270 <.LBB51>: + 270: 00b2b7b3 sltu a5,t0,a1 + +00000274 <.LVL91>: + 274: 005332b3 sltu t0,t1,t0 + +00000278 <.LVL92>: + 278: 0057e7b3 or a5,a5,t0 + +0000027c <.LVL93>: + 27c: 97b2 add a5,a5,a2 + 27e: 97aa add a5,a5,a0 + +00000280 <.LBB54>: + 280: 5622 lw a2,40(sp) + 282: 01735693 srl a3,t1,0x17 + +00000286 <.LVL94>: + 286: 07a6 sll a5,a5,0x9 + 288: 8fd5 or a5,a5,a3 + +0000028a <.LBB55>: + 28a: 00971693 sll a3,a4,0x9 + 28e: 8ed1 or a3,a3,a2 + +00000290 <.LVL96>: + 290: 835d srl a4,a4,0x17 + +00000292 <.LVL97>: + 292: 00d036b3 snez a3,a3 + +00000296 <.LBE55>: + 296: 8ed9 or a3,a3,a4 + +00000298 <.LBE15>: + 298: 01000737 lui a4,0x1000 + +0000029c <.LBB56>: + 29c: 0326 sll t1,t1,0x9 + +0000029e <.LBE56>: + 29e: 8f7d and a4,a4,a5 + +000002a0 <.LBB60>: + 2a0: 0066e6b3 or a3,a3,t1 + +000002a4 <.LBE60>: + 2a4: 20070163 beqz a4,4a6 <.L57> + 2a8: 0016d713 srl a4,a3,0x1 + 2ac: 8a85 and a3,a3,1 + +000002ae <.LVL100>: + 2ae: 8f55 or a4,a4,a3 + 2b0: 01f79693 sll a3,a5,0x1f + 2b4: 8ed9 or a3,a3,a4 + +000002b6 <.LVL101>: + 2b6: 8385 srl a5,a5,0x1 + +000002b8 <.L37>: + 2b8: 4712 lw a4,4(sp) + 2ba: 3ff70513 add a0,a4,1023 # 10003ff <.LLST81+0xfff5c4> + +000002be <.LVL103>: + 2be: 1ea05763 blez a0,4ac <.L38> + 2c2: 0076f713 and a4,a3,7 + 2c6: cf01 beqz a4,2de <.L39> + 2c8: 00f6f713 and a4,a3,15 + 2cc: 4611 li a2,4 + 2ce: 00c70863 beq a4,a2,2de <.L39> + +000002d2 <.LBB64>: + 2d2: 00468713 add a4,a3,4 # 800004 <.LLST81+0x7ff1c9> + 2d6: 00d73633 sltu a2,a4,a3 + 2da: 97b2 add a5,a5,a2 + 2dc: 86ba mv a3,a4 + +000002de <.L39>: + 2de: 01000737 lui a4,0x1000 + 2e2: 8f7d and a4,a4,a5 + 2e4: cb01 beqz a4,2f4 <.L42> + 2e6: ff000737 lui a4,0xff000 + 2ea: 177d add a4,a4,-1 # feffffff <.LLST81+0xfefff1c4> + 2ec: 8ff9 and a5,a5,a4 + 2ee: 4712 lw a4,4(sp) + 2f0: 40070513 add a0,a4,1024 + +000002f4 <.L42>: + 2f4: 7fe00713 li a4,2046 + 2f8: 24a74a63 blt a4,a0,54c <.L61> + 2fc: 01d79613 sll a2,a5,0x1d + +00000300 <.LVL107>: + 300: 828d srl a3,a3,0x3 + +00000302 <.LVL108>: + 302: 8e55 or a2,a2,a3 + +00000304 <.LVL109>: + 304: 838d srl a5,a5,0x3 + +00000306 <.L20>: + 306: 07b2 sll a5,a5,0xc + +00000308 <.LVL111>: + 308: 01451713 sll a4,a0,0x14 + 30c: 83b1 srl a5,a5,0xc + 30e: 8fd9 or a5,a5,a4 + 310: 4702 lw a4,0(sp) + +00000312 <.LBE67>: + 312: 50e2 lw ra,56(sp) + 314: 5452 lw s0,52(sp) + +00000316 <.LBB68>: + 316: 077e sll a4,a4,0x1f + 318: 00e7e6b3 or a3,a5,a4 + +0000031c <.LBE68>: + 31c: 54c2 lw s1,48(sp) + 31e: 8532 mv a0,a2 + +00000320 <.LVL113>: + 320: 85b6 mv a1,a3 + 322: 03c10113 add sp,sp,60 + +00000326 <.LVL114>: + 326: 8082 ret + +00000328 <.L2>: + 328: 00a4e5b3 or a1,s1,a0 + 32c: c9bd beqz a1,3a2 <.L50> + +0000032e <.LBB69>: + 32e: c232 sw a2,4(sp) + 330: cc95 beqz s1,36c <.L5> + 332: c02a sw a0,0(sp) + 334: 8526 mv a0,s1 + +00000336 <.LVL116>: + 336: 00000097 auipc ra,0x0 + 33a: 000080e7 jalr ra # 336 <.LVL116> + +0000033e <.LVL117>: + 33e: 4702 lw a4,0(sp) + 340: 4612 lw a2,4(sp) + 342: ff550593 add a1,a0,-11 + +00000346 <.L6>: + 346: 47f5 li a5,29 + 348: ff850693 add a3,a0,-8 + 34c: 8f8d sub a5,a5,a1 + 34e: 00d49333 sll t1,s1,a3 + 352: 00f757b3 srl a5,a4,a5 + 356: 0067e7b3 or a5,a5,t1 + +0000035a <.LVL119>: + 35a: 00d714b3 sll s1,a4,a3 + +0000035e <.L8>: + 35e: c0d00313 li t1,-1011 + 362: 85a6 mv a1,s1 + +00000364 <.LVL121>: + 364: 40a30333 sub t1,t1,a0 + +00000368 <.LVL122>: + 368: 84be mv s1,a5 + +0000036a <.LVL123>: + 36a: b9f9 j 48 <.L76> + +0000036c <.L5>: + 36c: c02a sw a0,0(sp) + 36e: 00000097 auipc ra,0x0 + 372: 000080e7 jalr ra # 36e <.L5+0x2> + +00000376 <.LVL125>: + 376: 87aa mv a5,a0 + +00000378 <.LVL126>: + 378: 01578593 add a1,a5,21 # 10015 <.LLST81+0xf1da> + 37c: 46f1 li a3,28 + 37e: 4702 lw a4,0(sp) + 380: 4612 lw a2,4(sp) + 382: 02050513 add a0,a0,32 + +00000386 <.LVL127>: + 386: fcb6d0e3 bge a3,a1,346 <.L6> + +0000038a <.LVL128>: + 38a: 17e1 add a5,a5,-8 + 38c: 00f717b3 sll a5,a4,a5 + +00000390 <.LVL129>: + 390: b7f9 j 35e <.L8> + +00000392 <.L3>: + 392: 00a4e5b3 or a1,s1,a0 + 396: c991 beqz a1,3aa <.L51> + 398: 85aa mv a1,a0 + +0000039a <.LBB70>: + 39a: 7ff00313 li t1,2047 + +0000039e <.LBE70>: + 39e: 428d li t0,3 + 3a0: b16d j 4a <.L4> + +000003a2 <.L50>: + 3a2: 4481 li s1,0 + +000003a4 <.LVL133>: + 3a4: 4301 li t1,0 + +000003a6 <.LBE71>: + 3a6: 4285 li t0,1 + 3a8: b14d j 4a <.L4> + +000003aa <.L51>: + 3aa: 4481 li s1,0 + +000003ac <.LVL136>: + 3ac: 7ff00313 li t1,2047 + +000003b0 <.LBE72>: + 3b0: 4289 li t0,2 + 3b2: b961 j 4a <.L4> + +000003b4 <.L9>: + 3b4: 00c7e6b3 or a3,a5,a2 + 3b8: c6d9 beqz a3,446 <.L52> + +000003ba <.LBB73>: + 3ba: c3b9 beqz a5,400 <.L12> + 3bc: 853e mv a0,a5 + 3be: ca32 sw a2,20(sp) + 3c0: c82e sw a1,16(sp) + 3c2: c61a sw t1,12(sp) + 3c4: c216 sw t0,4(sp) + 3c6: c03e sw a5,0(sp) + 3c8: 00000097 auipc ra,0x0 + 3cc: 000080e7 jalr ra # 3c8 <.LBB73+0xe> + +000003d0 <.LVL139>: + 3d0: 4782 lw a5,0(sp) + 3d2: 4292 lw t0,4(sp) + 3d4: 4332 lw t1,12(sp) + 3d6: 45c2 lw a1,16(sp) + 3d8: 4652 lw a2,20(sp) + 3da: ff550693 add a3,a0,-11 + +000003de <.L13>: + 3de: 4775 li a4,29 + 3e0: ff850393 add t2,a0,-8 + 3e4: 8f15 sub a4,a4,a3 + 3e6: 007797b3 sll a5,a5,t2 + +000003ea <.LVL141>: + 3ea: 00e65733 srl a4,a2,a4 + 3ee: 8f5d or a4,a4,a5 + +000003f0 <.LVL142>: + 3f0: 007617b3 sll a5,a2,t2 + +000003f4 <.L15>: + 3f4: c0d00613 li a2,-1011 + 3f8: 86be mv a3,a5 + +000003fa <.LVL144>: + 3fa: 8e09 sub a2,a2,a0 + +000003fc <.LVL145>: + 3fc: 87ba mv a5,a4 + +000003fe <.LVL146>: + 3fe: b9bd j 7c <.L77> + +00000400 <.L12>: + 400: 8532 mv a0,a2 + 402: ca3e sw a5,20(sp) + 404: c82e sw a1,16(sp) + 406: c61a sw t1,12(sp) + 408: c216 sw t0,4(sp) + 40a: c032 sw a2,0(sp) + 40c: 00000097 auipc ra,0x0 + 410: 000080e7 jalr ra # 40c <.L12+0xc> + +00000414 <.LVL148>: + 414: 872a mv a4,a0 + +00000416 <.LVL149>: + 416: 01570693 add a3,a4,21 + 41a: 43f1 li t2,28 + 41c: 4602 lw a2,0(sp) + 41e: 4292 lw t0,4(sp) + 420: 4332 lw t1,12(sp) + 422: 45c2 lw a1,16(sp) + 424: 47d2 lw a5,20(sp) + 426: 02050513 add a0,a0,32 + +0000042a <.LVL150>: + 42a: fad3dae3 bge t2,a3,3de <.L13> + +0000042e <.LVL151>: + 42e: 1761 add a4,a4,-8 + 430: 00e61733 sll a4,a2,a4 + +00000434 <.LVL152>: + 434: b7c1 j 3f4 <.L15> + +00000436 <.L10>: + 436: 00c7e6b3 or a3,a5,a2 + 43a: ca91 beqz a3,44e <.L53> + 43c: 86b2 mv a3,a2 + 43e: 470d li a4,3 + +00000440 <.LBB74>: + 440: 7ff00613 li a2,2047 + +00000444 <.LVL155>: + 444: b92d j 7e <.L11> + +00000446 <.L52>: + 446: 4781 li a5,0 + +00000448 <.LVL157>: + 448: 4601 li a2,0 + +0000044a <.LBE74>: + 44a: 4705 li a4,1 + +0000044c <.LVL159>: + 44c: b90d j 7e <.L11> + +0000044e <.L53>: + 44e: 4781 li a5,0 + +00000450 <.LVL161>: + 450: 7ff00613 li a2,2047 + +00000454 <.LBE75>: + 454: 4709 li a4,2 + +00000456 <.LVL163>: + 456: b125 j 7e <.L11> + +00000458 <.L17>: + 458: 4505 li a0,1 + 45a: 00c51533 sll a0,a0,a2 + 45e: 53057613 and a2,a0,1328 + 462: ee15 bnez a2,49e <.L54> + 464: 24057313 and t1,a0,576 + +00000468 <.LVL165>: + 468: 0c031863 bnez t1,538 <.L55> + 46c: 08857513 and a0,a0,136 + 470: c2050be3 beqz a0,a6 <.L18> + +00000474 <.L21>: + 474: c022 sw s0,0(sp) + +00000476 <.L19>: + 476: 4609 li a2,2 + 478: 0cc70a63 beq a4,a2,54c <.L61> + 47c: 460d li a2,3 + 47e: 0cc70363 beq a4,a2,544 <.L59> + 482: 4605 li a2,1 + 484: e2c71ae3 bne a4,a2,2b8 <.L37> + +00000488 <.L63>: + 488: 4781 li a5,0 + 48a: 4601 li a2,0 + 48c: a041 j 50c <.L79> + +0000048e <.L16>: + 48e: 453d li a0,15 + 490: 0aa60a63 beq a2,a0,544 <.L59> + 494: 452d li a0,11 + 496: fca60fe3 beq a2,a0,474 <.L21> + +0000049a <.LBB82>: + 49a: 47a2 lw a5,8(sp) + +0000049c <.LVL169>: + 49c: c03e sw a5,0(sp) + +0000049e <.L54>: + 49e: 87a6 mv a5,s1 + 4a0: 86ae mv a3,a1 + +000004a2 <.LVL171>: + 4a2: 8716 mv a4,t0 + +000004a4 <.LVL172>: + 4a4: bfc9 j 476 <.L19> + +000004a6 <.L57>: + 4a6: 5712 lw a4,36(sp) + 4a8: c23a sw a4,4(sp) + +000004aa <.LVL174>: + 4aa: b539 j 2b8 <.L37> + +000004ac <.L38>: + 4ac: 4585 li a1,1 + 4ae: c909 beqz a0,4c0 <.L43> + 4b0: 8d89 sub a1,a1,a0 + +000004b2 <.LVL176>: + 4b2: 03800713 li a4,56 + 4b6: fcb749e3 blt a4,a1,488 <.L63> + 4ba: 477d li a4,31 + 4bc: 04b74a63 blt a4,a1,510 <.L44> + +000004c0 <.L43>: + 4c0: 4712 lw a4,4(sp) + 4c2: 00b6d533 srl a0,a3,a1 + 4c6: 41e70613 add a2,a4,1054 + 4ca: 00c69733 sll a4,a3,a2 + 4ce: 00e03733 snez a4,a4 + 4d2: 00c79633 sll a2,a5,a2 + 4d6: 8f51 or a4,a4,a2 + 4d8: 8f49 or a4,a4,a0 + +000004da <.LVL178>: + 4da: 00b7d7b3 srl a5,a5,a1 + +000004de <.L45>: + 4de: 00777693 and a3,a4,7 + 4e2: ce81 beqz a3,4fa <.L47> + 4e4: 00f77693 and a3,a4,15 + 4e8: 4611 li a2,4 + 4ea: 00c68863 beq a3,a2,4fa <.L47> + +000004ee <.LBB79>: + 4ee: 00470693 add a3,a4,4 + 4f2: 00e6b633 sltu a2,a3,a4 + 4f6: 97b2 add a5,a5,a2 + +000004f8 <.LVL180>: + 4f8: 8736 mv a4,a3 + +000004fa <.L47>: + 4fa: 008006b7 lui a3,0x800 + 4fe: 8efd and a3,a3,a5 + 500: eab9 bnez a3,556 <.L65> + +00000502 <.LVL182>: + 502: 01d79613 sll a2,a5,0x1d + 506: 830d srl a4,a4,0x3 + +00000508 <.LVL183>: + 508: 8e59 or a2,a2,a4 + +0000050a <.LVL184>: + 50a: 838d srl a5,a5,0x3 + +0000050c <.L79>: + 50c: 4501 li a0,0 + 50e: bbe5 j 306 <.L20> + +00000510 <.L44>: + 510: 5705 li a4,-31 + 512: 8f09 sub a4,a4,a0 + 514: 02000513 li a0,32 + 518: 00e7d733 srl a4,a5,a4 + 51c: 4601 li a2,0 + 51e: 00a58763 beq a1,a0,52c <.L46> + 522: 4612 lw a2,4(sp) + 524: 43e60613 add a2,a2,1086 + 528: 00c79633 sll a2,a5,a2 + +0000052c <.L46>: + 52c: 8e55 or a2,a2,a3 + 52e: 00c03633 snez a2,a2 + 532: 8f51 or a4,a4,a2 + +00000534 <.LVL187>: + 534: 4781 li a5,0 + 536: b765 j 4de <.L45> + +00000538 <.L55>: + 538: 000807b7 lui a5,0x80 + +0000053c <.L78>: + 53c: 7ff00513 li a0,2047 + 540: c002 sw zero,0(sp) + +00000542 <.LVL190>: + 542: b3d1 j 306 <.L20> + +00000544 <.L59>: + 544: 000807b7 lui a5,0x80 + 548: 4601 li a2,0 + 54a: bfcd j 53c <.L78> + +0000054c <.L61>: + 54c: 4781 li a5,0 + 54e: 4601 li a2,0 + 550: 7ff00513 li a0,2047 + 554: bb4d j 306 <.L20> + +00000556 <.L65>: + 556: 4781 li a5,0 + +00000558 <.LVL194>: + 558: 4601 li a2,0 + 55a: 4505 li a0,1 + 55c: b36d j 306 <.L20> + +negdf2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__negdf2>: + 0: 800007b7 lui a5,0x80000 + 4: 872a mv a4,a0 + 6: 8fad xor a5,a5,a1 + +00000008 <.LBE3>: + 8: 853a mv a0,a4 + +0000000a <.LVL2>: + a: 85be mv a1,a5 + c: 8082 ret + +subdf3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__subdf3>: + 0: 00100337 lui t1,0x100 + 4: 137d add t1,t1,-1 # fffff <.LLST28+0xfed9c> + +00000006 <.LBE2>: + 6: 1131 add sp,sp,-20 + +00000008 <.LBB3>: + 8: 00b372b3 and t0,t1,a1 + +0000000c <.LVL1>: + c: 0145d713 srl a4,a1,0x14 + +00000010 <.LBE3>: + 10: 01d55793 srl a5,a0,0x1d + +00000014 <.LBB5>: + 14: 00d37333 and t1,t1,a3 + +00000018 <.LBE5>: + 18: c622 sw s0,12(sp) + 1a: c426 sw s1,8(sp) + +0000001c <.LBB6>: + 1c: 01f5d413 srl s0,a1,0x1f + 20: 7ff77493 and s1,a4,2047 + +00000024 <.LBB8>: + 24: 0146d593 srl a1,a3,0x14 + +00000028 <.LBE8>: + 28: 00329713 sll a4,t0,0x3 + 2c: 8fd9 or a5,a5,a4 + +0000002e <.LVL3>: + 2e: 030e sll t1,t1,0x3 + 30: 01d65713 srl a4,a2,0x1d + 34: c806 sw ra,16(sp) + +00000036 <.LBB11>: + 36: 7ff5f593 and a1,a1,2047 + +0000003a <.LBE11>: + 3a: 7ff00393 li t2,2047 + 3e: 050e sll a0,a0,0x3 + +00000040 <.LBB13>: + 40: 82fd srl a3,a3,0x1f + +00000042 <.LBE13>: + 42: 00676733 or a4,a4,t1 + +00000046 <.LVL6>: + 46: 060e sll a2,a2,0x3 + +00000048 <.LVL7>: + 48: 06759063 bne a1,t2,a8 <.L2> + 4c: 00c762b3 or t0,a4,a2 + +00000050 <.LBB15>: + 50: 80148313 add t1,s1,-2047 + +00000054 <.LBE15>: + 54: 00028c63 beqz t0,6c <.L3> + +00000058 <.LBB32>: + 58: 82b6 mv t0,a3 + +0000005a <.LBE32>: + 5a: 34d41b63 bne s0,a3,3b0 <.L174> + +0000005e <.LBB33>: + 5e: 1e030d63 beqz t1,258 <.L24> + +00000062 <.LVL8>: + 62: 5c049d63 bnez s1,63c <.L115> + +00000066 <.L106>: + 66: 7ff00493 li s1,2047 + +0000006a <.LVL10>: + 6a: aa59 j 200 <.L25> + +0000006c <.L3>: + 6c: 0016c293 xor t0,a3,1 + +00000070 <.LVL12>: + 70: 34541963 bne s0,t0,3c2 <.L175> + +00000074 <.LBB34>: + 74: 1e030263 beqz t1,258 <.L24> + +00000078 <.LVL13>: + 78: d4fd beqz s1,66 <.L106> + +0000007a <.LBE34>: + 7a: 4781 li a5,0 + +0000007c <.LVL14>: + 7c: 4501 li a0,0 + +0000007e <.LBB36>: + 7e: 7ff00493 li s1,2047 + +00000082 <.L95>: + 82: 008006b7 lui a3,0x800 + 86: 8efd and a3,a3,a5 + 88: 5a068f63 beqz a3,646 <.L98> + +0000008c <.LVL17>: + 8c: 0485 add s1,s1,1 + +0000008e <.LVL18>: + 8e: 7ff00713 li a4,2047 + 92: 0ce48b63 beq s1,a4,168 <.L135> + 96: ff800737 lui a4,0xff800 + 9a: 177d add a4,a4,-1 # ff7fffff <.LLST28+0xff7fed9c> + 9c: 8ff9 and a5,a5,a4 + +0000009e <.LVL19>: + 9e: 810d srl a0,a0,0x3 + +000000a0 <.LVL20>: + a0: 01d79693 sll a3,a5,0x1d + a4: 8ec9 or a3,a3,a0 + a6: a38d j 608 <.L190> + +000000a8 <.L2>: + a8: 0016c293 xor t0,a3,1 + +000000ac <.LBB48>: + ac: 40b48333 sub t1,s1,a1 + +000000b0 <.LBE48>: + b0: 22541b63 bne s0,t0,2e6 <.L8> + +000000b4 <.LBB49>: + b4: 0e605a63 blez t1,1a8 <.L9> + +000000b8 <.LVL24>: + b8: e9a1 bnez a1,108 <.L10> + ba: 00c766b3 or a3,a4,a2 + be: 58068263 beqz a3,642 <.L117> + c2: fff30693 add a3,t1,-1 + +000000c6 <.LVL25>: + c6: ee85 bnez a3,fe <.L12> + +000000c8 <.L193>: + c8: 962a add a2,a2,a0 + +000000ca <.LVL27>: + ca: 00a636b3 sltu a3,a2,a0 + +000000ce <.LVL28>: + ce: 97ba add a5,a5,a4 + +000000d0 <.LVL29>: + d0: 97b6 add a5,a5,a3 + +000000d2 <.LBE16>: + d2: 00800737 lui a4,0x800 + +000000d6 <.LVL30>: + d6: 8f7d and a4,a4,a5 + +000000d8 <.LBB17>: + d8: 8532 mv a0,a2 + +000000da <.LBE17>: + da: 1e071863 bnez a4,2ca <.L109> + +000000de <.L185>: + de: 4485 li s1,1 + +000000e0 <.L11>: + e0: 00757713 and a4,a0,7 + e4: df59 beqz a4,82 <.L95> + e6: 00f57713 and a4,a0,15 + ea: 4691 li a3,4 + ec: f8d70be3 beq a4,a3,82 <.L95> + +000000f0 <.LBB39>: + f0: 00450713 add a4,a0,4 + f4: 00a736b3 sltu a3,a4,a0 + f8: 97b6 add a5,a5,a3 + +000000fa <.LVL34>: + fa: 853a mv a0,a4 + +000000fc <.LVL35>: + fc: b759 j 82 <.L95> + +000000fe <.L12>: + fe: 06731763 bne t1,t2,16c <.L16> + +00000102 <.L132>: + 102: 7ff00493 li s1,2047 + +00000106 <.LVL38>: + 106: bfe9 j e0 <.L11> + +00000108 <.L10>: + 108: fc748ce3 beq s1,t2,e0 <.L11> + +0000010c <.LVL40>: + 10c: 03800693 li a3,56 + 110: 0666c263 blt a3,t1,174 <.L103> + 114: 008006b7 lui a3,0x800 + 118: 8f55 or a4,a4,a3 + +0000011a <.LVL41>: + 11a: 869a mv a3,t1 + +0000011c <.L18>: + 11c: 45fd li a1,31 + 11e: 04d5ce63 blt a1,a3,17a <.L19> + 122: 02000313 li t1,32 + 126: 40d30333 sub t1,t1,a3 + 12a: 00d652b3 srl t0,a2,a3 + +0000012e <.LVL43>: + 12e: 006715b3 sll a1,a4,t1 + 132: 00661333 sll t1,a2,t1 + 136: 0055e5b3 or a1,a1,t0 + 13a: 00603333 snez t1,t1 + 13e: 0065e633 or a2,a1,t1 + 142: 00d756b3 srl a3,a4,a3 + +00000146 <.L17>: + 146: 9532 add a0,a0,a2 + +00000148 <.LVL46>: + 148: 96be add a3,a3,a5 + +0000014a <.LVL47>: + 14a: 00c53633 sltu a2,a0,a2 + +0000014e <.LVL48>: + 14e: 00c687b3 add a5,a3,a2 + +00000152 <.L23>: + 152: 00800737 lui a4,0x800 + 156: 8f7d and a4,a4,a5 + 158: d741 beqz a4,e0 <.L11> + +0000015a <.LVL50>: + 15a: 0485 add s1,s1,1 + +0000015c <.LVL51>: + 15c: 7ff00713 li a4,2047 + 160: 16e49663 bne s1,a4,2cc <.L15> + +00000164 <.L42>: + 164: 7ff00493 li s1,2047 + +00000168 <.L135>: + 168: 4781 li a5,0 + 16a: aa35 j 2a6 <.L191> + +0000016c <.L16>: + 16c: 03800593 li a1,56 + +00000170 <.LVL54>: + 170: fad5d6e3 bge a1,a3,11c <.L18> + +00000174 <.L103>: + 174: 4681 li a3,0 + 176: 4605 li a2,1 + +00000178 <.LVL56>: + 178: b7f9 j 146 <.L17> + +0000017a <.L19>: + 17a: fe068593 add a1,a3,-32 # 7fffe0 <.LLST28+0x7fed7d> + 17e: 02000293 li t0,32 + +00000182 <.LVL58>: + 182: 00b755b3 srl a1,a4,a1 + 186: 4301 li t1,0 + 188: 00568863 beq a3,t0,198 <.L20> + 18c: 04000313 li t1,64 + 190: 40d30333 sub t1,t1,a3 + 194: 00671333 sll t1,a4,t1 + +00000198 <.L20>: + 198: 00c36333 or t1,t1,a2 + 19c: 00603333 snez t1,t1 + 1a0: 0065e633 or a2,a1,t1 + +000001a4 <.LVL59>: + 1a4: 4681 li a3,0 + 1a6: b745 j 146 <.L17> + +000001a8 <.L9>: + 1a8: 0a030863 beqz t1,258 <.L24> + 1ac: 409586b3 sub a3,a1,s1 + +000001b0 <.LVL61>: + 1b0: c4b9 beqz s1,1fe <.L105> + +000001b2 <.LVL62>: + 1b2: 03800313 li t1,56 + 1b6: 06d34763 blt t1,a3,224 <.L112> + 1ba: 00800337 lui t1,0x800 + 1be: 0067e7b3 or a5,a5,t1 + +000001c2 <.L32>: + 1c2: 437d li t1,31 + 1c4: 06d34363 blt t1,a3,22a <.L33> + 1c8: 02000293 li t0,32 + 1cc: 40d282b3 sub t0,t0,a3 + 1d0: 00579333 sll t1,a5,t0 + 1d4: 00d553b3 srl t2,a0,a3 + 1d8: 005512b3 sll t0,a0,t0 + 1dc: 00736333 or t1,t1,t2 + 1e0: 005032b3 snez t0,t0 + 1e4: 00536333 or t1,t1,t0 + +000001e8 <.LVL64>: + 1e8: 00d7d6b3 srl a3,a5,a3 + +000001ec <.L31>: + 1ec: 961a add a2,a2,t1 + +000001ee <.LVL66>: + 1ee: 96ba add a3,a3,a4 + +000001f0 <.LVL67>: + 1f0: 00663333 sltu t1,a2,t1 + +000001f4 <.LVL68>: + 1f4: 8532 mv a0,a2 + +000001f6 <.LVL69>: + 1f6: 006687b3 add a5,a3,t1 + +000001fa <.LBB82>: + 1fa: 84ae mv s1,a1 + +000001fc <.LBB83>: + 1fc: bf99 j 152 <.L23> + +000001fe <.L105>: + 1fe: 84b6 mv s1,a3 + +00000200 <.L25>: + 200: 00a7e6b3 or a3,a5,a0 + 204: ca89 beqz a3,216 <.L125> + 206: fff48693 add a3,s1,-1 + +0000020a <.LVL73>: + 20a: ea068fe3 beqz a3,c8 <.L193> + 20e: 7ff00313 li t1,2047 + 212: 00649563 bne s1,t1,21c <.L178> + +00000216 <.L125>: + 216: 87ba mv a5,a4 + +00000218 <.LVL75>: + 218: 8532 mv a0,a2 + +0000021a <.LVL76>: + 21a: b5d9 j e0 <.L11> + +0000021c <.L178>: + 21c: 03800313 li t1,56 + 220: fad351e3 bge t1,a3,1c2 <.L32> + +00000224 <.L112>: + 224: 4681 li a3,0 + +00000226 <.LVL79>: + 226: 4305 li t1,1 + 228: b7d1 j 1ec <.L31> + +0000022a <.L33>: + 22a: fe068313 add t1,a3,-32 + 22e: 02000393 li t2,32 + 232: 0067d333 srl t1,a5,t1 + 236: 4281 li t0,0 + 238: 00768863 beq a3,t2,248 <.L34> + 23c: 04000293 li t0,64 + 240: 40d282b3 sub t0,t0,a3 + 244: 005792b3 sll t0,a5,t0 + +00000248 <.L34>: + 248: 00a2e2b3 or t0,t0,a0 + 24c: 005032b3 snez t0,t0 + 250: 00536333 or t1,t1,t0 + +00000254 <.LVL81>: + 254: 4681 li a3,0 + +00000256 <.LVL82>: + 256: bf59 j 1ec <.L31> + +00000258 <.L24>: + 258: 00148693 add a3,s1,1 + 25c: 7fe6f593 and a1,a3,2046 + +00000260 <.LVL84>: + 260: e5a9 bnez a1,2aa <.L37> + 262: 00a7e6b3 or a3,a5,a0 + 266: e495 bnez s1,292 <.L38> + +00000268 <.LVL85>: + 268: d6dd beqz a3,216 <.L125> + 26a: 00c766b3 or a3,a4,a2 + 26e: e60689e3 beqz a3,e0 <.L11> + +00000272 <.LBB25>: + 272: 962a add a2,a2,a0 + +00000274 <.LVL86>: + 274: 00a636b3 sltu a3,a2,a0 + 278: 97ba add a5,a5,a4 + +0000027a <.LVL87>: + 27a: 97b6 add a5,a5,a3 + +0000027c <.LBE25>: + 27c: 00800737 lui a4,0x800 + +00000280 <.LVL88>: + 280: 8f7d and a4,a4,a5 + +00000282 <.LBB26>: + 282: 8532 mv a0,a2 + +00000284 <.LBE26>: + 284: e4070ee3 beqz a4,e0 <.L11> + 288: ff800737 lui a4,0xff800 + 28c: 177d add a4,a4,-1 # ff7fffff <.LLST28+0xff7fed9c> + 28e: 8ff9 and a5,a5,a4 + +00000290 <.LVL90>: + 290: b5b9 j de <.L185> + +00000292 <.L38>: + 292: 3a068563 beqz a3,63c <.L115> + 296: 8f51 or a4,a4,a2 + +00000298 <.LVL92>: + 298: e60705e3 beqz a4,102 <.L132> + +0000029c <.L189>: + 29c: 4401 li s0,0 + +0000029e <.LBB87>: + 29e: 7ff00493 li s1,2047 + +000002a2 <.LBB88>: + 2a2: 000807b7 lui a5,0x80 + +000002a6 <.L191>: + 2a6: 4681 li a3,0 + 2a8: a68d j 60a <.L41> + +000002aa <.L37>: + 2aa: 7ff00593 li a1,2047 + 2ae: eab68be3 beq a3,a1,164 <.L42> + 2b2: 962a add a2,a2,a0 + +000002b4 <.LBB29>: + 2b4: 00a63533 sltu a0,a2,a0 + +000002b8 <.LVL98>: + 2b8: 97ba add a5,a5,a4 + +000002ba <.LVL99>: + 2ba: 97aa add a5,a5,a0 + +000002bc <.LBE29>: + 2bc: 01f79513 sll a0,a5,0x1f + 2c0: 8205 srl a2,a2,0x1 + +000002c2 <.LVL100>: + 2c2: 8d51 or a0,a0,a2 + 2c4: 8385 srl a5,a5,0x1 + 2c6: 84b6 mv s1,a3 + +000002c8 <.LVL101>: + 2c8: bd21 j e0 <.L11> + +000002ca <.L109>: + 2ca: 4489 li s1,2 + +000002cc <.L15>: + 2cc: ff800737 lui a4,0xff800 + 2d0: 177d add a4,a4,-1 # ff7fffff <.LLST28+0xff7fed9c> + 2d2: 8ff9 and a5,a5,a4 + +000002d4 <.LVL104>: + 2d4: 00155713 srl a4,a0,0x1 + 2d8: 8905 and a0,a0,1 + 2da: 8f49 or a4,a4,a0 + 2dc: 01f79513 sll a0,a5,0x1f + 2e0: 8d59 or a0,a0,a4 + 2e2: 8385 srl a5,a5,0x1 + 2e4: bbf5 j e0 <.L11> + +000002e6 <.L8>: + 2e6: 0e605763 blez t1,3d4 <.L45> + +000002ea <.LVL106>: + 2ea: e995 bnez a1,31e <.L46> + 2ec: 00c766b3 or a3,a4,a2 + 2f0: 34068963 beqz a3,642 <.L117> + 2f4: fff30693 add a3,t1,-1 # 7fffff <.LLST28+0x7fed9c> + +000002f8 <.LVL107>: + 2f8: ea91 bnez a3,30c <.L47> + +000002fa <.LBB51>: + 2fa: 40c50633 sub a2,a0,a2 + +000002fe <.LVL108>: + 2fe: 00c536b3 sltu a3,a0,a2 + +00000302 <.LVL109>: + 302: 8f99 sub a5,a5,a4 + +00000304 <.LVL110>: + 304: 8532 mv a0,a2 + +00000306 <.LVL111>: + 306: 8f95 sub a5,a5,a3 + +00000308 <.L183>: + 308: 4485 li s1,1 + +0000030a <.LBB92>: + 30a: a095 j 36e <.L50> + +0000030c <.L47>: + 30c: de730be3 beq t1,t2,102 <.L132> + +00000310 <.L51>: + 310: 03800593 li a1,56 + +00000314 <.LVL114>: + 314: 00d5df63 bge a1,a3,332 <.L53> + +00000318 <.L120>: + 318: 4681 li a3,0 + 31a: 4605 li a2,1 + +0000031c <.LVL116>: + 31c: a081 j 35c <.L52> + +0000031e <.L46>: + 31e: dc7481e3 beq s1,t2,e0 <.L11> + +00000322 <.LVL118>: + 322: 03800693 li a3,56 + 326: fe66c9e3 blt a3,t1,318 <.L120> + 32a: 008006b7 lui a3,0x800 + 32e: 8f55 or a4,a4,a3 + +00000330 <.LVL119>: + 330: 869a mv a3,t1 + +00000332 <.L53>: + 332: 45fd li a1,31 + 334: 04d5c763 blt a1,a3,382 <.L54> + 338: 02000313 li t1,32 + 33c: 40d30333 sub t1,t1,a3 + 340: 00d652b3 srl t0,a2,a3 + +00000344 <.LVL121>: + 344: 006715b3 sll a1,a4,t1 + 348: 00661333 sll t1,a2,t1 + 34c: 0055e5b3 or a1,a1,t0 + 350: 00603333 snez t1,t1 + 354: 0065e633 or a2,a1,t1 + 358: 00d756b3 srl a3,a4,a3 + +0000035c <.L52>: + 35c: 40c50633 sub a2,a0,a2 + +00000360 <.LVL124>: + 360: 00c53733 sltu a4,a0,a2 + 364: 40d786b3 sub a3,a5,a3 + +00000368 <.LVL125>: + 368: 8532 mv a0,a2 + +0000036a <.LVL126>: + 36a: 40e687b3 sub a5,a3,a4 + +0000036e <.L50>: + 36e: 008005b7 lui a1,0x800 + 372: 00b7f733 and a4,a5,a1 + 376: d60705e3 beqz a4,e0 <.L11> + +0000037a <.LBB55>: + 37a: 15fd add a1,a1,-1 # 7fffff <.LLST28+0x7fed9c> + 37c: 8dfd and a1,a1,a5 + +0000037e <.LVL128>: + 37e: 832a mv t1,a0 + 380: a2d1 j 544 <.L85> + +00000382 <.L54>: + 382: fe068593 add a1,a3,-32 # 7fffe0 <.LLST28+0x7fed7d> + 386: 02000293 li t0,32 + +0000038a <.LVL130>: + 38a: 00b755b3 srl a1,a4,a1 + 38e: 4301 li t1,0 + 390: 00568863 beq a3,t0,3a0 <.L55> + 394: 04000313 li t1,64 + 398: 40d30333 sub t1,t1,a3 + 39c: 00671333 sll t1,a4,t1 + +000003a0 <.L55>: + 3a0: 00c36333 or t1,t1,a2 + 3a4: 00603333 snez t1,t1 + 3a8: 0065e633 or a2,a1,t1 + +000003ac <.LVL131>: + 3ac: 4681 li a3,0 + 3ae: b77d j 35c <.L52> + +000003b0 <.L174>: + 3b0: 0e030a63 beqz t1,4a4 <.L58> + +000003b4 <.LVL133>: + 3b4: c4b1 beqz s1,400 <.L122> + +000003b6 <.LBE92>: + 3b6: 87ba mv a5,a4 + +000003b8 <.LVL134>: + 3b8: 8532 mv a0,a2 + +000003ba <.LBB94>: + 3ba: 7ff00493 li s1,2047 + +000003be <.LVL136>: + 3be: 8436 mv s0,a3 + +000003c0 <.LVL137>: + 3c0: b305 j e0 <.L11> + +000003c2 <.L175>: + 3c2: 0e030163 beqz t1,4a4 <.L58> + +000003c6 <.LVL139>: + 3c6: c0a9 beqz s1,408 <.L123> + +000003c8 <.LBE94>: + 3c8: 4781 li a5,0 + +000003ca <.LVL140>: + 3ca: 4501 li a0,0 + +000003cc <.LBB96>: + 3cc: 7ff00493 li s1,2047 + +000003d0 <.LVL142>: + 3d0: 8416 mv s0,t0 + +000003d2 <.LVL143>: + 3d2: b945 j 82 <.L95> + +000003d4 <.L45>: + 3d4: 0c030863 beqz t1,4a4 <.L58> + 3d8: 409586b3 sub a3,a1,s1 + +000003dc <.LVL145>: + 3dc: e0b9 bnez s1,422 <.L60> + 3de: 8416 mv s0,t0 + +000003e0 <.LVL146>: + 3e0: 84b6 mv s1,a3 + +000003e2 <.L59>: + 3e2: 00a7e6b3 or a3,a5,a0 + 3e6: e20688e3 beqz a3,216 <.L125> + 3ea: fff48693 add a3,s1,-1 + +000003ee <.LVL148>: + 3ee: ee99 bnez a3,40c <.L61> + +000003f0 <.LBB62>: + 3f0: 40a60533 sub a0,a2,a0 + +000003f4 <.LVL150>: + 3f4: 40f707b3 sub a5,a4,a5 + +000003f8 <.LVL151>: + 3f8: 00a63633 sltu a2,a2,a0 + +000003fc <.LVL152>: + 3fc: 8f91 sub a5,a5,a2 + 3fe: b729 j 308 <.L183> + +00000400 <.L122>: + 400: 8436 mv s0,a3 + +00000402 <.L182>: + 402: 7ff00493 li s1,2047 + +00000406 <.LVL155>: + 406: bff1 j 3e2 <.L59> + +00000408 <.L123>: + 408: 8416 mv s0,t0 + +0000040a <.LVL157>: + 40a: bfe5 j 402 <.L182> + +0000040c <.L61>: + 40c: 7ff00313 li t1,2047 + 410: e06483e3 beq s1,t1,216 <.L125> + +00000414 <.L64>: + 414: 03800313 li t1,56 + 418: 00d35e63 bge t1,a3,434 <.L66> + +0000041c <.L127>: + 41c: 4681 li a3,0 + +0000041e <.LVL160>: + 41e: 4505 li a0,1 + +00000420 <.LVL161>: + 420: a83d j 45e <.L65> + +00000422 <.L60>: + 422: 03800313 li t1,56 + 426: 06d34d63 blt t1,a3,4a0 <.L126> + 42a: 00800337 lui t1,0x800 + 42e: 0067e7b3 or a5,a5,t1 + +00000432 <.LVL163>: + 432: 8416 mv s0,t0 + +00000434 <.L66>: + 434: 437d li t1,31 + 436: 02d34e63 blt t1,a3,472 <.L67> + 43a: 02000293 li t0,32 + +0000043e <.LVL165>: + 43e: 40d282b3 sub t0,t0,a3 + 442: 00d553b3 srl t2,a0,a3 + 446: 00579333 sll t1,a5,t0 + 44a: 005512b3 sll t0,a0,t0 + 44e: 00736333 or t1,t1,t2 + 452: 005032b3 snez t0,t0 + 456: 00536533 or a0,t1,t0 + 45a: 00d7d6b3 srl a3,a5,a3 + +0000045e <.L65>: + 45e: 40a60533 sub a0,a2,a0 + +00000462 <.LVL168>: + 462: 40d706b3 sub a3,a4,a3 + +00000466 <.LVL169>: + 466: 00a637b3 sltu a5,a2,a0 + 46a: 40f687b3 sub a5,a3,a5 + +0000046e <.LBB97>: + 46e: 84ae mv s1,a1 + +00000470 <.LBB98>: + 470: bdfd j 36e <.L50> + +00000472 <.L67>: + 472: fe068313 add t1,a3,-32 + 476: 02000393 li t2,32 + 47a: 0067d333 srl t1,a5,t1 + 47e: 4281 li t0,0 + +00000480 <.LVL172>: + 480: 00768863 beq a3,t2,490 <.L68> + 484: 04000293 li t0,64 + 488: 40d282b3 sub t0,t0,a3 + 48c: 005792b3 sll t0,a5,t0 + +00000490 <.L68>: + 490: 00a2e2b3 or t0,t0,a0 + 494: 005032b3 snez t0,t0 + 498: 00536533 or a0,t1,t0 + +0000049c <.LVL173>: + 49c: 4681 li a3,0 + +0000049e <.LVL174>: + 49e: b7c1 j 45e <.L65> + +000004a0 <.L126>: + 4a0: 8416 mv s0,t0 + +000004a2 <.LVL176>: + 4a2: bfad j 41c <.L127> + +000004a4 <.L58>: + 4a4: 00148693 add a3,s1,1 + 4a8: 7fe6f693 and a3,a3,2046 + 4ac: e2bd bnez a3,512 <.L71> + +000004ae <.LBE98>: + 4ae: 00c766b3 or a3,a4,a2 + +000004b2 <.LBB99>: + 4b2: 00a7e5b3 or a1,a5,a0 + +000004b6 <.LBB100>: + 4b6: e4a1 bnez s1,4fe <.L72> + +000004b8 <.LVL179>: + 4b8: e599 bnez a1,4c6 <.L73> + +000004ba <.LVL180>: + 4ba: 1a068663 beqz a3,666 <.L130> + +000004be <.LBE100>: + 4be: 87ba mv a5,a4 + +000004c0 <.LVL181>: + 4c0: 8532 mv a0,a2 + +000004c2 <.L187>: + 4c2: 8416 mv s0,t0 + +000004c4 <.LVL183>: + 4c4: b931 j e0 <.L11> + +000004c6 <.L73>: + 4c6: c0068de3 beqz a3,e0 <.L11> + +000004ca <.LBB67>: + 4ca: 40c50333 sub t1,a0,a2 + +000004ce <.LVL185>: + 4ce: 006536b3 sltu a3,a0,t1 + 4d2: 40e785b3 sub a1,a5,a4 + 4d6: 8d95 sub a1,a1,a3 + +000004d8 <.LBE67>: + 4d8: 008006b7 lui a3,0x800 + 4dc: 8eed and a3,a3,a1 + 4de: ca89 beqz a3,4f0 <.L76> + +000004e0 <.LBB68>: + 4e0: 40a60533 sub a0,a2,a0 + +000004e4 <.LVL188>: + 4e4: 40f707b3 sub a5,a4,a5 + +000004e8 <.LVL189>: + 4e8: 00a63633 sltu a2,a2,a0 + +000004ec <.LVL190>: + 4ec: 8f91 sub a5,a5,a2 + 4ee: bfd1 j 4c2 <.L187> + +000004f0 <.L76>: + 4f0: 00b366b3 or a3,t1,a1 + 4f4: 16068963 beqz a3,666 <.L130> + 4f8: 87ae mv a5,a1 + +000004fa <.LBB69>: + 4fa: 851a mv a0,t1 + +000004fc <.LVL193>: + 4fc: b6d5 j e0 <.L11> + +000004fe <.L72>: + 4fe: e599 bnez a1,50c <.L79> + 500: 16068563 beqz a3,66a <.L131> + +00000504 <.LBE102>: + 504: 87ba mv a5,a4 + +00000506 <.LVL195>: + 506: 8532 mv a0,a2 + +00000508 <.LBB104>: + 508: 8416 mv s0,t0 + +0000050a <.LVL197>: + 50a: bee5 j 102 <.L132> + +0000050c <.L79>: + 50c: be068be3 beqz a3,102 <.L132> + 510: b371 j 29c <.L189> + +00000512 <.L71>: + 512: 40c506b3 sub a3,a0,a2 + 516: 00d533b3 sltu t2,a0,a3 + 51a: 40e785b3 sub a1,a5,a4 + +0000051e <.LVL200>: + 51e: 407585b3 sub a1,a1,t2 + +00000522 <.LBE70>: + 522: 008003b7 lui t2,0x800 + 526: 0075f3b3 and t2,a1,t2 + +0000052a <.LBB71>: + 52a: 8336 mv t1,a3 + +0000052c <.LBE71>: + 52c: 06038863 beqz t2,59c <.L82> + +00000530 <.LBB72>: + 530: 40a60533 sub a0,a2,a0 + +00000534 <.LVL202>: + 534: 40f707b3 sub a5,a4,a5 + +00000538 <.LVL203>: + 538: 00a63633 sltu a2,a2,a0 + +0000053c <.LVL204>: + 53c: 832a mv t1,a0 + +0000053e <.LVL205>: + 53e: 40c785b3 sub a1,a5,a2 + +00000542 <.LBE72>: + 542: 8416 mv s0,t0 + +00000544 <.L85>: + 544: c1ad beqz a1,5a6 <.L86> + 546: 852e mv a0,a1 + 548: c21a sw t1,4(sp) + 54a: c02e sw a1,0(sp) + 54c: 00000097 auipc ra,0x0 + 550: 000080e7 jalr ra # 54c <.L85+0x8> + +00000554 <.LVL208>: + 554: 4582 lw a1,0(sp) + 556: 4312 lw t1,4(sp) + 558: ff850793 add a5,a0,-8 + +0000055c <.L87>: + 55c: 02000713 li a4,32 + 560: 8f1d sub a4,a4,a5 + 562: 00f595b3 sll a1,a1,a5 + +00000566 <.LVL210>: + 566: 00e35733 srl a4,t1,a4 + 56a: 8f4d or a4,a4,a1 + +0000056c <.LVL211>: + 56c: 00f315b3 sll a1,t1,a5 + +00000570 <.LVL212>: + 570: 0a97cf63 blt a5,s1,62e <.L89> + 574: 8f85 sub a5,a5,s1 + +00000576 <.LVL213>: + 576: 00178613 add a2,a5,1 # 80001 <.LLST28+0x7ed9e> + +0000057a <.L90>: + 57a: 02000693 li a3,32 + 57e: 8e91 sub a3,a3,a2 + 580: 00d71533 sll a0,a4,a3 + 584: 00c5d7b3 srl a5,a1,a2 + 588: 00d596b3 sll a3,a1,a3 + 58c: 8d5d or a0,a0,a5 + 58e: 00d036b3 snez a3,a3 + 592: 8d55 or a0,a0,a3 + +00000594 <.LVL215>: + 594: 00c757b3 srl a5,a4,a2 + +00000598 <.L186>: + 598: 4481 li s1,0 + +0000059a <.LVL217>: + 59a: b699 j e0 <.L11> + +0000059c <.L82>: + 59c: 8ecd or a3,a3,a1 + 59e: f2dd bnez a3,544 <.L85> + +000005a0 <.LBB105>: + 5a0: 4781 li a5,0 + +000005a2 <.LBB106>: + 5a2: 4481 li s1,0 + +000005a4 <.LVL220>: + 5a4: a87d j 662 <.L188> + +000005a6 <.L86>: + 5a6: 851a mv a0,t1 + 5a8: c22e sw a1,4(sp) + 5aa: c01a sw t1,0(sp) + 5ac: 00000097 auipc ra,0x0 + 5b0: 000080e7 jalr ra # 5ac <.L86+0x6> + +000005b4 <.LVL222>: + 5b4: 01850793 add a5,a0,24 + +000005b8 <.LVL223>: + 5b8: 46fd li a3,31 + 5ba: 4302 lw t1,0(sp) + 5bc: 4592 lw a1,4(sp) + 5be: f8f6dfe3 bge a3,a5,55c <.L87> + +000005c2 <.LVL224>: + 5c2: 1561 add a0,a0,-8 + 5c4: 00a31733 sll a4,t1,a0 + +000005c8 <.LVL225>: + 5c8: 0297c963 blt a5,s1,5fa <.L91> + 5cc: 8f85 sub a5,a5,s1 + +000005ce <.LVL226>: + 5ce: 00178613 add a2,a5,1 + +000005d2 <.LVL227>: + 5d2: fac6d4e3 bge a3,a2,57a <.L90> + 5d6: 1785 add a5,a5,-31 + 5d8: 02000693 li a3,32 + 5dc: 00f757b3 srl a5,a4,a5 + 5e0: 4501 li a0,0 + 5e2: 00d60763 beq a2,a3,5f0 <.L93> + 5e6: 04000513 li a0,64 + 5ea: 8d11 sub a0,a0,a2 + 5ec: 00a71533 sll a0,a4,a0 + +000005f0 <.L93>: + 5f0: 00a03533 snez a0,a0 + 5f4: 8d5d or a0,a0,a5 + +000005f6 <.LVL228>: + 5f6: 4781 li a5,0 + 5f8: b745 j 598 <.L186> + +000005fa <.L91>: + 5fa: 8c9d sub s1,s1,a5 + 5fc: ff8007b7 lui a5,0xff800 + +00000600 <.LVL231>: + 600: 17fd add a5,a5,-1 # ff7fffff <.LLST28+0xff7fed9c> + 602: 8ff9 and a5,a5,a4 + +00000604 <.LBB107>: + 604: 01d79693 sll a3,a5,0x1d + +00000608 <.L190>: + 608: 838d srl a5,a5,0x3 + +0000060a <.L41>: + 60a: 01449713 sll a4,s1,0x14 + 60e: 7ff00637 lui a2,0x7ff00 + 612: 07b2 sll a5,a5,0xc + +00000614 <.LVL235>: + 614: 8f71 and a4,a4,a2 + 616: 83b1 srl a5,a5,0xc + 618: 047e sll s0,s0,0x1f + +0000061a <.LVL236>: + 61a: 8fd9 or a5,a5,a4 + +0000061c <.LBE108>: + 61c: 40c2 lw ra,16(sp) + +0000061e <.LBB109>: + 61e: 0087e733 or a4,a5,s0 + +00000622 <.LBE109>: + 622: 4432 lw s0,12(sp) + 624: 44a2 lw s1,8(sp) + 626: 8536 mv a0,a3 + 628: 85ba mv a1,a4 + 62a: 0151 add sp,sp,20 + 62c: 8082 ret + +0000062e <.L89>: + 62e: 8c9d sub s1,s1,a5 + 630: ff8007b7 lui a5,0xff800 + +00000634 <.LVL240>: + 634: 17fd add a5,a5,-1 # ff7fffff <.LLST28+0xff7fed9c> + 636: 8ff9 and a5,a5,a4 + +00000638 <.LVL241>: + 638: 852e mv a0,a1 + 63a: b45d j e0 <.L11> + +0000063c <.L115>: + 63c: 87ba mv a5,a4 + +0000063e <.LVL243>: + 63e: 8532 mv a0,a2 + +00000640 <.LVL244>: + 640: b4c9 j 102 <.L132> + +00000642 <.L117>: + 642: 849a mv s1,t1 + +00000644 <.LVL246>: + 644: bc71 j e0 <.L11> + +00000646 <.L98>: + 646: 01d79713 sll a4,a5,0x1d + 64a: 810d srl a0,a0,0x3 + +0000064c <.LVL248>: + 64c: 7ff00613 li a2,2047 + 650: 8f49 or a4,a4,a0 + +00000652 <.LVL249>: + 652: 838d srl a5,a5,0x3 + 654: 02c49163 bne s1,a2,676 <.L136> + +00000658 <.LVL251>: + 658: 8f5d or a4,a4,a5 + 65a: 000807b7 lui a5,0x80 + 65e: b00703e3 beqz a4,164 <.L42> + +00000662 <.L188>: + 662: 4401 li s0,0 + 664: b75d j 60a <.L41> + +00000666 <.L130>: + 666: 4781 li a5,0 + +00000668 <.LVL253>: + 668: bfed j 662 <.L188> + +0000066a <.L131>: + 66a: 4401 li s0,0 + +0000066c <.LBB114>: + 66c: 7ff00493 li s1,2047 + +00000670 <.LBB115>: + 670: 000807b7 lui a5,0x80 + +00000674 <.LVL257>: + 674: bf59 j 60a <.L41> + +00000676 <.L136>: + 676: 86ba mv a3,a4 + 678: bf49 j 60a <.L41> + +unorddf2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__unorddf2>: + 0: 001007b7 lui a5,0x100 + 4: 17fd add a5,a5,-1 # fffff <.LASF16+0xffe47> + 6: 00b7f733 and a4,a5,a1 + +0000000a <.LVL1>: + a: 81d1 srl a1,a1,0x14 + +0000000c <.LBB3>: + c: 8ff5 and a5,a5,a3 + +0000000e <.LBB4>: + e: 7ff5f593 and a1,a1,2047 + +00000012 <.LBB5>: + 12: 82d1 srl a3,a3,0x14 + +00000014 <.LBE5>: + 14: 7ff00313 li t1,2047 + +00000018 <.LBB6>: + 18: 7ff6f693 and a3,a3,2047 + +0000001c <.LBE6>: + 1c: 00659563 bne a1,t1,26 <.L2> + 20: 8f49 or a4,a4,a0 + +00000022 <.LVL6>: + 22: 4505 li a0,1 + +00000024 <.LVL7>: + 24: eb09 bnez a4,36 <.L1> + +00000026 <.L2>: + 26: 7ff00713 li a4,2047 + 2a: 4501 li a0,0 + 2c: 00e69563 bne a3,a4,36 <.L1> + 30: 8fd1 or a5,a5,a2 + +00000032 <.LVL8>: + 32: 00f03533 snez a0,a5 + +00000036 <.L1>: + 36: 8082 ret + +fixdfsi.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__fixdfsi>: + 0: 0145d713 srl a4,a1,0x14 + 4: 00100637 lui a2,0x100 + +00000008 <.LBE2>: + 8: 86aa mv a3,a0 + +0000000a <.LBB3>: + a: fff60793 add a5,a2,-1 # fffff <.LASF13+0xffe50> + e: 7ff77713 and a4,a4,2047 + +00000012 <.LBE3>: + 12: 3fe00513 li a0,1022 + +00000016 <.LBB4>: + 16: 8fed and a5,a5,a1 + +00000018 <.LVL3>: + 18: 81fd srl a1,a1,0x1f + +0000001a <.LBE4>: + 1a: 04e55563 bge a0,a4,64 <.L6> + 1e: 41d00513 li a0,1053 + 22: 00e55863 bge a0,a4,32 <.L3> + +00000026 <.LVL5>: + 26: 80000537 lui a0,0x80000 + 2a: fff54513 not a0,a0 + 2e: 952e add a0,a0,a1 + +00000030 <.LVL6>: + 30: 8082 ret + +00000032 <.L3>: + 32: 8fd1 or a5,a5,a2 + 34: 43300613 li a2,1075 + 38: 8e19 sub a2,a2,a4 + 3a: 457d li a0,31 + 3c: 00c54d63 blt a0,a2,56 <.L4> + +00000040 <.LVL9>: + 40: bed70713 add a4,a4,-1043 + +00000044 <.LVL10>: + 44: 00e79533 sll a0,a5,a4 + 48: 00c6d6b3 srl a3,a3,a2 + 4c: 8d55 or a0,a0,a3 + +0000004e <.L5>: + 4e: cd81 beqz a1,66 <.L2> + 50: 40a00533 neg a0,a0 + +00000054 <.LVL12>: + 54: 8082 ret + +00000056 <.L4>: + 56: 41300693 li a3,1043 + 5a: 40e68733 sub a4,a3,a4 + +0000005e <.LVL14>: + 5e: 00e7d533 srl a0,a5,a4 + +00000062 <.LVL15>: + 62: b7f5 j 4e <.L5> + +00000064 <.L6>: + 64: 4501 li a0,0 + +00000066 <.L2>: + 66: 8082 ret + +fixunsdfsi.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__fixunsdfsi>: + 0: 0145d713 srl a4,a1,0x14 + 4: 00100637 lui a2,0x100 + +00000008 <.LBE2>: + 8: 86aa mv a3,a0 + +0000000a <.LBB3>: + a: fff60793 add a5,a2,-1 # fffff <.LASF25+0xffe5b> + e: 7ff77713 and a4,a4,2047 + +00000012 <.LBE3>: + 12: 3fe00513 li a0,1022 + +00000016 <.LBB4>: + 16: 8fed and a5,a5,a1 + +00000018 <.LVL3>: + 18: 81fd srl a1,a1,0x1f + +0000001a <.LBE4>: + 1a: 02e55f63 bge a0,a4,58 <.L4> + 1e: 4501 li a0,0 + 20: ed8d bnez a1,5a <.L1> + 22: 41e00593 li a1,1054 + +00000026 <.LVL5>: + 26: 557d li a0,-1 + 28: 02e5c963 blt a1,a4,5a <.L1> + +0000002c <.LBB5>: + 2c: 8fd1 or a5,a5,a2 + 2e: 43300613 li a2,1075 + 32: 8e19 sub a2,a2,a4 + 34: 45fd li a1,31 + 36: 00c5ca63 blt a1,a2,4a <.L3> + +0000003a <.LVL8>: + 3a: bed70713 add a4,a4,-1043 + +0000003e <.LVL9>: + 3e: 00e79533 sll a0,a5,a4 + 42: 00c6d6b3 srl a3,a3,a2 + 46: 8d55 or a0,a0,a3 + +00000048 <.LVL10>: + 48: 8082 ret + +0000004a <.L3>: + 4a: 41300693 li a3,1043 + 4e: 40e68733 sub a4,a3,a4 + +00000052 <.LVL12>: + 52: 00e7d533 srl a0,a5,a4 + +00000056 <.LVL13>: + 56: 8082 ret + +00000058 <.L4>: + 58: 4501 li a0,0 + +0000005a <.L1>: + 5a: 8082 ret + +floatsidf.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__floatsidf>: + 0: 1151 add sp,sp,-12 + 2: c406 sw ra,8(sp) + 4: c222 sw s0,4(sp) + 6: c026 sw s1,0(sp) + +00000008 <.LBB10>: + 8: cd39 beqz a0,66 <.L5> + +0000000a <.LBB3>: + a: 41f55793 sra a5,a0,0x1f + e: 00a7c433 xor s0,a5,a0 + 12: 8c1d sub s0,s0,a5 + 14: 01f55493 srl s1,a0,0x1f + +00000018 <.LBB4>: + 18: 8522 mv a0,s0 + +0000001a <.LVL3>: + 1a: 00000097 auipc ra,0x0 + 1e: 000080e7 jalr ra # 1a <.LVL3> + +00000022 <.LVL4>: + 22: 41e00693 li a3,1054 + +00000026 <.LBE4>: + 26: 47a9 li a5,10 + +00000028 <.LBB5>: + 28: 8e89 sub a3,a3,a0 + +0000002a <.LBE5>: + 2a: 02a7c863 blt a5,a0,5a <.L4> + 2e: 47ad li a5,11 + 30: 8f89 sub a5,a5,a0 + 32: 0555 add a0,a0,21 + +00000034 <.LVL6>: + 34: 00a41733 sll a4,s0,a0 + 38: 00f457b3 srl a5,s0,a5 + +0000003c <.LVL7>: + 3c: 8526 mv a0,s1 + +0000003e <.L2>: + 3e: 07b2 sll a5,a5,0xc + +00000040 <.LBE11>: + 40: 40a2 lw ra,8(sp) + 42: 4412 lw s0,4(sp) + +00000044 <.LBB12>: + 44: 83b1 srl a5,a5,0xc + 46: 06d2 sll a3,a3,0x14 + +00000048 <.LVL10>: + 48: 057e sll a0,a0,0x1f + +0000004a <.LVL11>: + 4a: 8edd or a3,a3,a5 + 4c: 00a6e7b3 or a5,a3,a0 + +00000050 <.LBE12>: + 50: 4482 lw s1,0(sp) + 52: 853a mv a0,a4 + 54: 85be mv a1,a5 + 56: 0131 add sp,sp,12 + 58: 8082 ret + +0000005a <.L4>: + 5a: 1555 add a0,a0,-11 + +0000005c <.LVL14>: + 5c: 00a417b3 sll a5,s0,a0 + +00000060 <.LVL15>: + 60: 8526 mv a0,s1 + +00000062 <.L7>: + 62: 4701 li a4,0 + 64: bfe9 j 3e <.L2> + +00000066 <.L5>: + 66: 4681 li a3,0 + 68: 4781 li a5,0 + 6a: bfe5 j 62 <.L7> + +floatunsidf.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__floatunsidf>: + 0: 1151 add sp,sp,-12 + 2: c222 sw s0,4(sp) + 4: c406 sw ra,8(sp) + 6: 842a mv s0,a0 + +00000008 <.LBB10>: + 8: c131 beqz a0,4c <.L4> + +0000000a <.LBB3>: + a: 00000097 auipc ra,0x0 + e: 000080e7 jalr ra # a <.LBB3> + +00000012 <.LVL2>: + 12: 41e00713 li a4,1054 + +00000016 <.LBE4>: + 16: 47a9 li a5,10 + +00000018 <.LBB5>: + 18: 8f09 sub a4,a4,a0 + +0000001a <.LBE5>: + 1a: 02a7c463 blt a5,a0,42 <.L3> + 1e: 47ad li a5,11 + 20: 8f89 sub a5,a5,a0 + 22: 0555 add a0,a0,21 + +00000024 <.LVL4>: + 24: 00f457b3 srl a5,s0,a5 + +00000028 <.LVL5>: + 28: 00a41433 sll s0,s0,a0 + +0000002c <.L2>: + 2c: 40a2 lw ra,8(sp) + 2e: 8522 mv a0,s0 + +00000030 <.LBB12>: + 30: 07b2 sll a5,a5,0xc + +00000032 <.LBE12>: + 32: 4412 lw s0,4(sp) + +00000034 <.LBB13>: + 34: 0752 sll a4,a4,0x14 + +00000036 <.LVL9>: + 36: 83b1 srl a5,a5,0xc + 38: 00f766b3 or a3,a4,a5 + +0000003c <.LBE13>: + 3c: 85b6 mv a1,a3 + 3e: 0131 add sp,sp,12 + 40: 8082 ret + +00000042 <.L3>: + 42: 1555 add a0,a0,-11 + +00000044 <.LVL11>: + 44: 00a417b3 sll a5,s0,a0 + +00000048 <.LVL12>: + 48: 4401 li s0,0 + +0000004a <.LVL13>: + 4a: b7cd j 2c <.L2> + +0000004c <.L4>: + 4c: 4781 li a5,0 + 4e: 4701 li a4,0 + 50: bff1 j 2c <.L2> + +fixdfdi.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__fixdfdi>: + 0: 00100737 lui a4,0x100 + 4: 0145d613 srl a2,a1,0x14 + 8: fff70793 add a5,a4,-1 # fffff <.LLST8+0xffe2b> + c: 7ff67613 and a2,a2,2047 + +00000010 <.LBE2>: + 10: 3fe00693 li a3,1022 + +00000014 <.LBB3>: + 14: 8fed and a5,a5,a1 + +00000016 <.LBE3>: + 16: 08c6d763 bge a3,a2,a4 <.L8> + 1a: 1151 add sp,sp,-12 + 1c: c222 sw s0,4(sp) + 1e: c406 sw ra,8(sp) + 20: 43d00693 li a3,1085 + 24: 01f5d413 srl s0,a1,0x1f + 28: 02c6d263 bge a3,a2,4c <.L3> + +0000002c <.LVL2>: + 2c: 4505 li a0,1 + +0000002e <.LVL3>: + 2e: 8d01 sub a0,a0,s0 + 30: 41f55713 sra a4,a0,0x1f + 34: 800005b7 lui a1,0x80000 + +00000038 <.LVL4>: + 38: 00a037b3 snez a5,a0 + +0000003c <.LVL5>: + 3c: 8d99 sub a1,a1,a4 + 3e: 40a00533 neg a0,a0 + 42: 8d9d sub a1,a1,a5 + +00000044 <.L2>: + 44: 40a2 lw ra,8(sp) + 46: 4412 lw s0,4(sp) + 48: 0131 add sp,sp,12 + 4a: 8082 ret + +0000004c <.L3>: + 4c: 00e7e5b3 or a1,a5,a4 + +00000050 <.LVL8>: + 50: 43200793 li a5,1074 + 54: 02c7d163 bge a5,a2,76 <.L4> + +00000058 <.LVL9>: + 58: bcd60613 add a2,a2,-1075 + +0000005c <.LVL10>: + 5c: 00000097 auipc ra,0x0 + 60: 000080e7 jalr ra # 5c <.LVL10> + +00000064 <.L5>: + 64: d065 beqz s0,44 <.L2> + 66: 00a037b3 snez a5,a0 + 6a: 40b005b3 neg a1,a1 + +0000006e <.LVL12>: + 6e: 8d9d sub a1,a1,a5 + 70: 40a00533 neg a0,a0 + 74: bfc1 j 44 <.L2> + +00000076 <.L4>: + 76: 43300713 li a4,1075 + 7a: 8f11 sub a4,a4,a2 + 7c: 47fd li a5,31 + 7e: 00e7cc63 blt a5,a4,96 <.L6> + +00000082 <.LVL15>: + 82: bed60793 add a5,a2,-1043 + 86: 00f597b3 sll a5,a1,a5 + 8a: 00e55533 srl a0,a0,a4 + +0000008e <.LVL16>: + 8e: 8d5d or a0,a0,a5 + +00000090 <.LVL17>: + 90: 00e5d5b3 srl a1,a1,a4 + 94: bfc1 j 64 <.L5> + +00000096 <.L6>: + 96: 41300513 li a0,1043 + +0000009a <.LVL20>: + 9a: 8d11 sub a0,a0,a2 + 9c: 00a5d533 srl a0,a1,a0 + +000000a0 <.LVL21>: + a0: 4581 li a1,0 + a2: b7c9 j 64 <.L5> + +000000a4 <.L8>: + a4: 4501 li a0,0 + +000000a6 <.LVL24>: + a6: 4581 li a1,0 + +000000a8 <.LVL25>: + a8: 8082 ret + +fixunsdfdi.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__fixunsdfdi>: + 0: 001006b7 lui a3,0x100 + 4: 0145d613 srl a2,a1,0x14 + 8: fff68713 add a4,a3,-1 # fffff <.LASF12+0xffe4a> + c: 8f6d and a4,a4,a1 + +0000000e <.LVL1>: + e: 01f5d793 srl a5,a1,0x1f + 12: 7ff67613 and a2,a2,2047 + +00000016 <.LBE2>: + 16: 3fe00593 li a1,1022 + 1a: 04c5df63 bge a1,a2,78 <.L6> + 1e: efa9 bnez a5,78 <.L6> + 20: 43e00793 li a5,1086 + +00000024 <.LVL4>: + 24: 04c7cc63 blt a5,a2,7c <.L8> + +00000028 <.LBB3>: + 28: 43200793 li a5,1074 + 2c: 00d765b3 or a1,a4,a3 + +00000030 <.LVL6>: + 30: 00c7dd63 bge a5,a2,4a <.L3> + +00000034 <.LBE3>: + 34: 1151 add sp,sp,-12 + +00000036 <.LBB7>: + 36: bcd60613 add a2,a2,-1075 + +0000003a <.LBE7>: + 3a: c406 sw ra,8(sp) + +0000003c <.LBB8>: + 3c: 00000097 auipc ra,0x0 + 40: 000080e7 jalr ra # 3c <.LBB8> + +00000044 <.LBE8>: + 44: 40a2 lw ra,8(sp) + 46: 0131 add sp,sp,12 + 48: 8082 ret + +0000004a <.L3>: + 4a: 43300713 li a4,1075 + 4e: 8f11 sub a4,a4,a2 + 50: 47fd li a5,31 + 52: 00e7cc63 blt a5,a4,6a <.L4> + +00000056 <.LVL11>: + 56: bed60793 add a5,a2,-1043 + 5a: 00f597b3 sll a5,a1,a5 + 5e: 00e55533 srl a0,a0,a4 + +00000062 <.LVL12>: + 62: 8d5d or a0,a0,a5 + +00000064 <.LVL13>: + 64: 00e5d5b3 srl a1,a1,a4 + 68: 8082 ret + +0000006a <.L4>: + 6a: 41300513 li a0,1043 + +0000006e <.LVL16>: + 6e: 8d11 sub a0,a0,a2 + 70: 00a5d533 srl a0,a1,a0 + +00000074 <.L13>: + 74: 4581 li a1,0 + 76: 8082 ret + +00000078 <.L6>: + 78: 4501 li a0,0 + +0000007a <.LVL19>: + 7a: bfed j 74 <.L13> + +0000007c <.L8>: + 7c: 557d li a0,-1 + +0000007e <.LVL21>: + 7e: 55fd li a1,-1 + +00000080 <.LVL22>: + 80: 8082 ret + +floatdidf.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__floatdidf>: + 0: 1101 add sp,sp,-32 + 2: ce06 sw ra,28(sp) + 4: cc22 sw s0,24(sp) + 6: ca26 sw s1,20(sp) + +00000008 <.LBB17>: + 8: 00b567b3 or a5,a0,a1 + c: 16078363 beqz a5,172 <.L17> + +00000010 <.LBB3>: + 10: 01f5d793 srl a5,a1,0x1f + 14: c03e sw a5,0(sp) + 16: 842a mv s0,a0 + 18: 832e mv t1,a1 + +0000001a <.LVL1>: + 1a: 0005da63 bgez a1,2e <.L4> + +0000001e <.LVL2>: + 1e: 00a037b3 snez a5,a0 + +00000022 <.LVL3>: + 22: 40b006b3 neg a3,a1 + 26: 40f68333 sub t1,a3,a5 + 2a: 40a00433 neg s0,a0 + +0000002e <.L4>: + 2e: c21a sw t1,4(sp) + 30: 849a mv s1,t1 + 32: 02030663 beqz t1,5e <.L6> + 36: 851a mv a0,t1 + +00000038 <.LVL5>: + 38: 00000097 auipc ra,0x0 + 3c: 000080e7 jalr ra # 38 <.LVL5> + +00000040 <.LVL6>: + 40: 43e00713 li a4,1086 + 44: 8f09 sub a4,a4,a0 + +00000046 <.LBE4>: + 46: 43300613 li a2,1075 + +0000004a <.LBB5>: + 4a: 86aa mv a3,a0 + +0000004c <.LBE5>: + 4c: 8326 mv t1,s1 + 4e: 06e64963 blt a2,a4,c0 <.L25> + 52: 45ad li a1,11 + 54: 8622 mv a2,s0 + +00000056 <.LVL8>: + 56: 12b50363 beq a0,a1,17c <.L18> + 5a: 1555 add a0,a0,-11 + +0000005c <.LVL9>: + 5c: a00d j 7e <.L10> + +0000005e <.L6>: + 5e: 8522 mv a0,s0 + +00000060 <.LVL11>: + 60: 00000097 auipc ra,0x0 + 64: 000080e7 jalr ra # 60 <.LVL11> + +00000068 <.LVL12>: + 68: 02050693 add a3,a0,32 + +0000006c <.LVL13>: + 6c: 43e00713 li a4,1086 + +00000070 <.LBE6>: + 70: 02a00793 li a5,42 + 74: 4312 lw t1,4(sp) + +00000076 <.LBB7>: + 76: 8f15 sub a4,a4,a3 + +00000078 <.LBE7>: + 78: 02d7cf63 blt a5,a3,b6 <.L9> + 7c: 0555 add a0,a0,21 + +0000007e <.L10>: + 7e: 02b00593 li a1,43 + 82: 8d95 sub a1,a1,a3 + 84: 00b455b3 srl a1,s0,a1 + 88: 00a316b3 sll a3,t1,a0 + +0000008c <.LVL16>: + 8c: 00d5e4b3 or s1,a1,a3 + +00000090 <.LVL17>: + 90: 00a41633 sll a2,s0,a0 + +00000094 <.L2>: + 94: 4782 lw a5,0(sp) + 96: 00c49593 sll a1,s1,0xc + +0000009a <.LBE18>: + 9a: 40f2 lw ra,28(sp) + 9c: 4462 lw s0,24(sp) + +0000009e <.LBB19>: + 9e: 81b1 srl a1,a1,0xc + a0: 0752 sll a4,a4,0x14 + +000000a2 <.LVL19>: + a2: 8f4d or a4,a4,a1 + a4: 01f79493 sll s1,a5,0x1f + +000000a8 <.LVL20>: + a8: 009767b3 or a5,a4,s1 + +000000ac <.LBE19>: + ac: 8532 mv a0,a2 + ae: 44d2 lw s1,20(sp) + b0: 85be mv a1,a5 + b2: 6105 add sp,sp,32 + +000000b4 <.LVL22>: + b4: 8082 ret + +000000b6 <.L9>: + b6: 1555 add a0,a0,-11 + +000000b8 <.LVL24>: + b8: 4601 li a2,0 + ba: 00a414b3 sll s1,s0,a0 + +000000be <.LVL25>: + be: bfd9 j 94 <.L2> + +000000c0 <.L25>: + c0: 43600613 li a2,1078 + c4: 08e65763 bge a2,a4,152 <.L11> + c8: 4621 li a2,8 + ca: 8e09 sub a2,a2,a0 + cc: c22a sw a0,4(sp) + ce: 85a6 mv a1,s1 + d0: 8522 mv a0,s0 + +000000d2 <.LVL27>: + d2: c83a sw a4,16(sp) + d4: 00000097 auipc ra,0x0 + d8: 000080e7 jalr ra # d4 <.LVL27+0x2> + +000000dc <.LVL28>: + dc: 4692 lw a3,4(sp) + de: c62a sw a0,12(sp) + e0: c42e sw a1,8(sp) + e2: 03868613 add a2,a3,56 + e6: 8522 mv a0,s0 + e8: 85a6 mv a1,s1 + ea: 00000097 auipc ra,0x0 + ee: 000080e7 jalr ra # ea <.LVL28+0xe> + +000000f2 <.LVL29>: + f2: 42b2 lw t0,12(sp) + f4: 4322 lw t1,8(sp) + f6: 00b56433 or s0,a0,a1 + fa: 4692 lw a3,4(sp) + fc: 4742 lw a4,16(sp) + fe: 00803433 snez s0,s0 + 102: 00546433 or s0,s0,t0 + +00000106 <.LVL30>: + 106: 849a mv s1,t1 + +00000108 <.L12>: + 108: ff800637 lui a2,0xff800 + 10c: 167d add a2,a2,-1 # ff7fffff <.LLST11+0xff7ffcfb> + 10e: 00c4f7b3 and a5,s1,a2 + +00000112 <.LBB10>: + 112: 00747613 and a2,s0,7 + 116: ce01 beqz a2,12e <.L13> + +00000118 <.LVL33>: + 118: 00f47613 and a2,s0,15 + 11c: 4591 li a1,4 + 11e: 00b60863 beq a2,a1,12e <.L13> + +00000122 <.LBB11>: + 122: 00440613 add a2,s0,4 + 126: 008635b3 sltu a1,a2,s0 + 12a: 97ae add a5,a5,a1 + +0000012c <.LVL34>: + 12c: 8432 mv s0,a2 + +0000012e <.L13>: + 12e: 00800637 lui a2,0x800 + 132: 8e7d and a2,a2,a5 + 134: ca01 beqz a2,144 <.L16> + 136: ff800737 lui a4,0xff800 + +0000013a <.LVL36>: + 13a: 177d add a4,a4,-1 # ff7fffff <.LLST11+0xff7ffcfb> + 13c: 8ff9 and a5,a5,a4 + 13e: 43f00713 li a4,1087 + 142: 8f15 sub a4,a4,a3 + +00000144 <.L16>: + 144: 800d srl s0,s0,0x3 + +00000146 <.LVL39>: + 146: 01d79613 sll a2,a5,0x1d + 14a: 8e41 or a2,a2,s0 + +0000014c <.LVL40>: + 14c: 0037d493 srl s1,a5,0x3 + +00000150 <.LVL41>: + 150: b791 j 94 <.L2> + +00000152 <.L11>: + 152: 4621 li a2,8 + 154: 1561 add a0,a0,-8 + +00000156 <.LVL43>: + 156: fac689e3 beq a3,a2,108 <.L12> + 15a: 02800613 li a2,40 + 15e: 8e15 sub a2,a2,a3 + 160: 00c45633 srl a2,s0,a2 + 164: 00a495b3 sll a1,s1,a0 + 168: 00b664b3 or s1,a2,a1 + +0000016c <.LVL44>: + 16c: 00a41433 sll s0,s0,a0 + 170: bf61 j 108 <.L12> + +00000172 <.L17>: + 172: 4481 li s1,0 + 174: 4601 li a2,0 + 176: 4701 li a4,0 + 178: c002 sw zero,0(sp) + 17a: bf29 j 94 <.L2> + +0000017c <.L18>: + 17c: 43300713 li a4,1075 + +00000180 <.LVL48>: + 180: bf11 j 94 <.L2> + +floatundidf.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__floatundidf>: + 0: 1121 add sp,sp,-24 + 2: ca06 sw ra,20(sp) + 4: c822 sw s0,16(sp) + 6: c626 sw s1,12(sp) + +00000008 <.LBB18>: + 8: 00b567b3 or a5,a0,a1 + c: 12078b63 beqz a5,142 <.L15> + +00000010 <.LBB3>: + 10: c22e sw a1,4(sp) + 12: c02a sw a0,0(sp) + 14: 842e mv s0,a1 + 16: c595 beqz a1,42 <.L4> + 18: 852e mv a0,a1 + +0000001a <.LVL2>: + 1a: 00000097 auipc ra,0x0 + 1e: 000080e7 jalr ra # 1a <.LVL2> + +00000022 <.LVL3>: + 22: 43e00493 li s1,1086 + 26: 8c89 sub s1,s1,a0 + +00000028 <.LBE4>: + 28: 43300793 li a5,1075 + 2c: 4682 lw a3,0(sp) + +0000002e <.LBB5>: + 2e: 872a mv a4,a0 + +00000030 <.LBE5>: + 30: 85a2 mv a1,s0 + 32: 0697c363 blt a5,s1,98 <.L23> + 36: 462d li a2,11 + 38: 87b6 mv a5,a3 + +0000003a <.LVL5>: + 3a: 10c50863 beq a0,a2,14a <.L16> + 3e: 1555 add a0,a0,-11 + +00000040 <.LVL6>: + 40: a00d j 62 <.L8> + +00000042 <.L4>: + 42: 00000097 auipc ra,0x0 + 46: 000080e7 jalr ra # 42 <.L4> + +0000004a <.LVL8>: + 4a: 02050713 add a4,a0,32 + +0000004e <.LVL9>: + 4e: 43e00493 li s1,1086 + +00000052 <.LBE6>: + 52: 02a00793 li a5,42 + 56: 4682 lw a3,0(sp) + 58: 4592 lw a1,4(sp) + +0000005a <.LBB7>: + 5a: 8c99 sub s1,s1,a4 + +0000005c <.LBE7>: + 5c: 02e7c963 blt a5,a4,8e <.L7> + 60: 0555 add a0,a0,21 + +00000062 <.L8>: + 62: 02b00413 li s0,43 + +00000066 <.LVL12>: + 66: 8c19 sub s0,s0,a4 + 68: 0086d433 srl s0,a3,s0 + 6c: 00a595b3 sll a1,a1,a0 + 70: 8c4d or s0,s0,a1 + +00000072 <.LVL13>: + 72: 00a697b3 sll a5,a3,a0 + +00000076 <.L2>: + 76: 0432 sll s0,s0,0xc + +00000078 <.LVL15>: + 78: 04d2 sll s1,s1,0x14 + +0000007a <.LVL16>: + 7a: 8031 srl s0,s0,0xc + 7c: 0084e733 or a4,s1,s0 + +00000080 <.LBE19>: + 80: 40d2 lw ra,20(sp) + 82: 4442 lw s0,16(sp) + 84: 44b2 lw s1,12(sp) + 86: 853e mv a0,a5 + 88: 85ba mv a1,a4 + 8a: 0161 add sp,sp,24 + 8c: 8082 ret + +0000008e <.L7>: + 8e: 1555 add a0,a0,-11 + +00000090 <.LVL19>: + 90: 4781 li a5,0 + 92: 00a69433 sll s0,a3,a0 + +00000096 <.LVL20>: + 96: b7c5 j 76 <.L2> + +00000098 <.L23>: + 98: 43600793 li a5,1078 + 9c: 0897d263 bge a5,s1,120 <.L9> + a0: 03850613 add a2,a0,56 + a4: c02a sw a0,0(sp) + a6: 8536 mv a0,a3 + +000000a8 <.LVL22>: + a8: c436 sw a3,8(sp) + aa: 00000097 auipc ra,0x0 + ae: 000080e7 jalr ra # aa <.LVL22+0x2> + +000000b2 <.LVL23>: + b2: 4702 lw a4,0(sp) + b4: 46a2 lw a3,8(sp) + b6: 00b567b3 or a5,a0,a1 + ba: 4621 li a2,8 + bc: 00f037b3 snez a5,a5 + c0: 8e19 sub a2,a2,a4 + c2: 85a2 mv a1,s0 + c4: 8536 mv a0,a3 + c6: c23e sw a5,4(sp) + c8: 00000097 auipc ra,0x0 + cc: 000080e7 jalr ra # c8 <.LVL23+0x16> + +000000d0 <.LVL24>: + d0: 4792 lw a5,4(sp) + d2: 4702 lw a4,0(sp) + d4: 842e mv s0,a1 + +000000d6 <.LVL25>: + d6: 8fc9 or a5,a5,a0 + +000000d8 <.L10>: + d8: ff8006b7 lui a3,0xff800 + dc: 16fd add a3,a3,-1 # ff7fffff <.LLST12+0xff7ffc30> + +000000de <.LBB10>: + de: 0077f613 and a2,a5,7 + +000000e2 <.LBE10>: + e2: 8ee1 and a3,a3,s0 + +000000e4 <.LBB13>: + e4: ce01 beqz a2,fc <.L11> + +000000e6 <.LVL28>: + e6: 00f7f613 and a2,a5,15 + ea: 4591 li a1,4 + ec: 00b60863 beq a2,a1,fc <.L11> + +000000f0 <.LBB11>: + f0: 00478613 add a2,a5,4 + f4: 00f635b3 sltu a1,a2,a5 + f8: 96ae add a3,a3,a1 + +000000fa <.LVL29>: + fa: 87b2 mv a5,a2 + +000000fc <.L11>: + fc: 00800637 lui a2,0x800 + 100: 8e75 and a2,a2,a3 + 102: ca01 beqz a2,112 <.L14> + 104: ff800637 lui a2,0xff800 + 108: 167d add a2,a2,-1 # ff7fffff <.LLST12+0xff7ffc30> + 10a: 43f00493 li s1,1087 + +0000010e <.LVL31>: + 10e: 8ef1 and a3,a3,a2 + 110: 8c99 sub s1,s1,a4 + +00000112 <.L14>: + 112: 838d srl a5,a5,0x3 + +00000114 <.LVL34>: + 114: 01d69713 sll a4,a3,0x1d + +00000118 <.LVL35>: + 118: 8fd9 or a5,a5,a4 + +0000011a <.LVL36>: + 11a: 0036d413 srl s0,a3,0x3 + +0000011e <.LVL37>: + 11e: bfa1 j 76 <.L2> + +00000120 <.L9>: + 120: 87b6 mv a5,a3 + +00000122 <.LVL39>: + 122: 46a1 li a3,8 + +00000124 <.LVL40>: + 124: ff850613 add a2,a0,-8 + 128: fad508e3 beq a0,a3,d8 <.L10> + +0000012c <.LVL41>: + 12c: 02800693 li a3,40 + 130: 8e89 sub a3,a3,a0 + 132: 00d7d6b3 srl a3,a5,a3 + 136: 00c41433 sll s0,s0,a2 + +0000013a <.LVL42>: + 13a: 8c55 or s0,s0,a3 + +0000013c <.LVL43>: + 13c: 00c797b3 sll a5,a5,a2 + +00000140 <.LVL44>: + 140: bf61 j d8 <.L10> + +00000142 <.L15>: + 142: 4401 li s0,0 + 144: 4781 li a5,0 + 146: 4481 li s1,0 + 148: b73d j 76 <.L2> + +0000014a <.L16>: + 14a: 43300493 li s1,1075 + +0000014e <.LVL47>: + 14e: b725 j 76 <.L2> + +addtf3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__addtf3>: + 0: 7119 add sp,sp,-128 + 2: 45dc lw a5,12(a1) + 4: 4598 lw a4,8(a1) + 6: 00062283 lw t0,0(a2) + a: 00462303 lw t1,4(a2) + e: 4654 lw a3,12(a2) + 10: cc2a sw a0,24(sp) + 12: 4608 lw a0,8(a2) + 14: 06710613 add a2,sp,103 + 18: 9a41 and a2,a2,-16 + 1a: dca2 sw s0,120(sp) + 1c: de86 sw ra,124(sp) + 1e: daa6 sw s1,116(sp) + 20: 0045a383 lw t2,4(a1) + 24: 4180 lw s0,0(a1) + +00000026 <.LBB3>: + 26: c618 sw a4,8(a2) + 28: d83a sw a4,48(sp) + 2a: 01079713 sll a4,a5,0x10 + 2e: 8341 srl a4,a4,0x10 + 30: da3a sw a4,52(sp) + 32: 00179713 sll a4,a5,0x1 + 36: 00762223 sw t2,4(a2) + 3a: c65c sw a5,12(a2) + +0000003c <.LBE3>: + 3c: c432 sw a2,8(sp) + +0000003e <.LBB4>: + 3e: 83fd srl a5,a5,0x1f + 40: c200 sw s0,0(a2) + 42: 8345 srl a4,a4,0x11 + 44: 1030 add a2,sp,40 + 46: d61e sw t2,44(sp) + 48: c63e sw a5,12(sp) + 4a: d422 sw s0,40(sp) + 4c: c23a sw a4,4(sp) + +0000004e <.LBB5>: + 4e: 01c10393 add t2,sp,28 + +00000052 <.LBB6>: + 52: 87b2 mv a5,a2 + +00000054 <.L2>: + 54: 47d8 lw a4,12(a5) + 56: 478c lw a1,8(a5) + 58: 17f1 add a5,a5,-4 + 5a: 070e sll a4,a4,0x3 + 5c: 81f5 srl a1,a1,0x1d + 5e: 8f4d or a4,a4,a1 + 60: cb98 sw a4,16(a5) + 62: fef399e3 bne t2,a5,54 <.L2> + +00000066 <.LBB8>: + 66: 4722 lw a4,8(sp) + +00000068 <.LBB9>: + 68: 57a2 lw a5,40(sp) + +0000006a <.LBB10>: + 6a: de1a sw t1,60(sp) + 6c: 00672223 sw t1,4(a4) + 70: c754 sw a3,12(a4) + 72: 00572023 sw t0,0(a4) + 76: c708 sw a0,8(a4) + 78: 01069713 sll a4,a3,0x10 + 7c: 8341 srl a4,a4,0x10 + 7e: c2ba sw a4,68(sp) + 80: 00169713 sll a4,a3,0x1 + 84: 8345 srl a4,a4,0x11 + 86: c83a sw a4,16(sp) + 88: 01f6d713 srl a4,a3,0x1f + +0000008c <.LBB11>: + 8c: 078e sll a5,a5,0x3 + +0000008e <.LBB12>: + 8e: ca3a sw a4,20(sp) + 90: 1838 add a4,sp,56 + +00000092 <.LBB13>: + 92: d43e sw a5,40(sp) + +00000094 <.LBB14>: + 94: dc16 sw t0,56(sp) + 96: c0aa sw a0,64(sp) + +00000098 <.LBB15>: + 98: 02c10313 add t1,sp,44 + +0000009c <.LBB16>: + 9c: 86ba mv a3,a4 + +0000009e <.L3>: + 9e: 46cc lw a1,12(a3) + a0: 4688 lw a0,8(a3) + a2: 16f1 add a3,a3,-4 + a4: 058e sll a1,a1,0x3 + a6: 8175 srl a0,a0,0x1d + a8: 8dc9 or a1,a1,a0 + aa: ca8c sw a1,16(a3) + ac: fed319e3 bne t1,a3,9e <.L3> + +000000b0 <.LVL7>: + b0: 56e2 lw a3,56(sp) + +000000b2 <.LBB18>: + b2: 45c2 lw a1,16(sp) + +000000b4 <.LBB53>: + b4: 00369493 sll s1,a3,0x3 + +000000b8 <.LBB54>: + b8: 4692 lw a3,4(sp) + +000000ba <.LBB55>: + ba: dc26 sw s1,56(sp) + +000000bc <.LBB56>: + bc: 40b68533 sub a0,a3,a1 + +000000c0 <.LBE56>: + c0: 46b2 lw a3,12(sp) + c2: 45d2 lw a1,20(sp) + c4: 5eb69b63 bne a3,a1,6ba <.L4> + +000000c8 <.LBB57>: + c8: 2ea05463 blez a0,3b0 <.L5> + +000000cc <.LVL9>: + cc: 56d2 lw a3,52(sp) + +000000ce <.LVL10>: + ce: 52b2 lw t0,44(sp) + d0: 53c2 lw t2,48(sp) + d2: c036 sw a3,0(sp) + d4: 46c2 lw a3,16(sp) + d6: e6bd bnez a3,144 <.L6> + d8: 55f2 lw a1,60(sp) + da: 4606 lw a2,64(sp) + dc: 4316 lw t1,68(sp) + de: 00c5e6b3 or a3,a1,a2 + e2: 0066e6b3 or a3,a3,t1 + e6: 8ec5 or a3,a3,s1 + e8: e299 bnez a3,ee <.L7> + +000000ea <.L362>: + ea: c4be sw a5,72(sp) + ec: a4fd j 3da <.L363> + +000000ee <.L7>: + ee: fff50693 add a3,a0,-1 + +000000f2 <.LVL13>: + f2: ee8d bnez a3,12c <.L9> + +000000f4 <.LBB19>: + f4: 00978733 add a4,a5,s1 + f8: 005586b3 add a3,a1,t0 + +000000fc <.LVL14>: + fc: c4ba sw a4,72(sp) + +000000fe <.LVL15>: + fe: 00f73733 sltu a4,a4,a5 + +00000102 <.LVL16>: + 102: 9736 add a4,a4,a3 + +00000104 <.LVL17>: + 104: c6ba sw a4,76(sp) + +00000106 <.LVL18>: + 106: 00b6b5b3 sltu a1,a3,a1 + +0000010a <.LVL19>: + 10a: 00d73733 sltu a4,a4,a3 + +0000010e <.LVL20>: + 10e: 007607b3 add a5,a2,t2 + +00000112 <.LVL21>: + 112: 8dd9 or a1,a1,a4 + +00000114 <.LVL22>: + 114: 95be add a1,a1,a5 + 116: c8ae sw a1,80(sp) + +00000118 <.LVL23>: + 118: 00c7b733 sltu a4,a5,a2 + +0000011c <.L351>: + 11c: 00f5b5b3 sltu a1,a1,a5 + 120: 4782 lw a5,0(sp) + 122: 8f4d or a4,a4,a1 + +00000124 <.LBB111>: + 124: 4505 li a0,1 + +00000126 <.LBB112>: + 126: 933e add t1,t1,a5 + 128: 971a add a4,a4,t1 + +0000012a <.LBE21>: + 12a: a411 j 32e <.L20> + +0000012c <.L9>: + 12c: 6621 lui a2,0x8 + 12e: 167d add a2,a2,-1 # 7fff <.LLST158+0x5687> + 130: 5ec51ce3 bne a0,a2,f28 <.L21> + +00000134 <.L361>: + 134: c4be sw a5,72(sp) + 136: a4e5 j 41e <.L356> + +00000138 <.L266>: + 138: 87a6 mv a5,s1 + 13a: bfed j 134 <.L361> + +0000013c <.L267>: + 13c: 82ba mv t0,a4 + 13e: 83b6 mv t2,a3 + 140: c032 sw a2,0(sp) + +00000142 <.LVL28>: + 142: bfcd j 134 <.L361> + +00000144 <.L6>: + 144: 4612 lw a2,4(sp) + 146: 66a1 lui a3,0x8 + 148: 16fd add a3,a3,-1 # 7fff <.LLST158+0x5687> + 14a: 0cd61e63 bne a2,a3,226 <.L22> + +0000014e <.LVL30>: + 14e: c4be sw a5,72(sp) + 150: 4782 lw a5,0(sp) + 152: c696 sw t0,76(sp) + 154: c89e sw t2,80(sp) + 156: cabe sw a5,84(sp) + +00000158 <.LBB115>: + 158: 8532 mv a0,a2 + +0000015a <.L8>: + 15a: 47a6 lw a5,72(sp) + 15c: 0077f713 and a4,a5,7 + 160: c71d beqz a4,18e <.L252> + 162: 00f7f713 and a4,a5,15 + 166: 4691 li a3,4 + 168: 02d70363 beq a4,a3,18e <.L252> + +0000016c <.LBB117>: + 16c: 4736 lw a4,76(sp) + 16e: 0791 add a5,a5,4 + 170: c4be sw a5,72(sp) + +00000172 <.LVL33>: + 172: 0047b793 sltiu a5,a5,4 + +00000176 <.LVL34>: + 176: 97ba add a5,a5,a4 + 178: c6be sw a5,76(sp) + +0000017a <.LVL35>: + 17a: 00e7b7b3 sltu a5,a5,a4 + +0000017e <.LVL36>: + 17e: 4746 lw a4,80(sp) + 180: 97ba add a5,a5,a4 + +00000182 <.LVL37>: + 182: c8be sw a5,80(sp) + +00000184 <.LVL38>: + 184: 00e7b7b3 sltu a5,a5,a4 + +00000188 <.LVL39>: + 188: 4756 lw a4,84(sp) + 18a: 97ba add a5,a5,a4 + +0000018c <.LVL40>: + 18c: cabe sw a5,84(sp) + +0000018e <.L252>: + 18e: 47d6 lw a5,84(sp) + 190: 00080737 lui a4,0x80 + 194: 8f7d and a4,a4,a5 + 196: cb19 beqz a4,1ac <.L257> + 198: 6721 lui a4,0x8 + 19a: 0505 add a0,a0,1 + +0000019c <.LVL42>: + 19c: 177d add a4,a4,-1 # 7fff <.LLST158+0x5687> + 19e: 56e50fe3 beq a0,a4,f1c <.L258> + 1a2: fff80737 lui a4,0xfff80 + 1a6: 177d add a4,a4,-1 # fff7ffff <.LLST158+0xfff7d687> + 1a8: 8ff9 and a5,a5,a4 + 1aa: cabe sw a5,84(sp) + +000001ac <.L257>: + 1ac: 00bc add a5,sp,72 + 1ae: 08d0 add a2,sp,84 + +000001b0 <.L260>: + 1b0: 4398 lw a4,0(a5) + 1b2: 43d4 lw a3,4(a5) + 1b4: 830d srl a4,a4,0x3 + 1b6: 06f6 sll a3,a3,0x1d + 1b8: 8f55 or a4,a4,a3 + 1ba: c398 sw a4,0(a5) + 1bc: 0791 add a5,a5,4 + 1be: fec799e3 bne a5,a2,1b0 <.L260> + +000001c2 <.LVL45>: + 1c2: 4756 lw a4,84(sp) + +000001c4 <.LBE118>: + 1c4: 66a1 lui a3,0x8 + 1c6: fff68793 add a5,a3,-1 # 7fff <.LLST158+0x5687> + +000001ca <.LBB119>: + 1ca: 830d srl a4,a4,0x3 + 1cc: caba sw a4,84(sp) + +000001ce <.LBE119>: + 1ce: 00f51e63 bne a0,a5,1ea <.L261> + 1d2: 4636 lw a2,76(sp) + 1d4: 47a6 lw a5,72(sp) + 1d6: 8fd1 or a5,a5,a2 + 1d8: 4646 lw a2,80(sp) + 1da: 8fd1 or a5,a5,a2 + 1dc: 8fd9 or a5,a5,a4 + 1de: c791 beqz a5,1ea <.L261> + 1e0: cab6 sw a3,84(sp) + 1e2: c882 sw zero,80(sp) + 1e4: c682 sw zero,76(sp) + 1e6: c482 sw zero,72(sp) + +000001e8 <.LVL46>: + 1e8: c602 sw zero,12(sp) + +000001ea <.L261>: + 1ea: 47a2 lw a5,8(sp) + 1ec: 4626 lw a2,72(sp) + 1ee: 46b6 lw a3,76(sp) + 1f0: 4746 lw a4,80(sp) + 1f2: 45a2 lw a1,8(sp) + 1f4: c390 sw a2,0(a5) + 1f6: c3d4 sw a3,4(a5) + 1f8: c798 sw a4,8(a5) + 1fa: 47d6 lw a5,84(sp) + 1fc: 0546 sll a0,a0,0x11 + +000001fe <.LVL48>: + 1fe: 8145 srl a0,a0,0x11 + 200: 00f59623 sh a5,12(a1) + 204: 47b2 lw a5,12(sp) + +00000206 <.LBE122>: + 206: 50f6 lw ra,124(sp) + 208: 5466 lw s0,120(sp) + +0000020a <.LBB123>: + 20a: 07be sll a5,a5,0xf + 20c: 8fc9 or a5,a5,a0 + 20e: 00f59723 sh a5,14(a1) + 212: 45dc lw a5,12(a1) + +00000214 <.LBE123>: + 214: 45e2 lw a1,24(sp) + 216: 54d6 lw s1,116(sp) + 218: c190 sw a2,0(a1) + 21a: c1d4 sw a3,4(a1) + 21c: c598 sw a4,8(a1) + 21e: c5dc sw a5,12(a1) + 220: 852e mv a0,a1 + 222: 6109 add sp,sp,128 + +00000224 <.LVL50>: + 224: 8082 ret + +00000226 <.L22>: + 226: 4696 lw a3,68(sp) + 228: 00080637 lui a2,0x80 + 22c: 8ed1 or a3,a3,a2 + 22e: c2b6 sw a3,68(sp) + +00000230 <.LDL1>: + 230: 07400693 li a3,116 + 234: 4ea6cee3 blt a3,a0,f30 <.L23> + 238: 86aa mv a3,a0 + +0000023a <.L262>: + 23a: 4056d513 sra a0,a3,0x5 + +0000023e <.LVL53>: + 23e: 85ba mv a1,a4 + 240: 8afd and a3,a3,31 + +00000242 <.LVL54>: + 242: 4481 li s1,0 + 244: 4601 li a2,0 + +00000246 <.L24>: + 246: 02a61463 bne a2,a0,26e <.L25> + 24a: 460d li a2,3 + +0000024c <.LVL56>: + 24c: 8e09 sub a2,a2,a0 + 24e: 00251593 sll a1,a0,0x2 + 252: e68d bnez a3,27c <.L26> + +00000254 <.L27>: + 254: 00b70333 add t1,a4,a1 + 258: 00032303 lw t1,0(t1) + 25c: 0685 add a3,a3,1 + +0000025e <.LVL58>: + 25e: 00672023 sw t1,0(a4) + +00000262 <.LVL59>: + 262: 0711 add a4,a4,4 + 264: fed658e3 bge a2,a3,254 <.L27> + 268: 4711 li a4,4 + 26a: 8f09 sub a4,a4,a0 + 26c: a899 j 2c2 <.L31> + +0000026e <.L25>: + 26e: 0005a303 lw t1,0(a1) + 272: 0605 add a2,a2,1 # 80001 <.LLST158+0x7d689> + +00000274 <.LVL61>: + 274: 0591 add a1,a1,4 + 276: 0064e4b3 or s1,s1,t1 + +0000027a <.LVL62>: + 27a: b7f1 j 246 <.L24> + +0000027c <.L26>: + 27c: 02000313 li t1,32 + 280: 40d30433 sub s0,t1,a3 + 284: ca22 sw s0,20(sp) + +00000286 <.LVL64>: + 286: 02810313 add t1,sp,40 + 28a: 04c58413 add s0,a1,76 + 28e: 9322 add t1,t1,s0 + 290: fc432303 lw t1,-60(t1) + 294: 4452 lw s0,20(sp) + 296: c802 sw zero,16(sp) + +00000298 <.LVL65>: + 298: 00831333 sll t1,t1,s0 + 29c: 1820 add s0,sp,56 + 29e: 0064e4b3 or s1,s1,t1 + +000002a2 <.LVL66>: + 2a2: 95a2 add a1,a1,s0 + +000002a4 <.L29>: + 2a4: 4442 lw s0,16(sp) + 2a6: 0cc44f63 blt s0,a2,384 <.L30> + 2aa: 060a sll a2,a2,0x2 + 2ac: 102c add a1,sp,40 + 2ae: 04c60613 add a2,a2,76 + 2b2: 962e add a2,a2,a1 + 2b4: 4596 lw a1,68(sp) + 2b6: 4711 li a4,4 + 2b8: 8f09 sub a4,a4,a0 + +000002ba <.LVL68>: + 2ba: 00d5d5b3 srl a1,a1,a3 + 2be: fcb62223 sw a1,-60(a2) + +000002c2 <.L31>: + 2c2: 4691 li a3,4 + 2c4: 8e99 sub a3,a3,a4 + 2c6: 1830 add a2,sp,56 + 2c8: 070a sll a4,a4,0x2 + 2ca: 9732 add a4,a4,a2 + 2cc: 068a sll a3,a3,0x2 + 2ce: 4621 li a2,8 + 2d0: 00c6e863 bltu a3,a2,2e0 <.L32> + 2d4: 00072023 sw zero,0(a4) + +000002d8 <.LVL70>: + 2d8: 00072223 sw zero,4(a4) + 2dc: 16e1 add a3,a3,-8 + 2de: 0721 add a4,a4,8 + +000002e0 <.L32>: + 2e0: 4611 li a2,4 + 2e2: 00c6e463 bltu a3,a2,2ea <.L33> + 2e6: 00072023 sw zero,0(a4) + +000002ea <.L33>: + 2ea: 5762 lw a4,56(sp) + +000002ec <.LBB24>: + 2ec: 009034b3 snez s1,s1 + +000002f0 <.LBE24>: + 2f0: 8cd9 or s1,s1,a4 + +000002f2 <.L34>: + 2f2: 56f2 lw a3,60(sp) + +000002f4 <.LBB26>: + 2f4: dc26 sw s1,56(sp) + +000002f6 <.LBB27>: + 2f6: 94be add s1,s1,a5 + 2f8: 00568633 add a2,a3,t0 + 2fc: 4706 lw a4,64(sp) + 2fe: c4a6 sw s1,72(sp) + +00000300 <.LVL74>: + 300: 00f4b4b3 sltu s1,s1,a5 + +00000304 <.LVL75>: + 304: 94b2 add s1,s1,a2 + +00000306 <.LVL76>: + 306: c6a6 sw s1,76(sp) + +00000308 <.LVL77>: + 308: 00d636b3 sltu a3,a2,a3 + +0000030c <.LVL78>: + 30c: 00c4b4b3 sltu s1,s1,a2 + +00000310 <.LVL79>: + 310: 007707b3 add a5,a4,t2 + +00000314 <.LVL80>: + 314: 8ec5 or a3,a3,s1 + +00000316 <.LVL81>: + 316: 96be add a3,a3,a5 + 318: 00e7b733 sltu a4,a5,a4 + +0000031c <.LVL82>: + 31c: c8b6 sw a3,80(sp) + +0000031e <.LVL83>: + 31e: 00f6b6b3 sltu a3,a3,a5 + +00000322 <.LVL84>: + 322: 8f55 or a4,a4,a3 + +00000324 <.LVL85>: + 324: 4796 lw a5,68(sp) + +00000326 <.LVL86>: + 326: 4682 lw a3,0(sp) + +00000328 <.LBB125>: + 328: 4512 lw a0,4(sp) + +0000032a <.LBB126>: + 32a: 97b6 add a5,a5,a3 + 32c: 973e add a4,a4,a5 + +0000032e <.L20>: + 32e: 000807b7 lui a5,0x80 + +00000332 <.LBB29>: + 332: caba sw a4,84(sp) + +00000334 <.LBE29>: + 334: 8ff9 and a5,a5,a4 + 336: e20782e3 beqz a5,15a <.L8> + 33a: fff807b7 lui a5,0xfff80 + 33e: 17fd add a5,a5,-1 # fff7ffff <.LLST158+0xfff7d687> + 340: 8f7d and a4,a4,a5 + 342: caba sw a4,84(sp) + +00000344 <.LBB30>: + 344: 4726 lw a4,72(sp) + +00000346 <.LBE30>: + 346: 0505 add a0,a0,1 + +00000348 <.LBB32>: + 348: 08cc add a1,sp,84 + 34a: 01f71693 sll a3,a4,0x1f + +0000034e <.LVL91>: + 34e: 00b8 add a4,sp,72 + +00000350 <.L117>: + 350: 431c lw a5,0(a4) + 352: 4350 lw a2,4(a4) + 354: 8385 srl a5,a5,0x1 + 356: 067e sll a2,a2,0x1f + 358: 8fd1 or a5,a5,a2 + 35a: c31c sw a5,0(a4) + 35c: 0711 add a4,a4,4 + 35e: fee599e3 bne a1,a4,350 <.L117> + +00000362 <.LVL93>: + 362: 47d6 lw a5,84(sp) + 364: 00d03733 snez a4,a3 + 368: 8385 srl a5,a5,0x1 + 36a: cabe sw a5,84(sp) + +0000036c <.LBE32>: + 36c: 47a6 lw a5,72(sp) + 36e: 8fd9 or a5,a5,a4 + 370: c4be sw a5,72(sp) + +00000372 <.LBE33>: + 372: 67a1 lui a5,0x8 + 374: 17fd add a5,a5,-1 # 7fff <.LLST158+0x5687> + 376: def512e3 bne a0,a5,15a <.L8> + +0000037a <.LVL95>: + 37a: ca82 sw zero,84(sp) + 37c: c882 sw zero,80(sp) + 37e: c682 sw zero,76(sp) + 380: c482 sw zero,72(sp) + +00000382 <.LBB127>: + 382: bbe1 j 15a <.L8> + +00000384 <.L30>: + 384: 0005a303 lw t1,0(a1) + 388: 0591 add a1,a1,4 + 38a: 00d35433 srl s0,t1,a3 + +0000038e <.LVL98>: + 38e: ce22 sw s0,28(sp) + 390: 0005a303 lw t1,0(a1) + 394: 4452 lw s0,20(sp) + 396: 00831333 sll t1,t1,s0 + 39a: 841a mv s0,t1 + 39c: 4372 lw t1,28(sp) + 39e: 00836333 or t1,t1,s0 + 3a2: 4442 lw s0,16(sp) + 3a4: 00672023 sw t1,0(a4) + +000003a8 <.LVL99>: + 3a8: 0711 add a4,a4,4 + 3aa: 0405 add s0,s0,1 + 3ac: c822 sw s0,16(sp) + +000003ae <.LVL100>: + 3ae: bddd j 2a4 <.L29> + +000003b0 <.L5>: + 3b0: 4716 lw a4,68(sp) + 3b2: 52f2 lw t0,60(sp) + 3b4: 4386 lw t2,64(sp) + 3b6: c03a sw a4,0(sp) + 3b8: 1c050563 beqz a0,582 <.L45> + 3bc: 4742 lw a4,16(sp) + 3be: 4692 lw a3,4(sp) + +000003c0 <.LVL102>: + 3c0: 40d70533 sub a0,a4,a3 + +000003c4 <.LVL103>: + 3c4: e6a5 bnez a3,42c <.L46> + 3c6: 55b2 lw a1,44(sp) + 3c8: 5742 lw a4,48(sp) + +000003ca <.LVL104>: + 3ca: 5352 lw t1,52(sp) + 3cc: 00e5e6b3 or a3,a1,a4 + 3d0: 0066e6b3 or a3,a3,t1 + 3d4: 8edd or a3,a3,a5 + 3d6: e699 bnez a3,3e4 <.L47> + +000003d8 <.LVL105>: + 3d8: c4a6 sw s1,72(sp) + +000003da <.L363>: + 3da: 4782 lw a5,0(sp) + 3dc: c696 sw t0,76(sp) + 3de: c89e sw t2,80(sp) + +000003e0 <.L355>: + 3e0: cabe sw a5,84(sp) + +000003e2 <.LBB131>: + 3e2: bba5 j 15a <.L8> + +000003e4 <.L47>: + 3e4: fff50693 add a3,a0,-1 + +000003e8 <.LVL110>: + 3e8: e695 bnez a3,414 <.L48> + +000003ea <.LBB35>: + 3ea: 009786b3 add a3,a5,s1 + +000003ee <.LVL111>: + 3ee: 00558633 add a2,a1,t0 + 3f2: c4b6 sw a3,72(sp) + +000003f4 <.LVL112>: + 3f4: 00f6b6b3 sltu a3,a3,a5 + +000003f8 <.LVL113>: + 3f8: 96b2 add a3,a3,a2 + +000003fa <.LVL114>: + 3fa: c6b6 sw a3,76(sp) + +000003fc <.LVL115>: + 3fc: 00b635b3 sltu a1,a2,a1 + +00000400 <.LVL116>: + 400: 00c6b6b3 sltu a3,a3,a2 + +00000404 <.LVL117>: + 404: 007707b3 add a5,a4,t2 + +00000408 <.LVL118>: + 408: 8dd5 or a1,a1,a3 + +0000040a <.LVL119>: + 40a: 95be add a1,a1,a5 + 40c: c8ae sw a1,80(sp) + +0000040e <.LVL120>: + 40e: 00e7b733 sltu a4,a5,a4 + +00000412 <.LVL121>: + 412: b329 j 11c <.L351> + +00000414 <.L48>: + 414: 67a1 lui a5,0x8 + 416: 17fd add a5,a5,-1 # 7fff <.LLST158+0x5687> + 418: 32f512e3 bne a0,a5,f3c <.L59> + +0000041c <.L60>: + 41c: c4a6 sw s1,72(sp) + +0000041e <.L356>: + 41e: 4782 lw a5,0(sp) + 420: c696 sw t0,76(sp) + 422: c89e sw t2,80(sp) + 424: cabe sw a5,84(sp) + +00000426 <.LBB134>: + 426: a479 j 6b4 <.L358> + +00000428 <.L268>: + 428: 84be mv s1,a5 + 42a: bfcd j 41c <.L60> + +0000042c <.L46>: + 42c: 4742 lw a4,16(sp) + +0000042e <.LVL127>: + 42e: 67a1 lui a5,0x8 + 430: 17fd add a5,a5,-1 # 7fff <.LLST158+0x5687> + 432: fef705e3 beq a4,a5,41c <.L60> + 436: 57d2 lw a5,52(sp) + 438: 00080737 lui a4,0x80 + 43c: 8fd9 or a5,a5,a4 + 43e: da3e sw a5,52(sp) + +00000440 <.LDL4>: + 440: 07400793 li a5,116 + 444: 30a7c0e3 blt a5,a0,f44 <.L61> + 448: 86aa mv a3,a0 + +0000044a <.L263>: + 44a: 41f6d793 sra a5,a3,0x1f + 44e: 8bfd and a5,a5,31 + 450: 97b6 add a5,a5,a3 + 452: 8795 sra a5,a5,0x5 + +00000454 <.LVL129>: + 454: 85b2 mv a1,a2 + 456: 4401 li s0,0 + 458: 4701 li a4,0 + +0000045a <.L62>: + 45a: 02f74563 blt a4,a5,484 <.L63> + 45e: 458d li a1,3 + 460: 01f6f713 and a4,a3,31 + +00000464 <.LVL131>: + 464: 40f580b3 sub ra,a1,a5 + 468: e31d bnez a4,48e <.L64> + 46a: 00279593 sll a1,a5,0x2 + +0000046e <.L65>: + 46e: 00b606b3 add a3,a2,a1 + 472: 4294 lw a3,0(a3) + 474: 0705 add a4,a4,1 # 80001 <.LLST158+0x7d689> + +00000476 <.LVL133>: + 476: c214 sw a3,0(a2) + +00000478 <.LVL134>: + 478: 0611 add a2,a2,4 + 47a: fee0dae3 bge ra,a4,46e <.L65> + 47e: 4511 li a0,4 + 480: 8d1d sub a0,a0,a5 + 482: a88d j 4f4 <.L71> + +00000484 <.L63>: + 484: 4188 lw a0,0(a1) + 486: 0705 add a4,a4,1 + +00000488 <.LVL136>: + 488: 0591 add a1,a1,4 + 48a: 8c49 or s0,s0,a0 + +0000048c <.LVL137>: + 48c: b7f9 j 45a <.L62> + +0000048e <.L64>: + 48e: 800005b7 lui a1,0x80000 + 492: 05fd add a1,a1,31 # 8000001f <.LLST158+0x7fffd6a7> + 494: 8eed and a3,a3,a1 + +00000496 <.LVL139>: + 496: 0006d663 bgez a3,4a2 <.L67> + 49a: 16fd add a3,a3,-1 + 49c: fe06e693 or a3,a3,-32 + 4a0: 0685 add a3,a3,1 + +000004a2 <.L67>: + 4a2: 02000513 li a0,32 + 4a6: 40d506b3 sub a3,a0,a3 + 4aa: c236 sw a3,4(sp) + +000004ac <.LVL140>: + 4ac: 86be mv a3,a5 + 4ae: 0007d363 bgez a5,4b4 <.L68> + +000004b2 <.LVL141>: + 4b2: 4681 li a3,0 + +000004b4 <.L68>: + 4b4: 068a sll a3,a3,0x2 + 4b6: 102c add a1,sp,40 + 4b8: 04c68693 add a3,a3,76 + 4bc: 96ae add a3,a3,a1 + 4be: fb46a683 lw a3,-76(a3) + 4c2: 4592 lw a1,4(sp) + 4c4: 4301 li t1,0 + 4c6: 00b696b3 sll a3,a3,a1 + 4ca: 8c55 or s0,s0,a3 + +000004cc <.LVL143>: + 4cc: 00279693 sll a3,a5,0x2 + 4d0: 02868693 add a3,a3,40 + 4d4: 968a add a3,a3,sp + +000004d6 <.L69>: + 4d6: 08134763 blt t1,ra,564 <.L70> + 4da: 4511 li a0,4 + 4dc: 8d1d sub a0,a0,a5 + +000004de <.LVL145>: + 4de: 00209793 sll a5,ra,0x2 + +000004e2 <.LVL146>: + 4e2: 04c78793 add a5,a5,76 + 4e6: 1034 add a3,sp,40 + 4e8: 96be add a3,a3,a5 + 4ea: 57d2 lw a5,52(sp) + 4ec: 00e7d7b3 srl a5,a5,a4 + 4f0: faf6aa23 sw a5,-76(a3) + +000004f4 <.L71>: + 4f4: 4791 li a5,4 + 4f6: 4601 li a2,0 + 4f8: 00a7c563 blt a5,a0,502 <.L73> + 4fc: 8f89 sub a5,a5,a0 + 4fe: 00279613 sll a2,a5,0x2 + +00000502 <.L73>: + 502: 050a sll a0,a0,0x2 + 504: 02850793 add a5,a0,40 + 508: 00278533 add a0,a5,sp + 50c: 4581 li a1,0 + 50e: ca1e sw t2,20(sp) + 510: c216 sw t0,4(sp) + 512: 00000097 auipc ra,0x0 + 516: 000080e7 jalr ra # 512 <.L73+0x10> + +0000051a <.LBE37>: + 51a: 57a2 lw a5,40(sp) + +0000051c <.LBE36>: + 51c: 4292 lw t0,4(sp) + 51e: 43d2 lw t2,20(sp) + +00000520 <.LBB38>: + 520: 00803433 snez s0,s0 + +00000524 <.LBE38>: + 524: 8c5d or s0,s0,a5 + +00000526 <.L74>: + 526: 57b2 lw a5,44(sp) + +00000528 <.LBB41>: + 528: d422 sw s0,40(sp) + +0000052a <.LBB42>: + 52a: 9426 add s0,s0,s1 + 52c: 005786b3 add a3,a5,t0 + 530: 5742 lw a4,48(sp) + 532: c4a2 sw s0,72(sp) + +00000534 <.LVL151>: + 534: 00943433 sltu s0,s0,s1 + +00000538 <.LVL152>: + 538: 9436 add s0,s0,a3 + +0000053a <.LVL153>: + 53a: 00f6b7b3 sltu a5,a3,a5 + +0000053e <.LVL154>: + 53e: c6a2 sw s0,76(sp) + +00000540 <.LVL155>: + 540: 00d43433 sltu s0,s0,a3 + +00000544 <.LVL156>: + 544: 00770633 add a2,a4,t2 + +00000548 <.LVL157>: + 548: 8fc1 or a5,a5,s0 + +0000054a <.LVL158>: + 54a: 97b2 add a5,a5,a2 + 54c: c8be sw a5,80(sp) + +0000054e <.LVL159>: + 54e: 00e63733 sltu a4,a2,a4 + +00000552 <.LVL160>: + 552: 00c7b7b3 sltu a5,a5,a2 + +00000556 <.LVL161>: + 556: 8f5d or a4,a4,a5 + +00000558 <.LVL162>: + 558: 4682 lw a3,0(sp) + +0000055a <.LVL163>: + 55a: 57d2 lw a5,52(sp) + +0000055c <.LBB137>: + 55c: 4542 lw a0,16(sp) + +0000055e <.LBB138>: + 55e: 97b6 add a5,a5,a3 + 560: 973e add a4,a4,a5 + +00000562 <.LBE43>: + 562: b3f1 j 32e <.L20> + +00000564 <.L70>: + 564: 428c lw a1,0(a3) + 566: 4512 lw a0,4(sp) + 568: 0305 add t1,t1,1 + +0000056a <.LVL166>: + 56a: 00e5d5b3 srl a1,a1,a4 + 56e: ca2e sw a1,20(sp) + 570: 42cc lw a1,4(a3) + 572: 0691 add a3,a3,4 + 574: 00a595b3 sll a1,a1,a0 + 578: 4552 lw a0,20(sp) + 57a: 8dc9 or a1,a1,a0 + 57c: c20c sw a1,0(a2) + +0000057e <.LVL167>: + 57e: 0611 add a2,a2,4 + 580: bf99 j 4d6 <.L69> + +00000582 <.L45>: + 582: 4712 lw a4,4(sp) + 584: 6321 lui t1,0x8 + 586: ffe30593 add a1,t1,-2 # 7ffe <.LLST158+0x5686> + 58a: 00170513 add a0,a4,1 + +0000058e <.LVL169>: + 58e: 8de9 and a1,a1,a0 + 590: 5732 lw a4,44(sp) + 592: 56c2 lw a3,48(sp) + +00000594 <.LVL170>: + 594: 5652 lw a2,52(sp) + 596: eddd bnez a1,654 <.L85> + 598: 4512 lw a0,4(sp) + 59a: 00d765b3 or a1,a4,a3 + 59e: 8dd1 or a1,a1,a2 + 5a0: 8ddd or a1,a1,a5 + 5a2: e93d bnez a0,618 <.L86> + +000005a4 <.LVL171>: + 5a4: e981 bnez a1,5b4 <.L87> + 5a6: 4782 lw a5,0(sp) + 5a8: c4a6 sw s1,72(sp) + 5aa: c696 sw t0,76(sp) + 5ac: c89e sw t2,80(sp) + +000005ae <.L350>: + 5ae: cabe sw a5,84(sp) + +000005b0 <.L354>: + 5b0: 4501 li a0,0 + 5b2: b665 j 15a <.L8> + +000005b4 <.L87>: + 5b4: 4502 lw a0,0(sp) + 5b6: 0072e5b3 or a1,t0,t2 + 5ba: 8dc9 or a1,a1,a0 + 5bc: 8dc5 or a1,a1,s1 + 5be: e591 bnez a1,5ca <.L88> + 5c0: c4be sw a5,72(sp) + 5c2: c6ba sw a4,76(sp) + 5c4: c8b6 sw a3,80(sp) + 5c6: cab2 sw a2,84(sp) + 5c8: b7e5 j 5b0 <.L354> + +000005ca <.L88>: + 5ca: 009785b3 add a1,a5,s1 + 5ce: 00570533 add a0,a4,t0 + 5d2: c4ae sw a1,72(sp) + +000005d4 <.LVL175>: + 5d4: 00f5b5b3 sltu a1,a1,a5 + +000005d8 <.LVL176>: + 5d8: 95aa add a1,a1,a0 + +000005da <.LVL177>: + 5da: c6ae sw a1,76(sp) + +000005dc <.LVL178>: + 5dc: 00e53733 sltu a4,a0,a4 + +000005e0 <.LVL179>: + 5e0: 00a5b5b3 sltu a1,a1,a0 + +000005e4 <.LVL180>: + 5e4: 007687b3 add a5,a3,t2 + +000005e8 <.LVL181>: + 5e8: 8f4d or a4,a4,a1 + +000005ea <.LVL182>: + 5ea: 973e add a4,a4,a5 + 5ec: 00d7b6b3 sltu a3,a5,a3 + +000005f0 <.LVL183>: + 5f0: c8ba sw a4,80(sp) + +000005f2 <.LVL184>: + 5f2: 00f73733 sltu a4,a4,a5 + +000005f6 <.LVL185>: + 5f6: 4782 lw a5,0(sp) + 5f8: 8ed9 or a3,a3,a4 + +000005fa <.LVL186>: + 5fa: 963e add a2,a2,a5 + 5fc: 96b2 add a3,a3,a2 + +000005fe <.LBE45>: + 5fe: 000807b7 lui a5,0x80 + 602: 8ff5 and a5,a5,a3 + 604: e399 bnez a5,60a <.L99> + +00000606 <.LBB46>: + 606: cab6 sw a3,84(sp) + 608: b765 j 5b0 <.L354> + +0000060a <.L99>: + 60a: fff807b7 lui a5,0xfff80 + 60e: 17fd add a5,a5,-1 # fff7ffff <.LLST158+0xfff7d687> + 610: 8efd and a3,a3,a5 + 612: cab6 sw a3,84(sp) + +00000614 <.LBB145>: + 614: 4505 li a0,1 + +00000616 <.LVL188>: + 616: b691 j 15a <.L8> + +00000618 <.L86>: + 618: b20580e3 beqz a1,138 <.L266> + 61c: 4502 lw a0,0(sp) + 61e: 0072e5b3 or a1,t0,t2 + 622: 8dc9 or a1,a1,a0 + 624: 8dc5 or a1,a1,s1 + 626: b0058be3 beqz a1,13c <.L267> + +0000062a <.LBB148>: + 62a: ca9a sw t1,84(sp) + 62c: c882 sw zero,80(sp) + 62e: c682 sw zero,76(sp) + 630: c482 sw zero,72(sp) + +00000632 <.LBB47>: + 632: 00bc add a5,sp,72 + 634: 1870 add a2,sp,60 + +00000636 <.L102>: + 636: 47d8 lw a4,12(a5) + 638: 4794 lw a3,8(a5) + 63a: 17f1 add a5,a5,-4 + 63c: 070e sll a4,a4,0x3 + 63e: 82f5 srl a3,a3,0x1d + 640: 8f55 or a4,a4,a3 + 642: cb98 sw a4,16(a5) + 644: fef619e3 bne a2,a5,636 <.L102> + +00000648 <.L352>: + 648: 47a6 lw a5,72(sp) + +0000064a <.LBE69>: + 64a: 6521 lui a0,0x8 + 64c: 157d add a0,a0,-1 # 7fff <.LLST158+0x5687> + +0000064e <.LBB70>: + 64e: 078e sll a5,a5,0x3 + +00000650 <.LBB150>: + 650: c4be sw a5,72(sp) + 652: ab59 j be8 <.L357> + +00000654 <.L85>: + 654: 009785b3 add a1,a5,s1 + 658: 00570333 add t1,a4,t0 + 65c: c4ae sw a1,72(sp) + +0000065e <.LVL195>: + 65e: 00f5b5b3 sltu a1,a1,a5 + +00000662 <.LVL196>: + 662: 959a add a1,a1,t1 + +00000664 <.LVL197>: + 664: c6ae sw a1,76(sp) + +00000666 <.LVL198>: + 666: 00e33733 sltu a4,t1,a4 + +0000066a <.LVL199>: + 66a: 0065b5b3 sltu a1,a1,t1 + +0000066e <.LVL200>: + 66e: 007687b3 add a5,a3,t2 + +00000672 <.LVL201>: + 672: 8f4d or a4,a4,a1 + +00000674 <.LVL202>: + 674: 973e add a4,a4,a5 + 676: 00d7b6b3 sltu a3,a5,a3 + +0000067a <.LVL203>: + 67a: c8ba sw a4,80(sp) + +0000067c <.LVL204>: + 67c: 00f73733 sltu a4,a4,a5 + +00000680 <.LVL205>: + 680: 4782 lw a5,0(sp) + 682: 8ed9 or a3,a3,a4 + +00000684 <.LVL206>: + 684: 963e add a2,a2,a5 + 686: 96b2 add a3,a3,a2 + 688: cab6 sw a3,84(sp) + +0000068a <.LBB49>: + 68a: 00bc add a5,sp,72 + +0000068c <.LVL208>: + 68c: 08d0 add a2,sp,84 + +0000068e <.L114>: + 68e: 4398 lw a4,0(a5) + 690: 43d4 lw a3,4(a5) + 692: 8305 srl a4,a4,0x1 + 694: 06fe sll a3,a3,0x1f + 696: 8f55 or a4,a4,a3 + 698: c398 sw a4,0(a5) + 69a: 0791 add a5,a5,4 + 69c: fef619e3 bne a2,a5,68e <.L114> + 6a0: 47d6 lw a5,84(sp) + +000006a2 <.LBE49>: + 6a2: 6721 lui a4,0x8 + 6a4: 177d add a4,a4,-1 # 7fff <.LLST158+0x5687> + +000006a6 <.LBB52>: + 6a6: 8385 srl a5,a5,0x1 + +000006a8 <.LBE52>: + 6a8: d2e51ce3 bne a0,a4,3e0 <.L355> + +000006ac <.LVL211>: + 6ac: ca82 sw zero,84(sp) + 6ae: c882 sw zero,80(sp) + 6b0: c682 sw zero,76(sp) + 6b2: c482 sw zero,72(sp) + +000006b4 <.L358>: + 6b4: 6521 lui a0,0x8 + 6b6: 157d add a0,a0,-1 # 7fff <.LLST158+0x5687> + 6b8: b44d j 15a <.L8> + +000006ba <.L4>: + 6ba: 20a05063 blez a0,8ba <.L120> + +000006be <.LBB156>: + 6be: 56d2 lw a3,52(sp) + 6c0: 52b2 lw t0,44(sp) + 6c2: 53c2 lw t2,48(sp) + 6c4: c036 sw a3,0(sp) + +000006c6 <.LBB157>: + 6c6: 46c2 lw a3,16(sp) + 6c8: e2d1 bnez a3,74c <.L121> + 6ca: 5472 lw s0,60(sp) + 6cc: 4306 lw t1,64(sp) + 6ce: 4696 lw a3,68(sp) + 6d0: 00646633 or a2,s0,t1 + 6d4: 8e55 or a2,a2,a3 + 6d6: 8e45 or a2,a2,s1 + 6d8: a00609e3 beqz a2,ea <.L362> + 6dc: fff50593 add a1,a0,-1 + +000006e0 <.LVL215>: + 6e0: e9a9 bnez a1,732 <.L123> + +000006e2 <.LBB72>: + 6e2: 40828633 sub a2,t0,s0 + 6e6: 00c2b533 sltu a0,t0,a2 + 6ea: 40978733 sub a4,a5,s1 + +000006ee <.LVL217>: + 6ee: c22a sw a0,4(sp) + +000006f0 <.LVL218>: + 6f0: 84aa mv s1,a0 + +000006f2 <.LVL219>: + 6f2: 00e7b533 sltu a0,a5,a4 + 6f6: 8e09 sub a2,a2,a0 + +000006f8 <.LVL220>: + 6f8: 40638533 sub a0,t2,t1 + 6fc: c82a sw a0,16(sp) + +000006fe <.LVL221>: + 6fe: 0063b533 sltu a0,t2,t1 + 702: 00e7fc63 bgeu a5,a4,71a <.L128> + 706: 00541a63 bne s0,t0,71a <.L128> + +0000070a <.LVL222>: + 70a: 406387b3 sub a5,t2,t1 + 70e: 17fd add a5,a5,-1 + +00000710 <.L129>: + 710: 40730333 sub t1,t1,t2 + 714: 00133593 seqz a1,t1 + +00000718 <.LVL224>: + 718: a031 j 724 <.L130> + +0000071a <.L128>: + 71a: 4412 lw s0,4(sp) + 71c: 406387b3 sub a5,t2,t1 + 720: 8f85 sub a5,a5,s1 + +00000722 <.LVL226>: + 722: f47d bnez s0,710 <.L129> + +00000724 <.L130>: + 724: 4402 lw s0,0(sp) + 726: 8d4d or a0,a0,a1 + +00000728 <.LVL228>: + 728: 40d406b3 sub a3,s0,a3 + 72c: 8e89 sub a3,a3,a0 + +0000072e <.L353>: + 72e: 4505 li a0,1 + +00000730 <.LBB159>: + 730: a281 j 870 <.L131> + +00000732 <.L123>: + 732: 66a1 lui a3,0x8 + 734: 16fd add a3,a3,-1 # 7fff <.LLST158+0x5687> + 736: 9ed50fe3 beq a0,a3,134 <.L361> + 73a: 07400693 li a3,116 + 73e: 02b6d663 bge a3,a1,76a <.L264> + +00000742 <.L133>: + 742: c282 sw zero,68(sp) + 744: c082 sw zero,64(sp) + 746: de02 sw zero,60(sp) + 748: 4705 li a4,1 + 74a: a8e1 j 822 <.L144> + +0000074c <.L121>: + 74c: 4612 lw a2,4(sp) + 74e: 66a1 lui a3,0x8 + +00000750 <.LVL233>: + 750: 16fd add a3,a3,-1 # 7fff <.LLST158+0x5687> + 752: ccd60be3 beq a2,a3,428 <.L268> + 756: 4696 lw a3,68(sp) + 758: 00080637 lui a2,0x80 + 75c: 8ed1 or a3,a3,a2 + 75e: c2b6 sw a3,68(sp) + +00000760 <.LDL5>: + 760: 07400693 li a3,116 + 764: fca6cfe3 blt a3,a0,742 <.L133> + 768: 85aa mv a1,a0 + +0000076a <.L264>: + 76a: 4055d513 sra a0,a1,0x5 + +0000076e <.LVL235>: + 76e: 863a mv a2,a4 + 770: 89fd and a1,a1,31 + +00000772 <.LVL236>: + 772: 4481 li s1,0 + 774: 4681 li a3,0 + +00000776 <.L134>: + 776: 02a69463 bne a3,a0,79e <.L135> + 77a: 468d li a3,3 + +0000077c <.LVL238>: + 77c: 8e89 sub a3,a3,a0 + 77e: 00251613 sll a2,a0,0x2 + 782: e58d bnez a1,7ac <.L136> + +00000784 <.L137>: + 784: 00c70333 add t1,a4,a2 + 788: 00032303 lw t1,0(t1) + 78c: 0585 add a1,a1,1 + +0000078e <.LVL240>: + 78e: 00672023 sw t1,0(a4) + +00000792 <.LVL241>: + 792: 0711 add a4,a4,4 + 794: feb6d8e3 bge a3,a1,784 <.L137> + 798: 4711 li a4,4 + 79a: 8f09 sub a4,a4,a0 + 79c: a899 j 7f2 <.L141> + +0000079e <.L135>: + 79e: 00062303 lw t1,0(a2) # 80000 <.LLST158+0x7d688> + 7a2: 0685 add a3,a3,1 + +000007a4 <.LVL243>: + 7a4: 0611 add a2,a2,4 + 7a6: 0064e4b3 or s1,s1,t1 + +000007aa <.LVL244>: + 7aa: b7f1 j 776 <.L134> + +000007ac <.L136>: + 7ac: 02000313 li t1,32 + 7b0: 40b30433 sub s0,t1,a1 + 7b4: ca22 sw s0,20(sp) + +000007b6 <.LVL246>: + 7b6: 02810313 add t1,sp,40 + 7ba: 04c60413 add s0,a2,76 + 7be: 9322 add t1,t1,s0 + 7c0: fc432303 lw t1,-60(t1) + 7c4: 4452 lw s0,20(sp) + 7c6: c802 sw zero,16(sp) + +000007c8 <.LVL247>: + 7c8: 00831333 sll t1,t1,s0 + 7cc: 1820 add s0,sp,56 + 7ce: 0064e4b3 or s1,s1,t1 + +000007d2 <.LVL248>: + 7d2: 9622 add a2,a2,s0 + +000007d4 <.L139>: + 7d4: 4442 lw s0,16(sp) + 7d6: 0ad44c63 blt s0,a3,88e <.L140> + 7da: 068a sll a3,a3,0x2 + 7dc: 1030 add a2,sp,40 + 7de: 04c68693 add a3,a3,76 + 7e2: 96b2 add a3,a3,a2 + 7e4: 4616 lw a2,68(sp) + 7e6: 4711 li a4,4 + 7e8: 8f09 sub a4,a4,a0 + +000007ea <.LVL250>: + 7ea: 00b65633 srl a2,a2,a1 + 7ee: fcc6a223 sw a2,-60(a3) + +000007f2 <.L141>: + 7f2: 4691 li a3,4 + 7f4: 8e99 sub a3,a3,a4 + 7f6: 1830 add a2,sp,56 + 7f8: 070a sll a4,a4,0x2 + 7fa: 9732 add a4,a4,a2 + 7fc: 068a sll a3,a3,0x2 + 7fe: 4621 li a2,8 + 800: 00c6e863 bltu a3,a2,810 <.L142> + 804: 00072023 sw zero,0(a4) + +00000808 <.LVL252>: + 808: 00072223 sw zero,4(a4) + 80c: 16e1 add a3,a3,-8 + 80e: 0721 add a4,a4,8 + +00000810 <.L142>: + 810: 4611 li a2,4 + 812: 00c6e463 bltu a3,a2,81a <.L143> + 816: 00072023 sw zero,0(a4) + +0000081a <.L143>: + 81a: 56e2 lw a3,56(sp) + +0000081c <.LBB75>: + 81c: 00903733 snez a4,s1 + +00000820 <.LBE75>: + 820: 8f55 or a4,a4,a3 + +00000822 <.L144>: + 822: 5572 lw a0,60(sp) + +00000824 <.LBB78>: + 824: dc3a sw a4,56(sp) + +00000826 <.LBB79>: + 826: 40e78733 sub a4,a5,a4 + +0000082a <.LVL256>: + 82a: 40a28633 sub a2,t0,a0 + 82e: 00e7b6b3 sltu a3,a5,a4 + 832: 00c2b433 sltu s0,t0,a2 + +00000836 <.LVL257>: + 836: 8e15 sub a2,a2,a3 + +00000838 <.LVL258>: + 838: 4686 lw a3,64(sp) + 83a: 84a2 mv s1,s0 + +0000083c <.LVL259>: + 83c: 40d385b3 sub a1,t2,a3 + 840: 00d3b333 sltu t1,t2,a3 + 844: 00e7f663 bgeu a5,a4,850 <.L149> + 848: fff58793 add a5,a1,-1 + 84c: 00550663 beq a0,t0,858 <.L150> + +00000850 <.L149>: + 850: 409587b3 sub a5,a1,s1 + +00000854 <.LVL261>: + 854: 4581 li a1,0 + 856: c409 beqz s0,860 <.L151> + +00000858 <.L150>: + 858: 407686b3 sub a3,a3,t2 + 85c: 0016b593 seqz a1,a3 + +00000860 <.L151>: + 860: 4502 lw a0,0(sp) + 862: 4696 lw a3,68(sp) + 864: 0065e5b3 or a1,a1,t1 + +00000868 <.LVL264>: + 868: 40d506b3 sub a3,a0,a3 + +0000086c <.LBB160>: + 86c: 4512 lw a0,4(sp) + +0000086e <.LBB161>: + 86e: 8e8d sub a3,a3,a1 + +00000870 <.L131>: + 870: c8be sw a5,80(sp) + +00000872 <.LBE81>: + 872: 000807b7 lui a5,0x80 + +00000876 <.LBB82>: + 876: c4ba sw a4,72(sp) + +00000878 <.LBB83>: + 878: cab6 sw a3,84(sp) + 87a: c6b2 sw a2,76(sp) + +0000087c <.LBE83>: + 87c: 00f6f733 and a4,a3,a5 + 880: 8c070de3 beqz a4,15a <.L8> + +00000884 <.LBB84>: + 884: 17fd add a5,a5,-1 # 7ffff <.LLST158+0x7d687> + 886: 8efd and a3,a3,a5 + 888: cab6 sw a3,84(sp) + 88a: c22a sw a0,4(sp) + 88c: a179 j d1a <.L227> + +0000088e <.L140>: + 88e: 00062303 lw t1,0(a2) + 892: 0611 add a2,a2,4 + 894: 00b35433 srl s0,t1,a1 + +00000898 <.LVL268>: + 898: ce22 sw s0,28(sp) + 89a: 00062303 lw t1,0(a2) + 89e: 4452 lw s0,20(sp) + 8a0: 00831333 sll t1,t1,s0 + 8a4: 841a mv s0,t1 + 8a6: 4372 lw t1,28(sp) + 8a8: 00836333 or t1,t1,s0 + 8ac: 4442 lw s0,16(sp) + 8ae: 00672023 sw t1,0(a4) + +000008b2 <.LVL269>: + 8b2: 0711 add a4,a4,4 + 8b4: 0405 add s0,s0,1 + 8b6: c822 sw s0,16(sp) + +000008b8 <.LVL270>: + 8b8: bf31 j 7d4 <.L139> + +000008ba <.L120>: + 8ba: 4716 lw a4,68(sp) + 8bc: 5472 lw s0,60(sp) + 8be: 4386 lw t2,64(sp) + 8c0: c03a sw a4,0(sp) + +000008c2 <.LBB163>: + 8c2: 20050363 beqz a0,ac8 <.L152> + 8c6: 4742 lw a4,16(sp) + 8c8: 4692 lw a3,4(sp) + 8ca: 40d70533 sub a0,a4,a3 + +000008ce <.LVL272>: + 8ce: e6c9 bnez a3,958 <.L153> + 8d0: 52b2 lw t0,44(sp) + 8d2: 5342 lw t1,48(sp) + 8d4: 56d2 lw a3,52(sp) + 8d6: 0062e733 or a4,t0,t1 + +000008da <.LVL273>: + 8da: 8f55 or a4,a4,a3 + 8dc: 8f5d or a4,a4,a5 + 8de: eb09 bnez a4,8f0 <.L154> + +000008e0 <.LVL274>: + 8e0: 4782 lw a5,0(sp) + 8e2: c4a6 sw s1,72(sp) + 8e4: c6a2 sw s0,76(sp) + 8e6: c89e sw t2,80(sp) + 8e8: cabe sw a5,84(sp) + +000008ea <.L359>: + 8ea: 47d2 lw a5,20(sp) + 8ec: c63e sw a5,12(sp) + +000008ee <.LVL276>: + 8ee: b0b5 j 15a <.L8> + +000008f0 <.L154>: + 8f0: fff50593 add a1,a0,-1 + +000008f4 <.LVL278>: + 8f4: e5b1 bnez a1,940 <.L155> + +000008f6 <.LBB86>: + 8f6: 40540633 sub a2,s0,t0 + 8fa: 40f48733 sub a4,s1,a5 + +000008fe <.LVL280>: + 8fe: 00c437b3 sltu a5,s0,a2 + 902: c23e sw a5,4(sp) + +00000904 <.LVL281>: + 904: c63e sw a5,12(sp) + +00000906 <.LVL282>: + 906: 00e4b7b3 sltu a5,s1,a4 + +0000090a <.LVL283>: + 90a: 8e1d sub a2,a2,a5 + +0000090c <.LVL284>: + 90c: 0063b533 sltu a0,t2,t1 + 910: 406387b3 sub a5,t2,t1 + 914: 00e4fa63 bgeu s1,a4,928 <.L160> + 918: 00829863 bne t0,s0,928 <.L160> + +0000091c <.LVL285>: + 91c: 17fd add a5,a5,-1 + +0000091e <.L161>: + 91e: 40730333 sub t1,t1,t2 + 922: 00133593 seqz a1,t1 + +00000926 <.LVL287>: + 926: a029 j 930 <.L162> + +00000928 <.L160>: + 928: 4432 lw s0,12(sp) + 92a: 8f81 sub a5,a5,s0 + +0000092c <.LVL289>: + 92c: 4412 lw s0,4(sp) + 92e: f865 bnez s0,91e <.L161> + +00000930 <.L162>: + 930: 4402 lw s0,0(sp) + 932: 8d4d or a0,a0,a1 + +00000934 <.LBE86>: + 934: 45d2 lw a1,20(sp) + +00000936 <.LBB87>: + 936: 40d406b3 sub a3,s0,a3 + 93a: 8e89 sub a3,a3,a0 + +0000093c <.LBE87>: + 93c: c62e sw a1,12(sp) + 93e: bbc5 j 72e <.L353> + +00000940 <.L155>: + 940: 67a1 lui a5,0x8 + 942: 17fd add a5,a5,-1 # 7fff <.LLST158+0x5687> + 944: 60f51663 bne a0,a5,f50 <.L163> + +00000948 <.L164>: + 948: 4782 lw a5,0(sp) + 94a: c4a6 sw s1,72(sp) + 94c: c6a2 sw s0,76(sp) + 94e: cabe sw a5,84(sp) + 950: 47d2 lw a5,20(sp) + 952: c89e sw t2,80(sp) + 954: c63e sw a5,12(sp) + +00000956 <.LVL294>: + 956: bbb9 j 6b4 <.L358> + +00000958 <.L153>: + 958: 4742 lw a4,16(sp) + +0000095a <.LVL296>: + 95a: 67a1 lui a5,0x8 + 95c: 17fd add a5,a5,-1 # 7fff <.LLST158+0x5687> + 95e: fef705e3 beq a4,a5,948 <.L164> + 962: 57d2 lw a5,52(sp) + 964: 00080737 lui a4,0x80 + 968: 8fd9 or a5,a5,a4 + 96a: da3e sw a5,52(sp) + +0000096c <.LDL6>: + 96c: 07400793 li a5,116 + 970: 5ea7c463 blt a5,a0,f58 <.L165> + 974: 85aa mv a1,a0 + +00000976 <.L265>: + 976: 41f5d793 sra a5,a1,0x1f + 97a: 8bfd and a5,a5,31 + 97c: 97ae add a5,a5,a1 + 97e: 8795 sra a5,a5,0x5 + +00000980 <.LVL298>: + 980: 86b2 mv a3,a2 + 982: 4281 li t0,0 + 984: 4701 li a4,0 + +00000986 <.L166>: + 986: 02f74563 blt a4,a5,9b0 <.L167> + 98a: 468d li a3,3 + 98c: 01f5f713 and a4,a1,31 + +00000990 <.LVL300>: + 990: 40f680b3 sub ra,a3,a5 + 994: e705 bnez a4,9bc <.L168> + 996: 00279593 sll a1,a5,0x2 + +0000099a <.L169>: + 99a: 00b606b3 add a3,a2,a1 + 99e: 4294 lw a3,0(a3) + 9a0: 0705 add a4,a4,1 # 80001 <.LLST158+0x7d689> + +000009a2 <.LVL302>: + 9a2: c214 sw a3,0(a2) + +000009a4 <.LVL303>: + 9a4: 0611 add a2,a2,4 + 9a6: fee0dae3 bge ra,a4,99a <.L169> + 9aa: 4511 li a0,4 + 9ac: 8d1d sub a0,a0,a5 + 9ae: a89d j a24 <.L175> + +000009b0 <.L167>: + 9b0: 4288 lw a0,0(a3) + 9b2: 0705 add a4,a4,1 + +000009b4 <.LVL305>: + 9b4: 0691 add a3,a3,4 + 9b6: 00a2e2b3 or t0,t0,a0 + +000009ba <.LVL306>: + 9ba: b7f1 j 986 <.L166> + +000009bc <.L168>: + 9bc: 800006b7 lui a3,0x80000 + 9c0: 06fd add a3,a3,31 # 8000001f <.LLST158+0x7fffd6a7> + 9c2: 8eed and a3,a3,a1 + 9c4: 0006d663 bgez a3,9d0 <.L171> + 9c8: 16fd add a3,a3,-1 + 9ca: fe06e693 or a3,a3,-32 + 9ce: 0685 add a3,a3,1 + +000009d0 <.L171>: + 9d0: 02000513 li a0,32 + 9d4: 40d506b3 sub a3,a0,a3 + 9d8: c236 sw a3,4(sp) + +000009da <.LVL308>: + 9da: 86be mv a3,a5 + 9dc: 0007d363 bgez a5,9e2 <.L172> + +000009e0 <.LVL309>: + 9e0: 4681 li a3,0 + +000009e2 <.L172>: + 9e2: 068a sll a3,a3,0x2 + 9e4: 102c add a1,sp,40 + +000009e6 <.LVL311>: + 9e6: 04c68693 add a3,a3,76 + 9ea: 96ae add a3,a3,a1 + 9ec: fb46a683 lw a3,-76(a3) + 9f0: 4592 lw a1,4(sp) + 9f2: 4301 li t1,0 + 9f4: 00b696b3 sll a3,a3,a1 + 9f8: 00d2e2b3 or t0,t0,a3 + +000009fc <.LVL312>: + 9fc: 00279693 sll a3,a5,0x2 + a00: 02868693 add a3,a3,40 + a04: 968a add a3,a3,sp + +00000a06 <.L173>: + a06: 08134363 blt t1,ra,a8c <.L174> + a0a: 4511 li a0,4 + a0c: 8d1d sub a0,a0,a5 + +00000a0e <.LVL314>: + a0e: 00209793 sll a5,ra,0x2 + +00000a12 <.LVL315>: + a12: 04c78793 add a5,a5,76 + a16: 1034 add a3,sp,40 + a18: 96be add a3,a3,a5 + a1a: 57d2 lw a5,52(sp) + a1c: 00e7d7b3 srl a5,a5,a4 + a20: faf6aa23 sw a5,-76(a3) + +00000a24 <.L175>: + a24: 4791 li a5,4 + a26: 4601 li a2,0 + a28: 00a7c563 blt a5,a0,a32 <.L177> + a2c: 8f89 sub a5,a5,a0 + a2e: 00279613 sll a2,a5,0x2 + +00000a32 <.L177>: + a32: 050a sll a0,a0,0x2 + a34: 02850793 add a5,a0,40 + a38: 00278533 add a0,a5,sp + a3c: 4581 li a1,0 + a3e: c61e sw t2,12(sp) + a40: c216 sw t0,4(sp) + a42: 00000097 auipc ra,0x0 + a46: 000080e7 jalr ra # a42 <.L177+0x10> + +00000a4a <.LBB90>: + a4a: 4292 lw t0,4(sp) + +00000a4c <.LBE90>: + a4c: 57a2 lw a5,40(sp) + +00000a4e <.LBE88>: + a4e: 43b2 lw t2,12(sp) + +00000a50 <.LBB91>: + a50: 00503733 snez a4,t0 + +00000a54 <.LBE91>: + a54: 8f5d or a4,a4,a5 + +00000a56 <.L178>: + a56: 55b2 lw a1,44(sp) + a58: 56c2 lw a3,48(sp) + +00000a5a <.LBB95>: + a5a: d43a sw a4,40(sp) + +00000a5c <.LBB96>: + a5c: 40b40633 sub a2,s0,a1 + a60: 40e48733 sub a4,s1,a4 + +00000a64 <.LVL320>: + a64: 00c43333 sltu t1,s0,a2 + +00000a68 <.LVL321>: + a68: 00e4b7b3 sltu a5,s1,a4 + a6c: 8e1d sub a2,a2,a5 + +00000a6e <.LVL322>: + a6e: 829a mv t0,t1 + +00000a70 <.LVL323>: + a70: 40d387b3 sub a5,t2,a3 + a74: 00d3b533 sltu a0,t2,a3 + a78: 02e4f963 bgeu s1,a4,aaa <.L183> + a7c: 02859763 bne a1,s0,aaa <.L183> + +00000a80 <.LVL324>: + a80: 17fd add a5,a5,-1 + +00000a82 <.L184>: + a82: 407686b3 sub a3,a3,t2 + a86: 0016b593 seqz a1,a3 + a8a: a02d j ab4 <.L185> + +00000a8c <.L174>: + a8c: 428c lw a1,0(a3) + a8e: 4512 lw a0,4(sp) + a90: 0305 add t1,t1,1 + +00000a92 <.LVL327>: + a92: 00e5d5b3 srl a1,a1,a4 + a96: c62e sw a1,12(sp) + a98: 42cc lw a1,4(a3) + a9a: 0691 add a3,a3,4 + a9c: 00a595b3 sll a1,a1,a0 + aa0: 4532 lw a0,12(sp) + aa2: 8dc9 or a1,a1,a0 + aa4: c20c sw a1,0(a2) + +00000aa6 <.LVL328>: + aa6: 0611 add a2,a2,4 + aa8: bfb9 j a06 <.L173> + +00000aaa <.L183>: + aaa: 405787b3 sub a5,a5,t0 + +00000aae <.LVL330>: + aae: 4581 li a1,0 + ab0: fc0319e3 bnez t1,a82 <.L184> + +00000ab4 <.L185>: + ab4: 56d2 lw a3,52(sp) + ab6: 4402 lw s0,0(sp) + ab8: 8dc9 or a1,a1,a0 + +00000aba <.LBB166>: + aba: 4542 lw a0,16(sp) + +00000abc <.LBB167>: + abc: 40d406b3 sub a3,s0,a3 + ac0: 8e8d sub a3,a3,a1 + +00000ac2 <.LBE99>: + ac2: 45d2 lw a1,20(sp) + +00000ac4 <.LVL333>: + ac4: c62e sw a1,12(sp) + ac6: b36d j 870 <.L131> + +00000ac8 <.L152>: + ac8: 5652 lw a2,52(sp) + +00000aca <.LBB169>: + aca: 6321 lui t1,0x8 + acc: ffe30593 add a1,t1,-2 # 7ffe <.LLST158+0x5686> + +00000ad0 <.LBB170>: + ad0: c832 sw a2,16(sp) + +00000ad2 <.LBB171>: + ad2: 4612 lw a2,4(sp) + +00000ad4 <.LBB172>: + ad4: 56b2 lw a3,44(sp) + ad6: 5742 lw a4,48(sp) + +00000ad8 <.LBB173>: + ad8: 0605 add a2,a2,1 + ada: 8e6d and a2,a2,a1 + adc: 16061d63 bnez a2,c56 <.L186> + ae0: 4642 lw a2,16(sp) + ae2: 4282 lw t0,0(sp) + ae4: 00e6e5b3 or a1,a3,a4 + ae8: 8dd1 or a1,a1,a2 + aea: 00746633 or a2,s0,t2 + aee: 00566633 or a2,a2,t0 + af2: 4292 lw t0,4(sp) + af4: 8ddd or a1,a1,a5 + af6: 8e45 or a2,a2,s1 + af8: 0e029b63 bnez t0,bee <.L187> + +00000afc <.LVL336>: + afc: e989 bnez a1,b0e <.L188> + afe: 4782 lw a5,0(sp) + b00: c4a6 sw s1,72(sp) + b02: c6a2 sw s0,76(sp) + b04: c89e sw t2,80(sp) + b06: cabe sw a5,84(sp) + b08: c265 beqz a2,be8 <.L357> + +00000b0a <.L206>: + b0a: 4501 li a0,0 + b0c: bbf9 j 8ea <.L359> + +00000b0e <.L188>: + b0e: e611 bnez a2,b1a <.L190> + b10: c4be sw a5,72(sp) + b12: c6b6 sw a3,76(sp) + b14: 47c2 lw a5,16(sp) + b16: c8ba sw a4,80(sp) + b18: bc59 j 5ae <.L350> + +00000b1a <.L190>: + b1a: 40978633 sub a2,a5,s1 + +00000b1e <.LVL339>: + b1e: 40868333 sub t1,a3,s0 + b22: 00c7b2b3 sltu t0,a5,a2 + b26: 0066b5b3 sltu a1,a3,t1 + b2a: 40530333 sub t1,t1,t0 + b2e: c21a sw t1,4(sp) + +00000b30 <.LVL340>: + b30: 00773333 sltu t1,a4,t2 + b34: d02e sw a1,32(sp) + +00000b36 <.LVL341>: + b36: ce1a sw t1,28(sp) + b38: 407702b3 sub t0,a4,t2 + b3c: 00c7fa63 bgeu a5,a2,b50 <.L195> + b40: 00869863 bne a3,s0,b50 <.L195> + +00000b44 <.LVL342>: + b44: fff28593 add a1,t0,-1 + +00000b48 <.L196>: + b48: 0012b313 seqz t1,t0 + b4c: ce1a sw t1,28(sp) + b4e: a039 j b5c <.L197> + +00000b50 <.L195>: + b50: 5302 lw t1,32(sp) + b52: ce02 sw zero,28(sp) + b54: 40b285b3 sub a1,t0,a1 + +00000b58 <.LVL345>: + b58: fe0318e3 bnez t1,b48 <.L196> + +00000b5c <.L197>: + b5c: 4282 lw t0,0(sp) + b5e: 4342 lw t1,16(sp) + b60: c8ae sw a1,80(sp) + b62: c4b2 sw a2,72(sp) + b64: 40530333 sub t1,t1,t0 + b68: 42f2 lw t0,28(sp) + b6a: d01a sw t1,32(sp) + b6c: 00773333 sltu t1,a4,t2 + b70: 0062e333 or t1,t0,t1 + b74: 5282 lw t0,32(sp) + b76: 406282b3 sub t0,t0,t1 + b7a: 4312 lw t1,4(sp) + b7c: ca96 sw t0,84(sp) + b7e: c69a sw t1,76(sp) + +00000b80 <.LBE100>: + b80: 00080337 lui t1,0x80 + b84: 0062f333 and t1,t0,t1 + b88: 04030963 beqz t1,bda <.L198> + +00000b8c <.LBB101>: + b8c: 40d40633 sub a2,s0,a3 + +00000b90 <.LVL348>: + b90: 40f487b3 sub a5,s1,a5 + +00000b94 <.LVL349>: + b94: 00c43333 sltu t1,s0,a2 + +00000b98 <.LVL350>: + b98: 00f4b5b3 sltu a1,s1,a5 + +00000b9c <.LVL351>: + b9c: 8e0d sub a2,a2,a1 + +00000b9e <.LVL352>: + b9e: 829a mv t0,t1 + +00000ba0 <.LVL353>: + ba0: 40e385b3 sub a1,t2,a4 + ba4: 00e3b533 sltu a0,t2,a4 + ba8: 00f4fa63 bgeu s1,a5,bbc <.L203> + bac: 00869863 bne a3,s0,bbc <.L203> + +00000bb0 <.LVL354>: + bb0: 15fd add a1,a1,-1 + +00000bb2 <.L204>: + bb2: 407706b3 sub a3,a4,t2 + bb6: 0016b693 seqz a3,a3 + bba: a031 j bc6 <.L205> + +00000bbc <.L203>: + bbc: 405585b3 sub a1,a1,t0 + +00000bc0 <.LVL357>: + bc0: 4681 li a3,0 + bc2: fe0318e3 bnez t1,bb2 <.L204> + +00000bc6 <.L205>: + bc6: 4702 lw a4,0(sp) + bc8: 4442 lw s0,16(sp) + bca: 8ec9 or a3,a3,a0 + +00000bcc <.LVL359>: + bcc: c8ae sw a1,80(sp) + +00000bce <.LVL360>: + bce: 8f01 sub a4,a4,s0 + bd0: 8f15 sub a4,a4,a3 + bd2: caba sw a4,84(sp) + bd4: c6b2 sw a2,76(sp) + bd6: c4be sw a5,72(sp) + +00000bd8 <.LBB174>: + bd8: bf0d j b0a <.L206> + +00000bda <.L198>: + bda: 4792 lw a5,4(sp) + bdc: 8e5d or a2,a2,a5 + +00000bde <.LVL363>: + bde: 8e4d or a2,a2,a1 + be0: 00566633 or a2,a2,t0 + be4: 9c0616e3 bnez a2,5b0 <.L354> + +00000be8 <.L357>: + be8: c602 sw zero,12(sp) + +00000bea <.LVL365>: + bea: d70ff06f j 15a <.L8> + +00000bee <.L187>: + bee: ed8d bnez a1,c28 <.L207> + bf0: e20d bnez a2,c12 <.L208> + +00000bf2 <.LVL367>: + bf2: ca9a sw t1,84(sp) + bf4: c882 sw zero,80(sp) + bf6: c682 sw zero,76(sp) + bf8: c482 sw zero,72(sp) + +00000bfa <.LBB102>: + bfa: 00bc add a5,sp,72 + bfc: 1870 add a2,sp,60 + +00000bfe <.L209>: + bfe: 47d8 lw a4,12(a5) + c00: 4794 lw a3,8(a5) + c02: 17f1 add a5,a5,-4 + c04: 070e sll a4,a4,0x3 + c06: 82f5 srl a3,a3,0x1d + c08: 8f55 or a4,a4,a3 + c0a: cb98 sw a4,16(a5) + c0c: fef619e3 bne a2,a5,bfe <.L209> + c10: bc25 j 648 <.L352> + +00000c12 <.L208>: + c12: 4782 lw a5,0(sp) + c14: c4a6 sw s1,72(sp) + c16: c6a2 sw s0,76(sp) + c18: cabe sw a5,84(sp) + +00000c1a <.LBB176>: + c1a: 47d2 lw a5,20(sp) + c1c: c89e sw t2,80(sp) + c1e: c63e sw a5,12(sp) + +00000c20 <.L360>: + c20: fff30513 add a0,t1,-1 # 7ffff <.LLST158+0x7d687> + c24: d36ff06f j 15a <.L8> + +00000c28 <.L207>: + c28: e619 bnez a2,c36 <.L210> + +00000c2a <.LVL373>: + c2a: c4be sw a5,72(sp) + c2c: 47c2 lw a5,16(sp) + c2e: c6b6 sw a3,76(sp) + c30: c8ba sw a4,80(sp) + c32: cabe sw a5,84(sp) + c34: b7f5 j c20 <.L360> + +00000c36 <.L210>: + c36: ca9a sw t1,84(sp) + c38: c882 sw zero,80(sp) + c3a: c682 sw zero,76(sp) + c3c: c482 sw zero,72(sp) + +00000c3e <.LBB103>: + c3e: 00bc add a5,sp,72 + c40: 1870 add a2,sp,60 + +00000c42 <.L211>: + c42: 47d8 lw a4,12(a5) + c44: 4794 lw a3,8(a5) + c46: 17f1 add a5,a5,-4 + c48: 070e sll a4,a4,0x3 + c4a: 82f5 srl a3,a3,0x1d + c4c: 8f55 or a4,a4,a3 + c4e: cb98 sw a4,16(a5) + c50: fef619e3 bne a2,a5,c42 <.L211> + c54: bad5 j 648 <.L352> + +00000c56 <.L186>: + c56: 40978633 sub a2,a5,s1 + +00000c5a <.LVL378>: + c5a: 40868333 sub t1,a3,s0 + c5e: 00c7b2b3 sltu t0,a5,a2 + c62: 0066b5b3 sltu a1,a3,t1 + c66: 40530333 sub t1,t1,t0 + c6a: ce1a sw t1,28(sp) + c6c: 00773333 sltu t1,a4,t2 + c70: d22e sw a1,36(sp) + +00000c72 <.LVL379>: + c72: d01a sw t1,32(sp) + c74: 407702b3 sub t0,a4,t2 + c78: 00c7fa63 bgeu a5,a2,c8c <.L216> + c7c: 00869863 bne a3,s0,c8c <.L216> + +00000c80 <.LVL380>: + c80: fff28593 add a1,t0,-1 + +00000c84 <.L217>: + c84: 0012b313 seqz t1,t0 + c88: d01a sw t1,32(sp) + c8a: a039 j c98 <.L218> + +00000c8c <.L216>: + c8c: 5312 lw t1,36(sp) + c8e: d002 sw zero,32(sp) + c90: 40b285b3 sub a1,t0,a1 + +00000c94 <.LVL383>: + c94: fe0318e3 bnez t1,c84 <.L217> + +00000c98 <.L218>: + c98: 4282 lw t0,0(sp) + c9a: 4342 lw t1,16(sp) + c9c: c8ae sw a1,80(sp) + c9e: c4b2 sw a2,72(sp) + ca0: 40530333 sub t1,t1,t0 + ca4: 5282 lw t0,32(sp) + ca6: d21a sw t1,36(sp) + ca8: 00773333 sltu t1,a4,t2 + cac: 0062e333 or t1,t0,t1 + cb0: 5292 lw t0,36(sp) + cb2: 406282b3 sub t0,t0,t1 + cb6: 4372 lw t1,28(sp) + cb8: ca96 sw t0,84(sp) + cba: c69a sw t1,76(sp) + +00000cbc <.LBE104>: + cbc: 00080337 lui t1,0x80 + cc0: 0062f333 and t1,t0,t1 + cc4: 12030463 beqz t1,dec <.L219> + +00000cc8 <.LBB105>: + cc8: 40d40633 sub a2,s0,a3 + +00000ccc <.LVL386>: + ccc: 40f487b3 sub a5,s1,a5 + +00000cd0 <.LVL387>: + cd0: 00c432b3 sltu t0,s0,a2 + +00000cd4 <.LVL388>: + cd4: 00f4b5b3 sltu a1,s1,a5 + +00000cd8 <.LVL389>: + cd8: 8e0d sub a2,a2,a1 + +00000cda <.LVL390>: + cda: 8096 mv ra,t0 + +00000cdc <.LVL391>: + cdc: 40e385b3 sub a1,t2,a4 + ce0: 00e3b333 sltu t1,t2,a4 + ce4: 00f4fa63 bgeu s1,a5,cf8 <.L224> + ce8: 00869863 bne a3,s0,cf8 <.L224> + +00000cec <.LVL392>: + cec: 15fd add a1,a1,-1 + +00000cee <.L225>: + cee: 40770733 sub a4,a4,t2 + cf2: 00173513 seqz a0,a4 + cf6: a029 j d00 <.L226> + +00000cf8 <.L224>: + cf8: 401585b3 sub a1,a1,ra + +00000cfc <.LVL395>: + cfc: fe0299e3 bnez t0,cee <.L225> + +00000d00 <.L226>: + d00: 4702 lw a4,0(sp) + d02: 46c2 lw a3,16(sp) + d04: c4be sw a5,72(sp) + +00000d06 <.LBE105>: + d06: 47d2 lw a5,20(sp) + +00000d08 <.LBB106>: + d08: 8f15 sub a4,a4,a3 + d0a: 00656333 or t1,a0,t1 + +00000d0e <.LVL399>: + d0e: 40670333 sub t1,a4,t1 + +00000d12 <.LVL400>: + d12: ca9a sw t1,84(sp) + d14: c8ae sw a1,80(sp) + +00000d16 <.LVL401>: + d16: c6b2 sw a2,76(sp) + +00000d18 <.LBE106>: + d18: c63e sw a5,12(sp) + +00000d1a <.L227>: + d1a: 4556 lw a0,84(sp) + d1c: c165 beqz a0,dfc <.L228> + d1e: 00000097 auipc ra,0x0 + d22: 000080e7 jalr ra # d1e <.L227+0x4> + +00000d26 <.L229>: + d26: 1551 add a0,a0,-12 + +00000d28 <.LBB60>: + d28: 41f55793 sra a5,a0,0x1f + d2c: 8bfd and a5,a5,31 + d2e: 97aa add a5,a5,a0 + d30: 8795 sra a5,a5,0x5 + +00000d32 <.LVL406>: + d32: 01f57593 and a1,a0,31 + d36: 40f00733 neg a4,a5 + d3a: c9fd beqz a1,e30 <.L232> + d3c: 800006b7 lui a3,0x80000 + d40: 06fd add a3,a3,31 # 8000001f <.LLST158+0x7fffd6a7> + d42: 8ee9 and a3,a3,a0 + d44: 0006d663 bgez a3,d50 <.L233> + d48: 16fd add a3,a3,-1 + d4a: fe06e693 or a3,a3,-32 + d4e: 0685 add a3,a3,1 + +00000d50 <.L233>: + d50: 070a sll a4,a4,0x2 + d52: 02000313 li t1,32 + d56: 40d30333 sub t1,t1,a3 + d5a: 04810393 add t2,sp,72 + d5e: 00c70693 add a3,a4,12 + d62: 969e add a3,a3,t2 + d64: 40e00733 neg a4,a4 + +00000d68 <.L234>: + d68: 0ed39263 bne t2,a3,e4c <.L237> + d6c: fff78713 add a4,a5,-1 + +00000d70 <.LVL407>: + d70: 078a sll a5,a5,0x2 + +00000d72 <.LVL408>: + d72: 1034 add a3,sp,40 + d74: 04c78793 add a5,a5,76 + d78: 97b6 add a5,a5,a3 + d7a: 46a6 lw a3,72(sp) + d7c: 00b696b3 sll a3,a3,a1 + d80: fcd7aa23 sw a3,-44(a5) + +00000d84 <.L238>: + d84: 0705 add a4,a4,1 + d86: 00b4 add a3,sp,72 + d88: 070a sll a4,a4,0x2 + d8a: 4621 li a2,8 + d8c: 87b6 mv a5,a3 + d8e: 00c76863 bltu a4,a2,d9e <.L239> + d92: 0006a023 sw zero,0(a3) + d96: 0006a223 sw zero,4(a3) + d9a: 1761 add a4,a4,-8 + d9c: 0894 add a3,sp,80 + +00000d9e <.L239>: + d9e: 4611 li a2,4 + da0: 00c76463 bltu a4,a2,da8 <.L240> + da4: 0006a023 sw zero,0(a3) + +00000da8 <.L240>: + da8: 4712 lw a4,4(sp) + daa: 14e54f63 blt a0,a4,f08 <.L241> + dae: 8d19 sub a0,a0,a4 + +00000db0 <.LVL410>: + db0: 0505 add a0,a0,1 + +00000db2 <.LBB61>: + db2: 40555313 sra t1,a0,0x5 + +00000db6 <.LVL412>: + db6: 85be mv a1,a5 + db8: 897d and a0,a0,31 + +00000dba <.LVL413>: + dba: 86be mv a3,a5 + dbc: 4601 li a2,0 + dbe: 4701 li a4,0 + +00000dc0 <.L242>: + dc0: 0a671463 bne a4,t1,e68 <.L243> + dc4: 470d li a4,3 + +00000dc6 <.LVL415>: + dc6: 40670733 sub a4,a4,t1 + dca: 00231693 sll a3,t1,0x2 + dce: e545 bnez a0,e76 <.L244> + +00000dd0 <.L245>: + dd0: 00d582b3 add t0,a1,a3 + dd4: 0002a283 lw t0,0(t0) + dd8: 0505 add a0,a0,1 + +00000dda <.LVL417>: + dda: 0055a023 sw t0,0(a1) + +00000dde <.LVL418>: + dde: 0591 add a1,a1,4 + de0: fea758e3 bge a4,a0,dd0 <.L245> + de4: 4691 li a3,4 + de6: 406686b3 sub a3,a3,t1 + dea: a0f1 j eb6 <.L249> + +00000dec <.L219>: + dec: 47f2 lw a5,28(sp) + dee: 8e5d or a2,a2,a5 + +00000df0 <.LVL420>: + df0: 8e4d or a2,a2,a1 + df2: 00566633 or a2,a2,t0 + df6: de0609e3 beqz a2,be8 <.L357> + dfa: b705 j d1a <.L227> + +00000dfc <.L228>: + dfc: 4546 lw a0,80(sp) + dfe: c901 beqz a0,e0e <.L230> + e00: 00000097 auipc ra,0x0 + e04: 000080e7 jalr ra # e00 <.L228+0x4> + +00000e08 <.LVL422>: + e08: 02050513 add a0,a0,32 + e0c: bf29 j d26 <.L229> + +00000e0e <.L230>: + e0e: 4536 lw a0,76(sp) + e10: c901 beqz a0,e20 <.L231> + e12: 00000097 auipc ra,0x0 + e16: 000080e7 jalr ra # e12 <.L230+0x4> + +00000e1a <.LVL425>: + e1a: 04050513 add a0,a0,64 + e1e: b721 j d26 <.L229> + +00000e20 <.L231>: + e20: 4526 lw a0,72(sp) + e22: 00000097 auipc ra,0x0 + e26: 000080e7 jalr ra # e22 <.L231+0x2> + +00000e2a <.LVL428>: + e2a: 06050513 add a0,a0,96 + e2e: bde5 j d26 <.L229> + +00000e30 <.L232>: + e30: 08d4 add a3,sp,84 + e32: 070a sll a4,a4,0x2 + +00000e34 <.LBB66>: + e34: 460d li a2,3 + +00000e36 <.L235>: + e36: 00e685b3 add a1,a3,a4 + e3a: 418c lw a1,0(a1) + e3c: 167d add a2,a2,-1 + +00000e3e <.LVL432>: + e3e: 16f1 add a3,a3,-4 + e40: c2cc sw a1,4(a3) + +00000e42 <.LVL433>: + e42: fef65ae3 bge a2,a5,e36 <.L235> + e46: fff78713 add a4,a5,-1 + e4a: bf2d j d84 <.L238> + +00000e4c <.L237>: + e4c: 4290 lw a2,0(a3) + e4e: ffc6a283 lw t0,-4(a3) + e52: 00e68433 add s0,a3,a4 + e56: 00b61633 sll a2,a2,a1 + e5a: 0062d2b3 srl t0,t0,t1 + e5e: 00566633 or a2,a2,t0 + e62: c010 sw a2,0(s0) + e64: 16f1 add a3,a3,-4 + e66: b709 j d68 <.L234> + +00000e68 <.L243>: + e68: 0006a283 lw t0,0(a3) + e6c: 0705 add a4,a4,1 + +00000e6e <.LVL436>: + e6e: 0691 add a3,a3,4 + e70: 00566633 or a2,a2,t0 + +00000e74 <.LVL437>: + e74: b7b1 j dc0 <.L242> + +00000e76 <.L244>: + e76: 04c68413 add s0,a3,76 + e7a: 1024 add s1,sp,40 + e7c: 009402b3 add t0,s0,s1 + e80: fd42a283 lw t0,-44(t0) + e84: 02000393 li t2,32 + e88: 40a383b3 sub t2,t2,a0 + e8c: 007292b3 sll t0,t0,t2 + e90: 00566633 or a2,a2,t0 + +00000e94 <.LVL439>: + e94: 96be add a3,a3,a5 + e96: 4401 li s0,0 + +00000e98 <.L247>: + e98: 04e44963 blt s0,a4,eea <.L248> + e9c: 070a sll a4,a4,0x2 + e9e: 102c add a1,sp,40 + ea0: 04c70713 add a4,a4,76 + ea4: 972e add a4,a4,a1 + ea6: 45d6 lw a1,84(sp) + ea8: 4691 li a3,4 + eaa: 406686b3 sub a3,a3,t1 + +00000eae <.LVL441>: + eae: 00a5d5b3 srl a1,a1,a0 + eb2: fcb72a23 sw a1,-44(a4) + +00000eb6 <.L249>: + eb6: 4711 li a4,4 + eb8: 8f15 sub a4,a4,a3 + eba: 068a sll a3,a3,0x2 + ebc: 97b6 add a5,a5,a3 + ebe: 070a sll a4,a4,0x2 + ec0: 46a1 li a3,8 + ec2: 00d76863 bltu a4,a3,ed2 <.L250> + ec6: 0007a023 sw zero,0(a5) + eca: 0007a223 sw zero,4(a5) + ece: 1761 add a4,a4,-8 + ed0: 07a1 add a5,a5,8 + +00000ed2 <.L250>: + ed2: 4691 li a3,4 + ed4: 00d76463 bltu a4,a3,edc <.L251> + ed8: 0007a023 sw zero,0(a5) + +00000edc <.L251>: + edc: 47a6 lw a5,72(sp) + +00000ede <.LBB64>: + ede: 00c03633 snez a2,a2 + +00000ee2 <.LBE64>: + ee2: 8fd1 or a5,a5,a2 + ee4: c4be sw a5,72(sp) + +00000ee6 <.LBB181>: + ee6: ecaff06f j 5b0 <.L354> + +00000eea <.L248>: + eea: 0006a283 lw t0,0(a3) + eee: 42c4 lw s1,4(a3) + ef0: 0405 add s0,s0,1 + +00000ef2 <.LVL447>: + ef2: 00a2d2b3 srl t0,t0,a0 + ef6: 007494b3 sll s1,s1,t2 + efa: 0092e2b3 or t0,t0,s1 + efe: 0055a023 sw t0,0(a1) + +00000f02 <.LVL448>: + f02: 0691 add a3,a3,4 + f04: 0591 add a1,a1,4 + f06: bf49 j e98 <.L247> + +00000f08 <.L241>: + f08: 4792 lw a5,4(sp) + f0a: fff80737 lui a4,0xfff80 + f0e: 177d add a4,a4,-1 # fff7ffff <.LLST158+0xfff7d687> + f10: 40a78533 sub a0,a5,a0 + +00000f14 <.LVL450>: + f14: 47d6 lw a5,84(sp) + f16: 8ff9 and a5,a5,a4 + f18: cc8ff06f j 3e0 <.L355> + +00000f1c <.L258>: + f1c: ca82 sw zero,84(sp) + f1e: c882 sw zero,80(sp) + f20: c682 sw zero,76(sp) + f22: c482 sw zero,72(sp) + f24: a88ff06f j 1ac <.L257> + +00000f28 <.L21>: + f28: 07400613 li a2,116 + f2c: b0d65763 bge a2,a3,23a <.L262> + +00000f30 <.L23>: + f30: c282 sw zero,68(sp) + f32: c082 sw zero,64(sp) + f34: de02 sw zero,60(sp) + f36: 4485 li s1,1 + f38: bbaff06f j 2f2 <.L34> + +00000f3c <.L59>: + f3c: 07400793 li a5,116 + f40: d0d7d563 bge a5,a3,44a <.L263> + +00000f44 <.L61>: + f44: da02 sw zero,52(sp) + f46: d802 sw zero,48(sp) + f48: d602 sw zero,44(sp) + f4a: 4405 li s0,1 + f4c: ddaff06f j 526 <.L74> + +00000f50 <.L163>: + f50: 07400793 li a5,116 + f54: a2b7d1e3 bge a5,a1,976 <.L265> + +00000f58 <.L165>: + f58: da02 sw zero,52(sp) + f5a: d802 sw zero,48(sp) + f5c: d602 sw zero,44(sp) + f5e: 4705 li a4,1 + f60: bcdd j a56 <.L178> + +divtf3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__divtf3>: + 0: 4218 lw a4,0(a2) + 2: f6410113 add sp,sp,-156 + 6: 41dc lw a5,4(a1) + 8: c43a sw a4,8(sp) + a: 4618 lw a4,8(a2) + c: 4594 lw a3,8(a1) + e: cc2a sw a0,24(sp) + 10: c23a sw a4,4(sp) + 12: 4658 lw a4,12(a2) + 14: 4188 lw a0,0(a1) + 16: 45cc lw a1,12(a1) + 18: c63a sw a4,12(sp) + 1a: 08310713 add a4,sp,131 + 1e: 9b41 and a4,a4,-16 + 20: cb22 sw s0,148(sp) + 22: c926 sw s1,144(sp) + 24: cd06 sw ra,152(sp) + +00000026 <.LBB3>: + 26: c74c sw a1,12(a4) + +00000028 <.LBE3>: + 28: 4244 lw s1,4(a2) + 2a: c03a sw a4,0(sp) + +0000002c <.LBB4>: + 2c: c308 sw a0,0(a4) + 2e: c35c sw a5,4(a4) + 30: c714 sw a3,8(a4) + 32: 6621 lui a2,0x8 + 34: 01059713 sll a4,a1,0x10 + 38: 0105d413 srl s0,a1,0x10 + 3c: 8341 srl a4,a4,0x10 + 3e: 167d add a2,a2,-1 # 7fff <.LLST129+0x67e9> + 40: 81fd srl a1,a1,0x1f + 42: da2a sw a0,52(sp) + 44: dc3e sw a5,56(sp) + 46: de36 sw a3,60(sp) + 48: c0ba sw a4,64(sp) + 4a: 8c71 and s0,s0,a2 + +0000004c <.LVL2>: + 4c: c82e sw a1,16(sp) + +0000004e <.LBE4>: + 4e: cc5d beqz s0,10c <.L2> + 50: 1ac40f63 beq s0,a2,20e <.L3> + 54: 67c1 lui a5,0x10 + 56: 8fd9 or a5,a5,a4 + 58: c0be sw a5,64(sp) + +0000005a <.LBB5>: + 5a: 1030 add a2,sp,40 + 5c: 185c add a5,sp,52 + +0000005e <.L4>: + 5e: 47d8 lw a4,12(a5) + 60: 4794 lw a3,8(a5) + 62: 17f1 add a5,a5,-4 # fffc <.LLST129+0xe7e6> + 64: 070e sll a4,a4,0x3 + 66: 82f5 srl a3,a3,0x1d + 68: 8f55 or a4,a4,a3 + 6a: cb98 sw a4,16(a5) + 6c: fef619e3 bne a2,a5,5e <.L4> + +00000070 <.LVL6>: + 70: 57d2 lw a5,52(sp) + 72: 078e sll a5,a5,0x3 + 74: da3e sw a5,52(sp) + +00000076 <.LBE5>: + 76: 77f1 lui a5,0xffffc + 78: 0785 add a5,a5,1 # ffffc001 <.LLST129+0xffffa7eb> + 7a: 943e add s0,s0,a5 + +0000007c <.L199>: + 7c: 4701 li a4,0 + +0000007e <.L5>: + 7e: 4782 lw a5,0(sp) + 80: 46a2 lw a3,8(sp) + 82: 4632 lw a2,12(sp) + 84: c3c4 sw s1,4(a5) + 86: c394 sw a3,0(a5) + 88: 4692 lw a3,4(sp) + 8a: 00c15503 lhu a0,12(sp) + 8e: 827d srl a2,a2,0x1f + 90: c794 sw a3,8(a5) + 92: 46b2 lw a3,12(sp) + 94: c4a6 sw s1,72(sp) + 96: c8aa sw a0,80(sp) + 98: c7d4 sw a3,12(a5) + 9a: 47a2 lw a5,8(sp) + 9c: c632 sw a2,12(sp) + 9e: c2be sw a5,68(sp) + a0: 4792 lw a5,4(sp) + a2: c6be sw a5,76(sp) + a4: 0106d793 srl a5,a3,0x10 + a8: 66a1 lui a3,0x8 + aa: 16fd add a3,a3,-1 # 7fff <.LLST129+0x67e9> + ac: 8ff5 and a5,a5,a3 + +000000ae <.LBE11>: + ae: 16078b63 beqz a5,224 <.L18> + b2: 28d78663 beq a5,a3,33e <.L19> + b6: 66c1 lui a3,0x10 + b8: 8ec9 or a3,a3,a0 + ba: c8b6 sw a3,80(sp) + +000000bc <.LBB12>: + bc: 1828 add a0,sp,56 + be: 00d4 add a3,sp,68 + +000000c0 <.L20>: + c0: 46d0 lw a2,12(a3) + c2: 468c lw a1,8(a3) + c4: 16f1 add a3,a3,-4 # fffc <.LLST129+0xe7e6> + c6: 060e sll a2,a2,0x3 + c8: 81f5 srl a1,a1,0x1d + ca: 8e4d or a2,a2,a1 + cc: ca90 sw a2,16(a3) + ce: fed519e3 bne a0,a3,c0 <.L20> + +000000d2 <.LVL12>: + d2: 4696 lw a3,68(sp) + d4: 068e sll a3,a3,0x3 + d6: c2b6 sw a3,68(sp) + +000000d8 <.LBE12>: + d8: 76f1 lui a3,0xffffc + da: 0685 add a3,a3,1 # ffffc001 <.LLST129+0xffffa7eb> + dc: 97b6 add a5,a5,a3 + +000000de <.L201>: + de: 4681 li a3,0 + +000000e0 <.L21>: + e0: 4642 lw a2,16(sp) + e2: 45b2 lw a1,12(sp) + e4: 40f407b3 sub a5,s0,a5 + +000000e8 <.LVL15>: + e8: d43e sw a5,40(sp) + ea: 00271793 sll a5,a4,0x2 + ee: 8e2d xor a2,a2,a1 + f0: 8fd5 or a5,a5,a3 + f2: ce32 sw a2,28(sp) + +000000f4 <.LVL16>: + f4: 17fd add a5,a5,-1 + f6: 4639 li a2,14 + +000000f8 <.LVL17>: + f8: 26f66063 bltu a2,a5,358 <.L34> + fc: 00000637 lui a2,0x0 + 100: 078a sll a5,a5,0x2 + 102: 00060613 mv a2,a2 + 106: 97b2 add a5,a5,a2 + 108: 439c lw a5,0(a5) + 10a: 8782 jr a5 + +0000010c <.L2>: + 10c: 00a7e633 or a2,a5,a0 + 110: 8e55 or a2,a2,a3 + 112: 8e59 or a2,a2,a4 + 114: 10060563 beqz a2,21e <.L153> + +00000118 <.LBB18>: + 118: c729 beqz a4,162 <.L6> + 11a: 853a mv a0,a4 + 11c: 00000097 auipc ra,0x0 + 120: 000080e7 jalr ra # 11c <.LBB18+0x4> + +00000124 <.LBB7>: + 124: ff450713 add a4,a0,-12 + +00000128 <.LVL20>: + 128: 02000613 li a2,32 + 12c: 8e19 sub a2,a2,a4 + +0000012e <.LVL21>: + 12e: 4781 li a5,0 + +00000130 <.L7>: + 130: 40f005b3 neg a1,a5 + 134: 058a sll a1,a1,0x2 + 136: 03410293 add t0,sp,52 + 13a: 00c58693 add a3,a1,12 + 13e: 9696 add a3,a3,t0 + 140: 40b00433 neg s0,a1 + +00000144 <.L12>: + 144: 0ad29663 bne t0,a3,1f0 <.L15> + 148: fff78693 add a3,a5,-1 + +0000014c <.LVL24>: + 14c: 078a sll a5,a5,0x2 + 14e: 1850 add a2,sp,52 + +00000150 <.LVL25>: + 150: 05c78793 add a5,a5,92 + 154: 97b2 add a5,a5,a2 + 156: 5652 lw a2,52(sp) + 158: 00e61733 sll a4,a2,a4 + +0000015c <.LVL26>: + 15c: fae7a223 sw a4,-92(a5) + 160: a095 j 1c4 <.L14> + +00000162 <.L6>: + 162: c295 beqz a3,186 <.L8> + 164: 8536 mv a0,a3 + 166: 00000097 auipc ra,0x0 + 16a: 000080e7 jalr ra # 166 <.L6+0x4> + +0000016e <.LVL28>: + 16e: 02050513 add a0,a0,32 + +00000172 <.L9>: + 172: ff450713 add a4,a0,-12 + 176: 40575793 sra a5,a4,0x5 + +0000017a <.LVL30>: + 17a: 8b7d and a4,a4,31 + +0000017c <.LVL31>: + 17c: c70d beqz a4,1a6 <.L11> + 17e: 02000613 li a2,32 + 182: 8e19 sub a2,a2,a4 + +00000184 <.LVL32>: + 184: b775 j 130 <.L7> + +00000186 <.L8>: + 186: cb89 beqz a5,198 <.L10> + 188: 853e mv a0,a5 + 18a: 00000097 auipc ra,0x0 + 18e: 000080e7 jalr ra # 18a <.L8+0x4> + +00000192 <.LVL34>: + 192: 04050513 add a0,a0,64 + 196: bff1 j 172 <.L9> + +00000198 <.L10>: + 198: 00000097 auipc ra,0x0 + 19c: 000080e7 jalr ra # 198 <.L10> + +000001a0 <.LVL37>: + 1a0: 06050513 add a0,a0,96 + 1a4: b7f9 j 172 <.L9> + +000001a6 <.L11>: + 1a6: 40f00633 neg a2,a5 + 1aa: 0098 add a4,sp,64 + +000001ac <.LVL40>: + 1ac: 060a sll a2,a2,0x2 + +000001ae <.LBB9>: + 1ae: 468d li a3,3 + +000001b0 <.L13>: + 1b0: 00c705b3 add a1,a4,a2 + 1b4: 418c lw a1,0(a1) + 1b6: 16fd add a3,a3,-1 + +000001b8 <.LVL42>: + 1b8: 1771 add a4,a4,-4 + 1ba: c34c sw a1,4(a4) + +000001bc <.LVL43>: + 1bc: fef6dae3 bge a3,a5,1b0 <.L13> + 1c0: fff78693 add a3,a5,-1 + +000001c4 <.L14>: + 1c4: 00168793 add a5,a3,1 + 1c8: 078a sll a5,a5,0x2 + 1ca: 46a1 li a3,8 + 1cc: 1858 add a4,sp,52 + 1ce: 00d7e863 bltu a5,a3,1de <.L16> + 1d2: 00072023 sw zero,0(a4) + 1d6: 00072223 sw zero,4(a4) + 1da: 17e1 add a5,a5,-8 + 1dc: 1878 add a4,sp,60 + +000001de <.L16>: + 1de: 4691 li a3,4 + 1e0: 00d7e463 bltu a5,a3,1e8 <.L17> + 1e4: 00072023 sw zero,0(a4) + +000001e8 <.L17>: + 1e8: 7471 lui s0,0xffffc + 1ea: 0445 add s0,s0,17 # ffffc011 <.LLST129+0xffffa7fb> + 1ec: 8c09 sub s0,s0,a0 + 1ee: b579 j 7c <.L199> + +000001f0 <.L15>: + 1f0: 428c lw a1,0(a3) + 1f2: ffc6a303 lw t1,-4(a3) + 1f6: 008683b3 add t2,a3,s0 + 1fa: 00e595b3 sll a1,a1,a4 + 1fe: 00c35333 srl t1,t1,a2 + 202: 0065e5b3 or a1,a1,t1 + 206: 00b3a023 sw a1,0(t2) + 20a: 16f1 add a3,a3,-4 + 20c: bf25 j 144 <.L12> + +0000020e <.L3>: + 20e: 8fc9 or a5,a5,a0 + 210: 8fd5 or a5,a5,a3 + 212: 8fd9 or a5,a5,a4 + 214: 4709 li a4,2 + 216: e60784e3 beqz a5,7e <.L5> + 21a: 470d li a4,3 + 21c: b58d j 7e <.L5> + +0000021e <.L153>: + 21e: 4401 li s0,0 + +00000220 <.LBE19>: + 220: 4705 li a4,1 + 222: bdb1 j 7e <.L5> + +00000224 <.L18>: + 224: 47a2 lw a5,8(sp) + +00000226 <.LVL49>: + 226: 4692 lw a3,4(sp) + +00000228 <.LVL50>: + 228: 8fc5 or a5,a5,s1 + 22a: 8fd5 or a5,a5,a3 + 22c: 8fc9 or a5,a5,a0 + 22e: 12078263 beqz a5,352 <.L155> + +00000232 <.LBB20>: + 232: c539 beqz a0,280 <.L22> + 234: c23a sw a4,4(sp) + 236: 00000097 auipc ra,0x0 + 23a: 000080e7 jalr ra # 236 <.LBB20+0x4> + +0000023e <.LBB14>: + 23e: 4712 lw a4,4(sp) + 240: ff450693 add a3,a0,-12 + +00000244 <.LVL52>: + 244: 02000593 li a1,32 + 248: 8d95 sub a1,a1,a3 + +0000024a <.LVL53>: + 24a: 4781 li a5,0 + +0000024c <.L23>: + 24c: 40f00333 neg t1,a5 + 250: 030a sll t1,t1,0x2 + 252: 04410393 add t2,sp,68 + 256: 00c30613 add a2,t1,12 + 25a: 406004b3 neg s1,t1 + 25e: 961e add a2,a2,t2 + 260: c226 sw s1,4(sp) + +00000262 <.L28>: + 262: 0ac39e63 bne t2,a2,31e <.L31> + 266: fff78613 add a2,a5,-1 + +0000026a <.LVL55>: + 26a: 078a sll a5,a5,0x2 + 26c: 184c add a1,sp,52 + +0000026e <.LVL56>: + 26e: 05c78793 add a5,a5,92 + 272: 97ae add a5,a5,a1 + 274: 4596 lw a1,68(sp) + 276: 00d596b3 sll a3,a1,a3 + +0000027a <.LVL57>: + 27a: fad7aa23 sw a3,-76(a5) + 27e: a895 j 2f2 <.L30> + +00000280 <.L22>: + 280: 4792 lw a5,4(sp) + 282: c785 beqz a5,2aa <.L24> + 284: 853e mv a0,a5 + 286: c43a sw a4,8(sp) + 288: 00000097 auipc ra,0x0 + 28c: 000080e7 jalr ra # 288 <.L22+0x8> + +00000290 <.LVL59>: + 290: 4722 lw a4,8(sp) + 292: 02050513 add a0,a0,32 + +00000296 <.L25>: + 296: ff450693 add a3,a0,-12 + 29a: 4056d793 sra a5,a3,0x5 + +0000029e <.LVL61>: + 29e: 8afd and a3,a3,31 + +000002a0 <.LVL62>: + 2a0: ca85 beqz a3,2d0 <.L27> + 2a2: 02000593 li a1,32 + 2a6: 8d95 sub a1,a1,a3 + +000002a8 <.LVL63>: + 2a8: b755 j 24c <.L23> + +000002aa <.L24>: + 2aa: c23a sw a4,4(sp) + 2ac: c891 beqz s1,2c0 <.L26> + 2ae: 8526 mv a0,s1 + 2b0: 00000097 auipc ra,0x0 + 2b4: 000080e7 jalr ra # 2b0 <.L24+0x6> + +000002b8 <.LVL65>: + 2b8: 04050513 add a0,a0,64 + +000002bc <.L200>: + 2bc: 4712 lw a4,4(sp) + +000002be <.LVL67>: + 2be: bfe1 j 296 <.L25> + +000002c0 <.L26>: + 2c0: 4522 lw a0,8(sp) + 2c2: 00000097 auipc ra,0x0 + 2c6: 000080e7 jalr ra # 2c2 <.L26+0x2> + +000002ca <.LVL69>: + 2ca: 06050513 add a0,a0,96 + +000002ce <.LVL70>: + 2ce: b7fd j 2bc <.L200> + +000002d0 <.L27>: + 2d0: 40f005b3 neg a1,a5 + 2d4: 0894 add a3,sp,80 + +000002d6 <.LVL72>: + 2d6: 058a sll a1,a1,0x2 + +000002d8 <.LBB16>: + 2d8: 460d li a2,3 + +000002da <.L29>: + 2da: 00b68333 add t1,a3,a1 + 2de: 00032303 lw t1,0(t1) + 2e2: 167d add a2,a2,-1 # ffffffff <.LLST129+0xffffe7e9> + +000002e4 <.LVL74>: + 2e4: 16f1 add a3,a3,-4 + 2e6: 0066a223 sw t1,4(a3) + +000002ea <.LVL75>: + 2ea: fef658e3 bge a2,a5,2da <.L29> + 2ee: fff78613 add a2,a5,-1 + +000002f2 <.L30>: + 2f2: 00160793 add a5,a2,1 + 2f6: 078a sll a5,a5,0x2 + 2f8: 4621 li a2,8 + 2fa: 00d4 add a3,sp,68 + 2fc: 00c7e863 bltu a5,a2,30c <.L32> + 300: 0006a023 sw zero,0(a3) + 304: 0006a223 sw zero,4(a3) + 308: 17e1 add a5,a5,-8 + 30a: 00f4 add a3,sp,76 + +0000030c <.L32>: + 30c: 4611 li a2,4 + 30e: 00c7e463 bltu a5,a2,316 <.L33> + 312: 0006a023 sw zero,0(a3) + +00000316 <.L33>: + 316: 77f1 lui a5,0xffffc + 318: 07c5 add a5,a5,17 # ffffc011 <.LLST129+0xffffa7fb> + 31a: 8f89 sub a5,a5,a0 + 31c: b3c9 j de <.L201> + +0000031e <.L31>: + 31e: 00062303 lw t1,0(a2) + 322: ffc62283 lw t0,-4(a2) + 326: 4492 lw s1,4(sp) + 328: 00d31333 sll t1,t1,a3 + 32c: 00b2d2b3 srl t0,t0,a1 + 330: 94b2 add s1,s1,a2 + 332: 00536333 or t1,t1,t0 + 336: 0064a023 sw t1,0(s1) + 33a: 1671 add a2,a2,-4 + 33c: b71d j 262 <.L28> + +0000033e <.L19>: + 33e: 46a2 lw a3,8(sp) + 340: 8cd5 or s1,s1,a3 + 342: 4692 lw a3,4(sp) + 344: 8cd5 or s1,s1,a3 + 346: 8cc9 or s1,s1,a0 + 348: 4689 li a3,2 + 34a: d8048be3 beqz s1,e0 <.L21> + 34e: 468d li a3,3 + 350: bb41 j e0 <.L21> + +00000352 <.L155>: + 352: 4781 li a5,0 + +00000354 <.LBE21>: + 354: 4685 li a3,1 + 356: b369 j e0 <.L21> + +00000358 <.L34>: + 358: 4686 lw a3,64(sp) + +0000035a <.LVL81>: + 35a: 4746 lw a4,80(sp) + 35c: d882 sw zero,112(sp) + 35e: d682 sw zero,108(sp) + 360: d482 sw zero,104(sp) + 362: d282 sw zero,100(sp) + 364: 47b6 lw a5,76(sp) + 366: 02d76363 bltu a4,a3,38c <.L41> + 36a: 0ae69f63 bne a3,a4,428 <.L42> + 36e: 5772 lw a4,60(sp) + 370: 00e7ee63 bltu a5,a4,38c <.L41> + 374: 0af71a63 bne a4,a5,428 <.L42> + 378: 5762 lw a4,56(sp) + 37a: 47a6 lw a5,72(sp) + 37c: 00e7e863 bltu a5,a4,38c <.L41> + 380: 0af71463 bne a4,a5,428 <.L42> + 384: 5752 lw a4,52(sp) + 386: 4796 lw a5,68(sp) + 388: 0af76063 bltu a4,a5,428 <.L42> + +0000038c <.L41>: + 38c: 57d2 lw a5,52(sp) + 38e: 0090 add a2,sp,64 + 390: 07fe sll a5,a5,0x1f + 392: d8be sw a5,112(sp) + +00000394 <.LBB23>: + 394: 185c add a5,sp,52 + +00000396 <.L43>: + 396: 4398 lw a4,0(a5) + 398: 43d4 lw a3,4(a5) + 39a: 8305 srl a4,a4,0x1 + 39c: 06fe sll a3,a3,0x1f + 39e: 8f55 or a4,a4,a3 + 3a0: c398 sw a4,0(a5) + 3a2: 0791 add a5,a5,4 + 3a4: fef619e3 bne a2,a5,396 <.L43> + +000003a8 <.LVL84>: + 3a8: 4786 lw a5,64(sp) + 3aa: 8385 srl a5,a5,0x1 + 3ac: c0be sw a5,64(sp) + +000003ae <.L44>: + 3ae: 00dc add a5,sp,68 + 3b0: 1830 add a2,sp,56 + +000003b2 <.L45>: + 3b2: 47d8 lw a4,12(a5) + 3b4: 4794 lw a3,8(a5) + 3b6: 17f1 add a5,a5,-4 + 3b8: 0732 sll a4,a4,0xc + 3ba: 82d1 srl a3,a3,0x14 + 3bc: 8f55 or a4,a4,a3 + 3be: cb98 sw a4,16(a5) + 3c0: fef619e3 bne a2,a5,3b2 <.L45> + +000003c4 <.LVL87>: + 3c4: 4796 lw a5,68(sp) + 3c6: 07b2 sll a5,a5,0xc + 3c8: c2be sw a5,68(sp) + 3ca: 08dc add a5,sp,84 + 3cc: c23e sw a5,4(sp) + 3ce: 10dc add a5,sp,100 + 3d0: d63e sw a5,44(sp) + +000003d2 <.LBE24>: + 3d2: 478d li a5,3 + 3d4: d23e sw a5,36(sp) + +000003d6 <.L120>: + 3d6: 4786 lw a5,64(sp) + 3d8: 44c6 lw s1,80(sp) + 3da: 10979f63 bne a5,s1,4f8 <.L46> + 3de: 4792 lw a5,4(sp) + 3e0: 577d li a4,-1 + 3e2: c7d8 sw a4,12(a5) + 3e4: 5792 lw a5,36(sp) + 3e6: 4c078363 beqz a5,8ac <.L121> + +000003ea <.LBB25>: + 3ea: 57b2 lw a5,44(sp) + 3ec: 4316 lw t1,68(sp) + 3ee: 5552 lw a0,52(sp) + 3f0: 47d8 lw a4,12(a5) + +000003f2 <.LVL89>: + 3f2: 4626 lw a2,72(sp) + 3f4: 40a303b3 sub t2,t1,a0 + 3f8: 00e037b3 snez a5,a4 + 3fc: c43e sw a5,8(sp) + +000003fe <.LVL90>: + 3fe: 57e2 lw a5,56(sp) + +00000400 <.LVL91>: + 400: 007335b3 sltu a1,t1,t2 + 404: c62e sw a1,12(sp) + +00000406 <.LVL92>: + 406: 40f602b3 sub t0,a2,a5 + 40a: 00b036b3 snez a3,a1 + +0000040e <.LVL93>: + 40e: 00563433 sltu s0,a2,t0 + 412: cf19 beqz a4,430 <.L52> + 414: 00a31e63 bne t1,a0,430 <.L52> + +00000418 <.LVL94>: + 418: 12fd add t0,t0,-1 + +0000041a <.L53>: + 41a: 40c786b3 sub a3,a5,a2 + 41e: 4585 li a1,1 + 420: 0016b693 seqz a3,a3 + 424: c62e sw a1,12(sp) + 426: a809 j 438 <.L54> + +00000428 <.L42>: + 428: 57a2 lw a5,40(sp) + 42a: 17fd add a5,a5,-1 + 42c: d43e sw a5,40(sp) + +0000042e <.LVL97>: + 42e: b741 j 3ae <.L44> + +00000430 <.L52>: + 430: 40d282b3 sub t0,t0,a3 + +00000434 <.LVL99>: + 434: 4681 li a3,0 + +00000436 <.LVL100>: + 436: f1f5 bnez a1,41a <.L53> + +00000438 <.L54>: + 438: 8ec1 or a3,a3,s0 + 43a: ca36 sw a3,20(sp) + +0000043c <.LVL102>: + 43c: 56f2 lw a3,60(sp) + +0000043e <.LVL103>: + 43e: 45b6 lw a1,76(sp) + +00000440 <.LBB27>: + 440: 4432 lw s0,12(sp) + +00000442 <.LBB28>: + 442: c836 sw a3,16(sp) + +00000444 <.LBB29>: + 444: 46a2 lw a3,8(sp) + 446: 9532 add a0,a0,a2 + 448: 97ae add a5,a5,a1 + 44a: 40650533 sub a0,a0,t1 + 44e: 8f91 sub a5,a5,a2 + 450: 9536 add a0,a0,a3 + 452: 97a2 add a5,a5,s0 + 454: 00a636b3 sltu a3,a2,a0 + 458: 971a add a4,a4,t1 + +0000045a <.LVL104>: + 45a: 00f5b433 sltu s0,a1,a5 + 45e: d036 sw a3,32(sp) + +00000460 <.LVL105>: + 460: c622 sw s0,12(sp) + 462: 00e336b3 sltu a3,t1,a4 + +00000466 <.LVL106>: + 466: 40d506b3 sub a3,a0,a3 + +0000046a <.LVL107>: + 46a: 00e37d63 bgeu t1,a4,484 <.L55> + +0000046e <.LBB30>: + 46e: 4422 lw s0,8(sp) + 470: 408383b3 sub t2,t2,s0 + +00000474 <.LBB31>: + 474: 00c39863 bne t2,a2,484 <.L55> + +00000478 <.LVL109>: + 478: 17fd add a5,a5,-1 + +0000047a <.L56>: + 47a: 405582b3 sub t0,a1,t0 + +0000047e <.LVL111>: + 47e: 0012b393 seqz t2,t0 + 482: a039 j 490 <.L57> + +00000484 <.L55>: + 484: 00a63433 sltu s0,a2,a0 + 488: 8f81 sub a5,a5,s0 + +0000048a <.LVL113>: + 48a: 4381 li t2,0 + 48c: fea667e3 bltu a2,a0,47a <.L56> + +00000490 <.L57>: + 490: 4542 lw a0,16(sp) + 492: 4452 lw s0,20(sp) + 494: de3e sw a5,60(sp) + 496: 9526 add a0,a0,s1 + 498: 8d0d sub a0,a0,a1 + 49a: 9522 add a0,a0,s0 + 49c: 4432 lw s0,12(sp) + 49e: dc36 sw a3,56(sp) + 4a0: da3a sw a4,52(sp) + +000004a2 <.LVL115>: + 4a2: 0083e3b3 or t2,t2,s0 + +000004a6 <.LVL116>: + 4a6: 407503b3 sub t2,a0,t2 + +000004aa <.LVL117>: + 4aa: c09e sw t2,64(sp) + +000004ac <.LBE31>: + 4ac: 0274fc63 bgeu s1,t2,4e4 <.L69> + 4b0: 971a add a4,a4,t1 + +000004b2 <.LVL118>: + 4b2: 9636 add a2,a2,a3 + +000004b4 <.LBB32>: + 4b4: da3a sw a4,52(sp) + +000004b6 <.LVL119>: + 4b6: 00673733 sltu a4,a4,t1 + 4ba: 9732 add a4,a4,a2 + 4bc: dc3a sw a4,56(sp) + 4be: 00d636b3 sltu a3,a2,a3 + +000004c2 <.LVL120>: + 4c2: 00c73733 sltu a4,a4,a2 + 4c6: 97ae add a5,a5,a1 + +000004c8 <.LVL121>: + 4c8: 8ed9 or a3,a3,a4 + 4ca: 96be add a3,a3,a5 + +000004cc <.LBE32>: + 4cc: 4412 lw s0,4(sp) + +000004ce <.LBB33>: + 4ce: de36 sw a3,60(sp) + +000004d0 <.LVL122>: + 4d0: 00b7b5b3 sltu a1,a5,a1 + 4d4: 00f6b6b3 sltu a3,a3,a5 + 4d8: 8dd5 or a1,a1,a3 + 4da: 93a6 add t2,t2,s1 + +000004dc <.LBE33>: + 4dc: 5579 li a0,-2 + +000004de <.LBB34>: + 4de: 959e add a1,a1,t2 + +000004e0 <.LBE34>: + 4e0: c448 sw a0,12(s0) + +000004e2 <.LBB35>: + 4e2: c0ae sw a1,64(sp) + +000004e4 <.L69>: + 4e4: 5792 lw a5,36(sp) + 4e6: 17fd add a5,a5,-1 + 4e8: d23e sw a5,36(sp) + +000004ea <.LVL125>: + 4ea: 4792 lw a5,4(sp) + +000004ec <.LVL126>: + 4ec: 17f1 add a5,a5,-4 + 4ee: c23e sw a5,4(sp) + 4f0: 57b2 lw a5,44(sp) + 4f2: 17f1 add a5,a5,-4 + 4f4: d63e sw a5,44(sp) + 4f6: b5c5 j 3d6 <.L120> + +000004f8 <.L46>: + 4f8: 6741 lui a4,0x10 + 4fa: 177d add a4,a4,-1 # ffff <.LLST129+0xe7e9> + 4fc: 8f65 and a4,a4,s1 + 4fe: 853e mv a0,a5 + 500: 0104d593 srl a1,s1,0x10 + 504: c43a sw a4,8(sp) + +00000506 <.LVL128>: + 506: c83e sw a5,16(sp) + 508: 00000097 auipc ra,0x0 + 50c: 000080e7 jalr ra # 508 <.LVL128+0x2> + +00000510 <.LVL129>: + 510: 85aa mv a1,a0 + 512: c62a sw a0,12(sp) + 514: 4522 lw a0,8(sp) + +00000516 <.LVL130>: + 516: 00000097 auipc ra,0x0 + 51a: 000080e7 jalr ra # 516 <.LVL130> + +0000051e <.LVL131>: + 51e: 47c2 lw a5,16(sp) + 520: 842a mv s0,a0 + +00000522 <.LVL132>: + 522: 0104d593 srl a1,s1,0x10 + 526: 853e mv a0,a5 + 528: 00000097 auipc ra,0x0 + 52c: 000080e7 jalr ra # 528 <.LVL132+0x6> + +00000530 <.LVL133>: + 530: 5772 lw a4,60(sp) + 532: 46b2 lw a3,12(sp) + 534: 0542 sll a0,a0,0x10 + 536: 01075613 srl a2,a4,0x10 + 53a: 8e49 or a2,a2,a0 + +0000053c <.LVL134>: + 53c: 87b6 mv a5,a3 + 53e: 00867c63 bgeu a2,s0,556 <.L70> + 542: 9626 add a2,a2,s1 + +00000544 <.LVL135>: + 544: fff68793 add a5,a3,-1 + +00000548 <.LVL136>: + 548: 00966763 bltu a2,s1,556 <.L70> + 54c: 00867563 bgeu a2,s0,556 <.L70> + 550: ffe68793 add a5,a3,-2 + 554: 9626 add a2,a2,s1 + +00000556 <.L70>: + 556: d03e sw a5,32(sp) + 558: 408607b3 sub a5,a2,s0 + +0000055c <.LVL139>: + 55c: 853e mv a0,a5 + 55e: 0104d593 srl a1,s1,0x10 + 562: ca3a sw a4,20(sp) + 564: c63e sw a5,12(sp) + +00000566 <.LVL140>: + 566: 00000097 auipc ra,0x0 + 56a: 000080e7 jalr ra # 566 <.LVL140> + +0000056e <.LVL141>: + 56e: 85aa mv a1,a0 + 570: c82a sw a0,16(sp) + 572: 4522 lw a0,8(sp) + +00000574 <.LVL142>: + 574: 00000097 auipc ra,0x0 + 578: 000080e7 jalr ra # 574 <.LVL142> + +0000057c <.LVL143>: + 57c: 842a mv s0,a0 + 57e: 4532 lw a0,12(sp) + 580: 0104d593 srl a1,s1,0x10 + 584: 00000097 auipc ra,0x0 + 588: 000080e7 jalr ra # 584 <.LVL143+0x8> + +0000058c <.LVL145>: + 58c: 4752 lw a4,20(sp) + 58e: 67c1 lui a5,0x10 + 590: 17fd add a5,a5,-1 # ffff <.LLST129+0xe7e9> + 592: 4642 lw a2,16(sp) + 594: 8f7d and a4,a4,a5 + 596: 0542 sll a0,a0,0x10 + 598: 8f49 or a4,a4,a0 + +0000059a <.LVL146>: + 59a: 5782 lw a5,32(sp) + 59c: 85b2 mv a1,a2 + 59e: 00877c63 bgeu a4,s0,5b6 <.L73> + 5a2: 9726 add a4,a4,s1 + +000005a4 <.LVL147>: + 5a4: fff60593 add a1,a2,-1 + +000005a8 <.LVL148>: + 5a8: 00976763 bltu a4,s1,5b6 <.L73> + 5ac: 00877563 bgeu a4,s0,5b6 <.L73> + 5b0: ffe60593 add a1,a2,-2 + 5b4: 9726 add a4,a4,s1 + +000005b6 <.L73>: + 5b6: 8f01 sub a4,a4,s0 + +000005b8 <.LVL151>: + 5b8: c0ba sw a4,64(sp) + +000005ba <.LBB37>: + 5ba: 4716 lw a4,68(sp) + +000005bc <.LBB70>: + 5bc: 4692 lw a3,4(sp) + 5be: 6441 lui s0,0x10 + +000005c0 <.LVL153>: + 5c0: 07c2 sll a5,a5,0x10 + 5c2: 8fcd or a5,a5,a1 + +000005c4 <.LBB43>: + 5c4: ca3a sw a4,20(sp) + 5c6: 01075313 srl t1,a4,0x10 + 5ca: fff40713 add a4,s0,-1 # ffff <.LLST129+0xe7e9> + +000005ce <.LBB72>: + 5ce: c6dc sw a5,12(a3) + +000005d0 <.LBB44>: + 5d0: 0107d293 srl t0,a5,0x10 + +000005d4 <.LBB39>: + 5d4: 8ff9 and a5,a5,a4 + +000005d6 <.LVL156>: + 5d6: 4752 lw a4,20(sp) + 5d8: fff40693 add a3,s0,-1 + +000005dc <.LVL157>: + 5dc: 853e mv a0,a5 + 5de: 00d773b3 and t2,a4,a3 + 5e2: 859e mv a1,t2 + +000005e4 <.LVL158>: + 5e4: 00000097 auipc ra,0x0 + 5e8: 000080e7 jalr ra # 5e4 <.LVL158> + 5ec: 872a mv a4,a0 + +000005ee <.LBB40>: + 5ee: 859a mv a1,t1 + 5f0: 853e mv a0,a5 + +000005f2 <.LVL160>: + 5f2: 00000097 auipc ra,0x0 + 5f6: 000080e7 jalr ra # 5f2 <.LVL160> + 5fa: 87aa mv a5,a0 + +000005fc <.LBB41>: + 5fc: 859e mv a1,t2 + 5fe: 8516 mv a0,t0 + +00000600 <.LVL162>: + 600: 00000097 auipc ra,0x0 + 604: 000080e7 jalr ra # 600 <.LVL162> + 608: 83aa mv t2,a0 + +0000060a <.LBB42>: + 60a: 859a mv a1,t1 + 60c: 8516 mv a0,t0 + 60e: 00000097 auipc ra,0x0 + 612: 000080e7 jalr ra # 60e <.LBB42+0x4> + +00000616 <.LBE42>: + 616: 01075693 srl a3,a4,0x10 + 61a: 979e add a5,a5,t2 + +0000061c <.LVL165>: + 61c: 96be add a3,a3,a5 + +0000061e <.LVL166>: + 61e: 0076f363 bgeu a3,t2,624 <.L76> + 622: 9522 add a0,a0,s0 + +00000624 <.L76>: + 624: 6641 lui a2,0x10 + 626: fff60593 add a1,a2,-1 # ffff <.LLST129+0xe7e9> + 62a: 0106d793 srl a5,a3,0x10 + 62e: 8eed and a3,a3,a1 + +00000630 <.LVL168>: + 630: 06c2 sll a3,a3,0x10 + 632: 8f6d and a4,a4,a1 + +00000634 <.LVL169>: + 634: 9736 add a4,a4,a3 + 636: d03a sw a4,32(sp) + +00000638 <.LBB45>: + 638: 4712 lw a4,4(sp) + +0000063a <.LBB50>: + 63a: 97aa add a5,a5,a0 + +0000063c <.LBB51>: + 63c: 4758 lw a4,12(a4) + 63e: c83a sw a4,16(sp) + +00000640 <.LVL172>: + 640: 01075413 srl s0,a4,0x10 + +00000644 <.LVL173>: + 644: 4726 lw a4,72(sp) + 646: 46c2 lw a3,16(sp) + 648: c63a sw a4,12(sp) + +0000064a <.LVL174>: + 64a: 00b6f2b3 and t0,a3,a1 + +0000064e <.LVL175>: + 64e: 46b2 lw a3,12(sp) + 650: 8341 srl a4,a4,0x10 + +00000652 <.LBB46>: + 652: 8516 mv a0,t0 + +00000654 <.LVL177>: + 654: 00b6f3b3 and t2,a3,a1 + +00000658 <.LVL178>: + 658: 859e mv a1,t2 + 65a: 00000097 auipc ra,0x0 + 65e: 000080e7 jalr ra # 65a <.LVL178+0x2> + 662: 832a mv t1,a0 + +00000664 <.LBB47>: + 664: 85ba mv a1,a4 + 666: 8516 mv a0,t0 + 668: 00000097 auipc ra,0x0 + 66c: 000080e7 jalr ra # 668 <.LBB47+0x4> + 670: 82aa mv t0,a0 + +00000672 <.LBB48>: + 672: 859e mv a1,t2 + 674: 8522 mv a0,s0 + 676: 00000097 auipc ra,0x0 + 67a: 000080e7 jalr ra # 676 <.LBB48+0x4> + 67e: 83aa mv t2,a0 + +00000680 <.LBB49>: + 680: 85ba mv a1,a4 + 682: 8522 mv a0,s0 + 684: 00000097 auipc ra,0x0 + 688: 000080e7 jalr ra # 684 <.LBB49+0x4> + +0000068c <.LBE49>: + 68c: 01035713 srl a4,t1,0x10 + +00000690 <.LVL183>: + 690: 929e add t0,t0,t2 + +00000692 <.LVL184>: + 692: 9716 add a4,a4,t0 + +00000694 <.LVL185>: + 694: 00777463 bgeu a4,t2,69c <.L77> + 698: 6641 lui a2,0x10 + 69a: 9532 add a0,a0,a2 + +0000069c <.L77>: + 69c: 6641 lui a2,0x10 + 69e: fff60693 add a3,a2,-1 # ffff <.LLST129+0xe7e9> + 6a2: fff60593 add a1,a2,-1 + 6a6: 8ef9 and a3,a3,a4 + 6a8: 06c2 sll a3,a3,0x10 + 6aa: 00b37333 and t1,t1,a1 + +000006ae <.LVL187>: + 6ae: 9336 add t1,t1,a3 + 6b0: 006786b3 add a3,a5,t1 + +000006b4 <.LBB54>: + 6b4: 00f6b7b3 sltu a5,a3,a5 + +000006b8 <.LBB55>: + 6b8: 8341 srl a4,a4,0x10 + +000006ba <.LBB56>: + 6ba: 4336 lw t1,76(sp) + +000006bc <.LBB61>: + 6bc: 973e add a4,a4,a5 + +000006be <.LBB62>: + 6be: 47c2 lw a5,16(sp) + 6c0: 00b373b3 and t2,t1,a1 + +000006c4 <.LBB63>: + 6c4: 972a add a4,a4,a0 + +000006c6 <.LBB64>: + 6c6: 0107d413 srl s0,a5,0x10 + +000006ca <.LBB57>: + 6ca: 8fed and a5,a5,a1 + 6cc: c436 sw a3,8(sp) + +000006ce <.LVL193>: + 6ce: 853e mv a0,a5 + +000006d0 <.LVL194>: + 6d0: 859e mv a1,t2 + +000006d2 <.LVL195>: + 6d2: 00000097 auipc ra,0x0 + 6d6: 000080e7 jalr ra # 6d2 <.LVL195> + +000006da <.LVL196>: + 6da: 82aa mv t0,a0 + +000006dc <.LBB58>: + 6dc: 01035593 srl a1,t1,0x10 + 6e0: 853e mv a0,a5 + 6e2: 00000097 auipc ra,0x0 + 6e6: 000080e7 jalr ra # 6e2 <.LBB58+0x6> + 6ea: 87aa mv a5,a0 + +000006ec <.LBB59>: + 6ec: 859e mv a1,t2 + 6ee: 8522 mv a0,s0 + +000006f0 <.LVL199>: + 6f0: 00000097 auipc ra,0x0 + 6f4: 000080e7 jalr ra # 6f0 <.LVL199> + 6f8: 83aa mv t2,a0 + +000006fa <.LBB60>: + 6fa: 01035593 srl a1,t1,0x10 + 6fe: 8522 mv a0,s0 + 700: 00000097 auipc ra,0x0 + 704: 000080e7 jalr ra # 700 <.LBB60+0x6> + +00000708 <.LBE60>: + 708: 0102d693 srl a3,t0,0x10 + 70c: 979e add a5,a5,t2 + +0000070e <.LVL202>: + 70e: 96be add a3,a3,a5 + +00000710 <.LVL203>: + 710: 0076f463 bgeu a3,t2,718 <.L80> + 714: 6641 lui a2,0x10 + +00000716 <.LVL204>: + 716: 9532 add a0,a0,a2 + +00000718 <.L80>: + 718: 6641 lui a2,0x10 + +0000071a <.LVL206>: + 71a: fff60793 add a5,a2,-1 # ffff <.LLST129+0xe7e9> + +0000071e <.LVL207>: + 71e: 8ff5 and a5,a5,a3 + +00000720 <.LVL208>: + 720: 167d add a2,a2,-1 + +00000722 <.LVL209>: + 722: 00c2f2b3 and t0,t0,a2 + +00000726 <.LVL210>: + 726: 07c2 sll a5,a5,0x10 + 728: 9796 add a5,a5,t0 + 72a: 97ba add a5,a5,a4 + +0000072c <.LBB67>: + 72c: 00e7b733 sltu a4,a5,a4 + +00000730 <.LBB68>: + 730: 82c1 srl a3,a3,0x10 + +00000732 <.LBB69>: + 732: 96ba add a3,a3,a4 + 734: 00a68433 add s0,a3,a0 + +00000738 <.LBE69>: + 738: 56b2 lw a3,44(sp) + 73a: 5562 lw a0,56(sp) + +0000073c <.LVL215>: + 73c: 5752 lw a4,52(sp) + 73e: 46d4 lw a3,12(a3) + 740: 4286 lw t0,64(sp) + 742: de2a sw a0,60(sp) + 744: dc3a sw a4,56(sp) + 746: da36 sw a3,52(sp) + 748: 0282e063 bltu t0,s0,768 <.L83> + 74c: 0e541263 bne s0,t0,830 <.L85> + 750: 00f56c63 bltu a0,a5,768 <.L83> + 754: 0cf51e63 bne a0,a5,830 <.L85> + 758: 4622 lw a2,8(sp) + +0000075a <.LVL216>: + 75a: 00c76763 bltu a4,a2,768 <.L83> + 75e: 0cc71963 bne a4,a2,830 <.L85> + 762: 5602 lw a2,32(sp) + 764: 0cc6f663 bgeu a3,a2,830 <.L85> + +00000768 <.L83>: + 768: 4642 lw a2,16(sp) + 76a: 4592 lw a1,4(sp) + +0000076c <.LBB74>: + 76c: 92a6 add t0,t0,s1 + +0000076e <.LBE74>: + 76e: 167d add a2,a2,-1 + 770: c5d0 sw a2,12(a1) + +00000772 <.LBB75>: + 772: 4652 lw a2,20(sp) + 774: 9636 add a2,a2,a3 + 776: 00d635b3 sltu a1,a2,a3 + 77a: d82e sw a1,48(sp) + 77c: 45b2 lw a1,12(sp) + 77e: 00d636b3 sltu a3,a2,a3 + 782: da32 sw a2,52(sp) + +00000784 <.LVL218>: + 784: 00b703b3 add t2,a4,a1 + +00000788 <.LVL219>: + 788: 969e add a3,a3,t2 + 78a: 00e3b733 sltu a4,t2,a4 + +0000078e <.LVL220>: + 78e: 0076b3b3 sltu t2,a3,t2 + 792: 006505b3 add a1,a0,t1 + 796: 00776733 or a4,a4,t2 + +0000079a <.LVL221>: + 79a: 972e add a4,a4,a1 + 79c: 00a5b533 sltu a0,a1,a0 + 7a0: 00b735b3 sltu a1,a4,a1 + 7a4: 8dc9 or a1,a1,a0 + 7a6: 9596 add a1,a1,t0 + 7a8: dc36 sw a3,56(sp) + +000007aa <.LVL222>: + 7aa: de3a sw a4,60(sp) + 7ac: c0ae sw a1,64(sp) + +000007ae <.LBE75>: + 7ae: 00b4ef63 bltu s1,a1,7cc <.L97> + 7b2: 06b49f63 bne s1,a1,830 <.L85> + 7b6: 00e36b63 bltu t1,a4,7cc <.L97> + 7ba: 06e31b63 bne t1,a4,830 <.L85> + 7be: 4532 lw a0,12(sp) + 7c0: 00d56663 bltu a0,a3,7cc <.L97> + 7c4: 06d51663 bne a0,a3,830 <.L85> + 7c8: 5542 lw a0,48(sp) + 7ca: e13d bnez a0,830 <.L85> + +000007cc <.L97>: + 7cc: 0285e063 bltu a1,s0,7ec <.L98> + 7d0: 06b41063 bne s0,a1,830 <.L85> + 7d4: 00f76c63 bltu a4,a5,7ec <.L98> + 7d8: 04f71c63 bne a4,a5,830 <.L85> + 7dc: 4522 lw a0,8(sp) + 7de: 00a6e763 bltu a3,a0,7ec <.L98> + 7e2: 04a69763 bne a3,a0,830 <.L85> + 7e6: 5502 lw a0,32(sp) + 7e8: 04a67463 bgeu a2,a0,830 <.L85> + +000007ec <.L98>: + 7ec: 4542 lw a0,16(sp) + 7ee: 4292 lw t0,4(sp) + 7f0: 971a add a4,a4,t1 + 7f2: 1579 add a0,a0,-2 + 7f4: 00a2a623 sw a0,12(t0) + +000007f8 <.LBB76>: + 7f8: 4552 lw a0,20(sp) + 7fa: 00673333 sltu t1,a4,t1 + +000007fe <.LVL224>: + 7fe: 962a add a2,a2,a0 + 800: 4532 lw a0,12(sp) + 802: da32 sw a2,52(sp) + +00000804 <.LVL225>: + 804: 96aa add a3,a3,a0 + +00000806 <.LVL226>: + 806: 4552 lw a0,20(sp) + +00000808 <.LVL227>: + 808: 00a63633 sltu a2,a2,a0 + +0000080c <.LVL228>: + 80c: 4532 lw a0,12(sp) + 80e: 9636 add a2,a2,a3 + +00000810 <.LVL229>: + 810: dc32 sw a2,56(sp) + +00000812 <.LVL230>: + 812: 00a6b533 sltu a0,a3,a0 + +00000816 <.LVL231>: + 816: 00d63633 sltu a2,a2,a3 + +0000081a <.LVL232>: + 81a: 8d51 or a0,a0,a2 + +0000081c <.LVL233>: + 81c: 953a add a0,a0,a4 + 81e: de2a sw a0,60(sp) + 820: 00e53533 sltu a0,a0,a4 + 824: 00a36533 or a0,t1,a0 + 828: 00b48733 add a4,s1,a1 + 82c: 953a add a0,a0,a4 + 82e: c0aa sw a0,64(sp) + +00000830 <.L85>: + 830: 52d2 lw t0,52(sp) + 832: 5702 lw a4,32(sp) + 834: 5362 lw t1,56(sp) + +00000836 <.LVL235>: + 836: 55f2 lw a1,60(sp) + +00000838 <.LVL236>: + 838: 40e28533 sub a0,t0,a4 + 83c: 4722 lw a4,8(sp) + 83e: 4686 lw a3,64(sp) + +00000840 <.LBB78>: + 840: 40e30633 sub a2,t1,a4 + 844: 00c334b3 sltu s1,t1,a2 + +00000848 <.LVL238>: + 848: 00a2b733 sltu a4,t0,a0 + 84c: 8e19 sub a2,a2,a4 + +0000084e <.LVL239>: + 84e: c626 sw s1,12(sp) + +00000850 <.LVL240>: + 850: 40f58733 sub a4,a1,a5 + 854: 00e5b3b3 sltu t2,a1,a4 + 858: 00a2fb63 bgeu t0,a0,86e <.L115> + 85c: 42a2 lw t0,8(sp) + 85e: 00629863 bne t0,t1,86e <.L115> + +00000862 <.LVL241>: + 862: 177d add a4,a4,-1 + +00000864 <.L116>: + 864: 40b785b3 sub a1,a5,a1 + +00000868 <.LVL243>: + 868: 0015b313 seqz t1,a1 + 86c: a031 j 878 <.L117> + +0000086e <.L115>: + 86e: 4332 lw t1,12(sp) + +00000870 <.LVL245>: + 870: 40670733 sub a4,a4,t1 + +00000874 <.LVL246>: + 874: 4301 li t1,0 + 876: f4fd bnez s1,864 <.L116> + +00000878 <.L117>: + 878: 8e81 sub a3,a3,s0 + +0000087a <.LVL248>: + 87a: 00736333 or t1,t1,t2 + +0000087e <.LBE77>: + 87e: 5592 lw a1,36(sp) + +00000880 <.LBB79>: + 880: 406686b3 sub a3,a3,t1 + 884: c0b6 sw a3,64(sp) + +00000886 <.LVL250>: + 886: de3a sw a4,60(sp) + +00000888 <.LVL251>: + 888: dc32 sw a2,56(sp) + +0000088a <.LVL252>: + 88a: da2a sw a0,52(sp) + +0000088c <.LBE79>: + 88c: c4059ce3 bnez a1,4e4 <.L69> + 890: 5582 lw a1,32(sp) + 892: 00a59963 bne a1,a0,8a4 <.L118> + 896: 45a2 lw a1,8(sp) + 898: 00b61663 bne a2,a1,8a4 <.L118> + 89c: 00e79463 bne a5,a4,8a4 <.L118> + 8a0: 00d40663 beq s0,a3,8ac <.L121> + +000008a4 <.L118>: + 8a4: 47d6 lw a5,84(sp) + +000008a6 <.LVL254>: + 8a6: 0017e793 or a5,a5,1 + 8aa: cabe sw a5,84(sp) + +000008ac <.L121>: + 8ac: 5722 lw a4,40(sp) + 8ae: 6791 lui a5,0x4 + 8b0: 17fd add a5,a5,-1 # 3fff <.LLST129+0x27e9> + 8b2: 97ba add a5,a5,a4 + +000008b4 <.LVL256>: + 8b4: 10f05363 blez a5,9ba <.L123> + 8b8: 4756 lw a4,84(sp) + 8ba: 00777693 and a3,a4,7 + 8be: c69d beqz a3,8ec <.L124> + 8c0: 00f77693 and a3,a4,15 + 8c4: 4611 li a2,4 + 8c6: 02c68363 beq a3,a2,8ec <.L124> + +000008ca <.LBB81>: + 8ca: 0711 add a4,a4,4 + 8cc: 00473693 sltiu a3,a4,4 + 8d0: caba sw a4,84(sp) + +000008d2 <.LVL257>: + 8d2: 4766 lw a4,88(sp) + +000008d4 <.LVL258>: + 8d4: 9736 add a4,a4,a3 + 8d6: ccba sw a4,88(sp) + +000008d8 <.LVL259>: + 8d8: 00d73733 sltu a4,a4,a3 + +000008dc <.LVL260>: + 8dc: 46f6 lw a3,92(sp) + 8de: 9736 add a4,a4,a3 + +000008e0 <.LVL261>: + 8e0: ceba sw a4,92(sp) + +000008e2 <.LVL262>: + 8e2: 00d73733 sltu a4,a4,a3 + +000008e6 <.LVL263>: + 8e6: 5686 lw a3,96(sp) + 8e8: 9736 add a4,a4,a3 + +000008ea <.LVL264>: + 8ea: d0ba sw a4,96(sp) + +000008ec <.L124>: + 8ec: 5706 lw a4,96(sp) + 8ee: 001006b7 lui a3,0x100 + 8f2: 8ef9 and a3,a3,a4 + 8f4: ca89 beqz a3,906 <.L129> + 8f6: fff007b7 lui a5,0xfff00 + +000008fa <.LVL266>: + 8fa: 17fd add a5,a5,-1 # ffefffff <.LLST129+0xffefe7e9> + 8fc: 8f7d and a4,a4,a5 + 8fe: d0ba sw a4,96(sp) + 900: 5722 lw a4,40(sp) + 902: 6791 lui a5,0x4 + +00000904 <.LVL267>: + 904: 97ba add a5,a5,a4 + +00000906 <.L129>: + 906: 08d8 add a4,sp,84 + 908: 108c add a1,sp,96 + +0000090a <.L130>: + 90a: 4314 lw a3,0(a4) + 90c: 4350 lw a2,4(a4) + 90e: 828d srl a3,a3,0x3 + 910: 0676 sll a2,a2,0x1d + 912: 8ed1 or a3,a3,a2 + 914: c314 sw a3,0(a4) + 916: 0711 add a4,a4,4 + 918: feb719e3 bne a4,a1,90a <.L130> + +0000091c <.LBE82>: + 91c: 66a1 lui a3,0x8 + 91e: ffe68613 add a2,a3,-2 # 7ffe <.LLST129+0x67e8> + +00000922 <.LBB83>: + 922: 5706 lw a4,96(sp) + +00000924 <.LBE83>: + 924: 08f64463 blt a2,a5,9ac <.L131> + +00000928 <.LBB84>: + 928: 830d srl a4,a4,0x3 + 92a: d0ba sw a4,96(sp) + +0000092c <.L132>: + 92c: 4702 lw a4,0(sp) + 92e: 45d6 lw a1,84(sp) + 930: 4666 lw a2,88(sp) + 932: 46f6 lw a3,92(sp) + 934: 4502 lw a0,0(sp) + 936: c30c sw a1,0(a4) + 938: c350 sw a2,4(a4) + 93a: c714 sw a3,8(a4) + 93c: 5706 lw a4,96(sp) + +0000093e <.LBE85>: + 93e: 40ea lw ra,152(sp) + 940: 445a lw s0,148(sp) + +00000942 <.LBB86>: + 942: 00e51623 sh a4,12(a0) + 946: 4772 lw a4,28(sp) + +00000948 <.LBE86>: + 948: 44ca lw s1,144(sp) + +0000094a <.LBB87>: + 94a: 073e sll a4,a4,0xf + 94c: 8fd9 or a5,a5,a4 + +0000094e <.LVL272>: + 94e: 00f51723 sh a5,14(a0) + +00000952 <.LBE87>: + 952: 4762 lw a4,24(sp) + +00000954 <.LBB88>: + 954: 455c lw a5,12(a0) + +00000956 <.LBE88>: + 956: c30c sw a1,0(a4) + 958: c350 sw a2,4(a4) + 95a: c714 sw a3,8(a4) + 95c: c75c sw a5,12(a4) + 95e: 853a mv a0,a4 + 960: 09c10113 add sp,sp,156 + +00000964 <.LVL274>: + 964: 8082 ret + +00000966 <.L37>: + 966: 47c2 lw a5,16(sp) + 968: ce3e sw a5,28(sp) + +0000096a <.LBE89>: + 96a: 57d2 lw a5,52(sp) + 96c: cabe sw a5,84(sp) + 96e: 57e2 lw a5,56(sp) + 970: ccbe sw a5,88(sp) + 972: 57f2 lw a5,60(sp) + 974: cebe sw a5,92(sp) + 976: 4786 lw a5,64(sp) + +00000978 <.L122>: + 978: d0be sw a5,96(sp) + +0000097a <.LVL278>: + 97a: 4785 li a5,1 + 97c: 18f70c63 beq a4,a5,b14 <.L202> + 980: d715 beqz a4,8ac <.L121> + 982: 4789 li a5,2 + 984: 18f71d63 bne a4,a5,b1e <.L35> + +00000988 <.L39>: + 988: 67a1 lui a5,0x8 + 98a: d082 sw zero,96(sp) + 98c: ce82 sw zero,92(sp) + 98e: cc82 sw zero,88(sp) + 990: ca82 sw zero,84(sp) + 992: 17fd add a5,a5,-1 # 7fff <.LLST129+0x67e9> + 994: bf61 j 92c <.L132> + +00000996 <.L38>: + 996: 47b2 lw a5,12(sp) + +00000998 <.LBE90>: + 998: 8736 mv a4,a3 + +0000099a <.LBB91>: + 99a: ce3e sw a5,28(sp) + +0000099c <.LBE91>: + 99c: 4796 lw a5,68(sp) + 99e: cabe sw a5,84(sp) + 9a0: 47a6 lw a5,72(sp) + 9a2: ccbe sw a5,88(sp) + 9a4: 47b6 lw a5,76(sp) + 9a6: cebe sw a5,92(sp) + 9a8: 47c6 lw a5,80(sp) + +000009aa <.LVL282>: + 9aa: b7f9 j 978 <.L122> + +000009ac <.L131>: + 9ac: d082 sw zero,96(sp) + 9ae: ce82 sw zero,92(sp) + 9b0: cc82 sw zero,88(sp) + 9b2: ca82 sw zero,84(sp) + 9b4: fff68793 add a5,a3,-1 + 9b8: bf95 j 92c <.L132> + +000009ba <.L123>: + 9ba: 4705 li a4,1 + 9bc: c791 beqz a5,9c8 <.L133> + 9be: 8f1d sub a4,a4,a5 + +000009c0 <.LVL285>: + 9c0: 07400793 li a5,116 + 9c4: 14e7c063 blt a5,a4,b04 <.L134> + +000009c8 <.L133>: + 9c8: 08d4 add a3,sp,84 + 9ca: 40575513 sra a0,a4,0x5 + +000009ce <.LVL287>: + 9ce: 85b6 mv a1,a3 + 9d0: 8b7d and a4,a4,31 + +000009d2 <.LVL288>: + 9d2: 4781 li a5,0 + 9d4: 4601 li a2,0 + +000009d6 <.L135>: + 9d6: 02a61563 bne a2,a0,a00 <.L136> + 9da: 460d li a2,3 + +000009dc <.LVL290>: + 9dc: 8e09 sub a2,a2,a0 + 9de: 00251313 sll t1,a0,0x2 + 9e2: e715 bnez a4,a0e <.L137> + 9e4: 85b6 mv a1,a3 + +000009e6 <.L138>: + 9e6: 006582b3 add t0,a1,t1 + 9ea: 0002a283 lw t0,0(t0) + 9ee: 0705 add a4,a4,1 + +000009f0 <.LVL292>: + 9f0: 0055a023 sw t0,0(a1) + +000009f4 <.LVL293>: + 9f4: 0591 add a1,a1,4 + 9f6: fee658e3 bge a2,a4,9e6 <.L138> + 9fa: 4591 li a1,4 + 9fc: 8d89 sub a1,a1,a0 + 9fe: a0b9 j a4c <.L142> + +00000a00 <.L136>: + a00: 0005a303 lw t1,0(a1) + a04: 0605 add a2,a2,1 + +00000a06 <.LVL295>: + a06: 0591 add a1,a1,4 + a08: 0067e7b3 or a5,a5,t1 + +00000a0c <.LVL296>: + a0c: b7e9 j 9d6 <.L135> + +00000a0e <.L137>: + a0e: 1840 add s0,sp,52 + a10: 05c30593 add a1,t1,92 + a14: 95a2 add a1,a1,s0 + a16: fc45a583 lw a1,-60(a1) + a1a: 02000293 li t0,32 + a1e: 40e282b3 sub t0,t0,a4 + a22: 005595b3 sll a1,a1,t0 + a26: 8fcd or a5,a5,a1 + +00000a28 <.LVL298>: + a28: 08cc add a1,sp,84 + a2a: 959a add a1,a1,t1 + a2c: 8436 mv s0,a3 + a2e: 4381 li t2,0 + +00000a30 <.L140>: + a30: 08c3cb63 blt t2,a2,ac6 <.L141> + a34: 4591 li a1,4 + a36: 060a sll a2,a2,0x2 + a38: 8d89 sub a1,a1,a0 + +00000a3a <.LVL300>: + a3a: 05c60613 add a2,a2,92 + a3e: 1848 add a0,sp,52 + +00000a40 <.LVL301>: + a40: 962a add a2,a2,a0 + a42: 5506 lw a0,96(sp) + a44: 00e55733 srl a4,a0,a4 + +00000a48 <.LVL302>: + a48: fce62223 sw a4,-60(a2) + +00000a4c <.L142>: + a4c: 4711 li a4,4 + a4e: 8f0d sub a4,a4,a1 + a50: 08d0 add a2,sp,84 + a52: 058a sll a1,a1,0x2 + a54: 95b2 add a1,a1,a2 + a56: 070a sll a4,a4,0x2 + a58: 4621 li a2,8 + a5a: 00c76863 bltu a4,a2,a6a <.L143> + a5e: 0005a023 sw zero,0(a1) + a62: 0005a223 sw zero,4(a1) + a66: 1761 add a4,a4,-8 + a68: 05a1 add a1,a1,8 + +00000a6a <.L143>: + a6a: 4611 li a2,4 + a6c: 00c76463 bltu a4,a2,a74 <.L144> + a70: 0005a023 sw zero,0(a1) + +00000a74 <.L144>: + a74: 4756 lw a4,84(sp) + +00000a76 <.LBB95>: + a76: 00f037b3 snez a5,a5 + +00000a7a <.LBE95>: + a7a: 8fd9 or a5,a5,a4 + a7c: cabe sw a5,84(sp) + +00000a7e <.LBE93>: + a7e: 0077f713 and a4,a5,7 + a82: c71d beqz a4,ab0 <.L145> + a84: 00f7f713 and a4,a5,15 + a88: 4611 li a2,4 + a8a: 02c70363 beq a4,a2,ab0 <.L145> + +00000a8e <.LBB97>: + a8e: 4766 lw a4,88(sp) + a90: 0791 add a5,a5,4 + a92: cabe sw a5,84(sp) + +00000a94 <.LVL305>: + a94: 0047b793 sltiu a5,a5,4 + +00000a98 <.LVL306>: + a98: 97ba add a5,a5,a4 + a9a: ccbe sw a5,88(sp) + +00000a9c <.LVL307>: + a9c: 00e7b7b3 sltu a5,a5,a4 + +00000aa0 <.LVL308>: + aa0: 4776 lw a4,92(sp) + aa2: 97ba add a5,a5,a4 + +00000aa4 <.LVL309>: + aa4: cebe sw a5,92(sp) + +00000aa6 <.LVL310>: + aa6: 00e7b7b3 sltu a5,a5,a4 + +00000aaa <.LVL311>: + aaa: 5706 lw a4,96(sp) + aac: 97ba add a5,a5,a4 + +00000aae <.LVL312>: + aae: d0be sw a5,96(sp) + +00000ab0 <.L145>: + ab0: 5706 lw a4,96(sp) + ab2: 000807b7 lui a5,0x80 + ab6: 8ff9 and a5,a5,a4 + ab8: c795 beqz a5,ae4 <.L150> + +00000aba <.LVL314>: + aba: d082 sw zero,96(sp) + abc: ce82 sw zero,92(sp) + abe: cc82 sw zero,88(sp) + ac0: ca82 sw zero,84(sp) + ac2: 4785 li a5,1 + ac4: b5a5 j 92c <.L132> + +00000ac6 <.L141>: + ac6: 0005a303 lw t1,0(a1) + aca: 41c4 lw s1,4(a1) + acc: 0385 add t2,t2,1 + +00000ace <.LVL316>: + ace: 00e35333 srl t1,t1,a4 + ad2: 005494b3 sll s1,s1,t0 + ad6: 00936333 or t1,t1,s1 + ada: 00642023 sw t1,0(s0) + +00000ade <.LVL317>: + ade: 0591 add a1,a1,4 + ae0: 0411 add s0,s0,4 + ae2: b7b9 j a30 <.L140> + +00000ae4 <.L150>: + ae4: 00c68613 add a2,a3,12 + +00000ae8 <.L151>: + ae8: 429c lw a5,0(a3) + aea: 42d8 lw a4,4(a3) + aec: 838d srl a5,a5,0x3 + aee: 0776 sll a4,a4,0x1d + af0: 8fd9 or a5,a5,a4 + af2: c29c sw a5,0(a3) + af4: 0691 add a3,a3,4 + af6: fed619e3 bne a2,a3,ae8 <.L151> + +00000afa <.LVL319>: + afa: 5786 lw a5,96(sp) + afc: 838d srl a5,a5,0x3 + afe: d0be sw a5,96(sp) + +00000b00 <.L152>: + b00: 4781 li a5,0 + b02: b52d j 92c <.L132> + +00000b04 <.L134>: + b04: 4766 lw a4,88(sp) + b06: 47d6 lw a5,84(sp) + b08: 8fd9 or a5,a5,a4 + b0a: 4776 lw a4,92(sp) + b0c: 8fd9 or a5,a5,a4 + b0e: 5706 lw a4,96(sp) + b10: 8fd9 or a5,a5,a4 + b12: d7fd beqz a5,b00 <.L152> + +00000b14 <.L202>: + b14: d082 sw zero,96(sp) + b16: ce82 sw zero,92(sp) + b18: cc82 sw zero,88(sp) + +00000b1a <.LBB100>: + b1a: ca82 sw zero,84(sp) + b1c: b7d5 j b00 <.L152> + +00000b1e <.L35>: + b1e: 67a1 lui a5,0x8 + b20: d0be sw a5,96(sp) + b22: ce82 sw zero,92(sp) + b24: cc82 sw zero,88(sp) + b26: ca82 sw zero,84(sp) + +00000b28 <.LVL325>: + b28: 17fd add a5,a5,-1 # 7fff <.LLST129+0x67e9> + b2a: ce02 sw zero,28(sp) + b2c: b501 j 92c <.L132> + +eqtf2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__eqtf2>: + 0: 4514 lw a3,8(a0) + 2: 7179 add sp,sp,-48 + 4: 4550 lw a2,12(a0) + 6: c036 sw a3,0(sp) + 8: 45d4 lw a3,12(a1) + a: d622 sw s0,44(sp) + c: d426 sw s1,40(sp) + e: 4180 lw s0,0(a1) + 10: 0045a383 lw t2,4(a1) + 14: 0085a283 lw t0,8(a1) + +00000018 <.LBB3>: + 18: 01061493 sll s1,a2,0x10 + 1c: 01065313 srl t1,a2,0x10 + 20: 827d srl a2,a2,0x1f + +00000022 <.LBE3>: + 22: 4118 lw a4,0(a0) + +00000024 <.LBB4>: + 24: 415c lw a5,4(a0) + +00000026 <.LBB5>: + 26: 65a1 lui a1,0x8 + +00000028 <.LBE5>: + 28: 01b10513 add a0,sp,27 + +0000002c <.LBB6>: + 2c: c232 sw a2,4(sp) + +0000002e <.LBB7>: + 2e: 01069613 sll a2,a3,0x10 + +00000032 <.LBE7>: + 32: 9941 and a0,a0,-16 + +00000034 <.LBB8>: + 34: 15fd add a1,a1,-1 # 7fff <.LASF19+0x7e4d> + +00000036 <.LBB9>: + 36: 8241 srl a2,a2,0x10 + 38: c554 sw a3,12(a0) + 3a: c100 sw s0,0(a0) + 3c: 00752223 sw t2,4(a0) + 40: 00552423 sw t0,8(a0) + 44: c432 sw a2,8(sp) + +00000046 <.LBB10>: + 46: 00b37333 and t1,t1,a1 + +0000004a <.LBB11>: + 4a: 0106d613 srl a2,a3,0x10 + +0000004e <.LBB12>: + 4e: 80c1 srl s1,s1,0x10 + +00000050 <.LBB13>: + 50: 8e6d and a2,a2,a1 + 52: 82fd srl a3,a3,0x1f + +00000054 <.LBE13>: + 54: 4505 li a0,1 + 56: 00b30863 beq t1,a1,66 <.L2> + 5a: 02b61a63 bne a2,a1,8e <.L15> + +0000005e <.L1>: + 5e: 5432 lw s0,44(sp) + +00000060 <.LVL7>: + 60: 54a2 lw s1,40(sp) + +00000062 <.LVL8>: + 62: 6145 add sp,sp,48 + +00000064 <.LVL9>: + 64: 8082 ret + +00000066 <.L2>: + 66: fe661ce3 bne a2,t1,5e <.L1> + 6a: 8fd9 or a5,a5,a4 + +0000006c <.LVL11>: + 6c: 4702 lw a4,0(sp) + +0000006e <.LVL12>: + 6e: 8fd9 or a5,a5,a4 + 70: 8fc5 or a5,a5,s1 + 72: 4722 lw a4,8(sp) + 74: 8fc1 or a5,a5,s0 + 76: 0077e7b3 or a5,a5,t2 + 7a: 0057e7b3 or a5,a5,t0 + 7e: 8fd9 or a5,a5,a4 + 80: fff9 bnez a5,5e <.L1> + 82: 4792 lw a5,4(sp) + 84: 40d78533 sub a0,a5,a3 + 88: 00a03533 snez a0,a0 + 8c: bfc9 j 5e <.L1> + +0000008e <.L15>: + 8e: 4505 li a0,1 + 90: fc6617e3 bne a2,t1,5e <.L1> + 94: fc8715e3 bne a4,s0,5e <.L1> + 98: fc7793e3 bne a5,t2,5e <.L1> + 9c: 4582 lw a1,0(sp) + 9e: fc5590e3 bne a1,t0,5e <.L1> + a2: 45a2 lw a1,8(sp) + a4: fab49de3 bne s1,a1,5e <.L1> + a8: 4592 lw a1,4(sp) + aa: 00d58a63 beq a1,a3,be <.L13> + ae: fa45 bnez a2,5e <.L1> + b0: 8f5d or a4,a4,a5 + +000000b2 <.LVL14>: + b2: 4782 lw a5,0(sp) + +000000b4 <.LVL15>: + b4: 8f5d or a4,a4,a5 + b6: 8f45 or a4,a4,s1 + b8: 00e03533 snez a0,a4 + bc: b74d j 5e <.L1> + +000000be <.L13>: + be: 4501 li a0,0 + c0: bf79 j 5e <.L1> + +getf2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__getf2>: + 0: 411c lw a5,0(a0) + 2: 7179 add sp,sp,-48 + +00000004 <.LBB3>: + 4: 4558 lw a4,12(a0) + 6: c03e sw a5,0(sp) + +00000008 <.LVL2>: + 8: 415c lw a5,4(a0) + a: 45d4 lw a3,12(a1) + c: 0045a303 lw t1,4(a1) + 10: c23e sw a5,4(sp) + +00000012 <.LVL3>: + 12: 451c lw a5,8(a0) + 14: 0085a283 lw t0,8(a1) + 18: 01b10513 add a0,sp,27 + 1c: c43e sw a5,8(sp) + +0000001e <.LVL4>: + 1e: 419c lw a5,0(a1) + +00000020 <.LBB4>: + 20: 6621 lui a2,0x8 + +00000022 <.LBE4>: + 22: d426 sw s1,40(sp) + 24: 9941 and a0,a0,-16 + 26: d622 sw s0,44(sp) + +00000028 <.LBB5>: + 28: 01075593 srl a1,a4,0x10 + 2c: 167d add a2,a2,-1 # 7fff <.LLST9+0x7ce7> + 2e: 01071493 sll s1,a4,0x10 + +00000032 <.LBB6>: + 32: c554 sw a3,12(a0) + 34: 01069393 sll t2,a3,0x10 + 38: c11c sw a5,0(a0) + 3a: 00652223 sw t1,4(a0) + 3e: 00552423 sw t0,8(a0) + +00000042 <.LBB7>: + 42: 8df1 and a1,a1,a2 + +00000044 <.LBB8>: + 44: 0106d513 srl a0,a3,0x10 + +00000048 <.LBB9>: + 48: 80c1 srl s1,s1,0x10 + +0000004a <.LVL5>: + 4a: 837d srl a4,a4,0x1f + +0000004c <.LBB10>: + 4c: 0103d393 srl t2,t2,0x10 + +00000050 <.LVL7>: + 50: 8d71 and a0,a0,a2 + +00000052 <.LVL8>: + 52: 82fd srl a3,a3,0x1f + +00000054 <.LBE10>: + 54: 02c59e63 bne a1,a2,90 <.L2> + 58: 4402 lw s0,0(sp) + 5a: 4612 lw a2,4(sp) + 5c: 8e41 or a2,a2,s0 + 5e: 4422 lw s0,8(sp) + 60: 8e41 or a2,a2,s0 + 62: 8e45 or a2,a2,s1 + 64: e279 bnez a2,12a <.L26> + 66: 00b50663 beq a0,a1,72 <.L4> + +0000006a <.L21>: + 6a: 4505 li a0,1 + 6c: cf11 beqz a4,88 <.L1> + 6e: 557d li a0,-1 + 70: a821 j 88 <.L1> + +00000072 <.L4>: + 72: 0067e7b3 or a5,a5,t1 + +00000076 <.LVL12>: + 76: 0057e7b3 or a5,a5,t0 + 7a: 0077e7b3 or a5,a5,t2 + 7e: 5579 li a0,-2 + +00000080 <.LVL13>: + 80: e781 bnez a5,88 <.L1> + +00000082 <.LBB12>: + 82: 4501 li a0,0 + 84: fee693e3 bne a3,a4,6a <.L21> + +00000088 <.L1>: + 88: 5432 lw s0,44(sp) + 8a: 54a2 lw s1,40(sp) + +0000008c <.LVL15>: + 8c: 6145 add sp,sp,48 + +0000008e <.LVL16>: + 8e: 8082 ret + +00000090 <.L2>: + 90: 02c51063 bne a0,a2,b0 <.L10> + 94: 0067e633 or a2,a5,t1 + 98: 00566633 or a2,a2,t0 + 9c: 00766633 or a2,a2,t2 + a0: e649 bnez a2,12a <.L26> + +000000a2 <.LBB13>: + a2: c185 beqz a1,c2 <.L11> + +000000a4 <.LVL18>: + a4: fce693e3 bne a3,a4,6a <.L21> + +000000a8 <.L22>: + a8: 557d li a0,-1 + aa: df79 beqz a4,88 <.L1> + ac: 853a mv a0,a4 + ae: bfe9 j 88 <.L1> + +000000b0 <.L10>: + b0: c585 beqz a1,d8 <.L13> + +000000b2 <.LVL21>: + b2: dd45 beqz a0,6a <.L21> + +000000b4 <.L14>: + b4: fae69be3 bne a3,a4,6a <.L21> + b8: fab549e3 blt a0,a1,6a <.L21> + bc: 02a5df63 bge a1,a0,fa <.L18> + c0: b7e5 j a8 <.L22> + +000000c2 <.L11>: + c2: 4402 lw s0,0(sp) + c4: 4612 lw a2,4(sp) + c6: 8e41 or a2,a2,s0 + c8: 4422 lw s0,8(sp) + ca: 8e41 or a2,a2,s0 + cc: 8e45 or a2,a2,s1 + +000000ce <.L15>: + ce: f27d bnez a2,b4 <.L14> + +000000d0 <.L17>: + d0: 557d li a0,-1 + +000000d2 <.LVL25>: + d2: dadd beqz a3,88 <.L1> + d4: 8536 mv a0,a3 + d6: bf4d j 88 <.L1> + +000000d8 <.L13>: + d8: 4402 lw s0,0(sp) + da: 4612 lw a2,4(sp) + dc: 8e41 or a2,a2,s0 + de: 4422 lw s0,8(sp) + e0: 8e41 or a2,a2,s0 + e2: 8e45 or a2,a2,s1 + +000000e4 <.LVL27>: + e4: f56d bnez a0,ce <.L15> + e6: 0067e5b3 or a1,a5,t1 + +000000ea <.LVL28>: + ea: 0055e5b3 or a1,a1,t0 + ee: 0075e5b3 or a1,a1,t2 + f2: c995 beqz a1,126 <.L16> + +000000f4 <.LVL29>: + f4: de71 beqz a2,d0 <.L17> + +000000f6 <.LVL30>: + f6: f6e69ae3 bne a3,a4,6a <.L21> + +000000fa <.L18>: + fa: f693e8e3 bltu t2,s1,6a <.L21> + fe: fa7495e3 bne s1,t2,a8 <.L22> + 102: 46a2 lw a3,8(sp) + +00000104 <.LVL31>: + 104: f6d2e3e3 bltu t0,a3,6a <.L21> + 108: fa5690e3 bne a3,t0,a8 <.L22> + 10c: 4692 lw a3,4(sp) + 10e: f4d36ee3 bltu t1,a3,6a <.L21> + 112: f8669be3 bne a3,t1,a8 <.L22> + 116: 4682 lw a3,0(sp) + 118: f4d7e9e3 bltu a5,a3,6a <.L21> + 11c: 4682 lw a3,0(sp) + 11e: 4501 li a0,0 + +00000120 <.LVL32>: + 120: f8f6e4e3 bltu a3,a5,a8 <.L22> + 124: b795 j 88 <.L1> + +00000126 <.L16>: + 126: d22d beqz a2,88 <.L1> + 128: b789 j 6a <.L21> + +0000012a <.L26>: + 12a: 5579 li a0,-2 + +0000012c <.LVL35>: + 12c: bfb1 j 88 <.L1> + +letf2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__letf2>: + 0: 411c lw a5,0(a0) + 2: 7179 add sp,sp,-48 + +00000004 <.LBB3>: + 4: 4558 lw a4,12(a0) + 6: c03e sw a5,0(sp) + +00000008 <.LVL2>: + 8: 415c lw a5,4(a0) + a: 45d4 lw a3,12(a1) + c: 0045a303 lw t1,4(a1) + 10: c23e sw a5,4(sp) + +00000012 <.LVL3>: + 12: 451c lw a5,8(a0) + 14: 0085a283 lw t0,8(a1) + 18: 01b10513 add a0,sp,27 + 1c: c43e sw a5,8(sp) + +0000001e <.LVL4>: + 1e: 419c lw a5,0(a1) + +00000020 <.LBB4>: + 20: 6621 lui a2,0x8 + +00000022 <.LBE4>: + 22: d426 sw s1,40(sp) + 24: 9941 and a0,a0,-16 + 26: d622 sw s0,44(sp) + +00000028 <.LBB5>: + 28: 01075593 srl a1,a4,0x10 + 2c: 167d add a2,a2,-1 # 7fff <.LLST9+0x7ce7> + 2e: 01071493 sll s1,a4,0x10 + +00000032 <.LBB6>: + 32: c554 sw a3,12(a0) + 34: 01069393 sll t2,a3,0x10 + 38: c11c sw a5,0(a0) + 3a: 00652223 sw t1,4(a0) + 3e: 00552423 sw t0,8(a0) + +00000042 <.LBB7>: + 42: 8df1 and a1,a1,a2 + +00000044 <.LBB8>: + 44: 0106d513 srl a0,a3,0x10 + +00000048 <.LBB9>: + 48: 80c1 srl s1,s1,0x10 + +0000004a <.LVL5>: + 4a: 837d srl a4,a4,0x1f + +0000004c <.LBB10>: + 4c: 0103d393 srl t2,t2,0x10 + +00000050 <.LVL7>: + 50: 8d71 and a0,a0,a2 + +00000052 <.LVL8>: + 52: 82fd srl a3,a3,0x1f + +00000054 <.LBE10>: + 54: 02c59e63 bne a1,a2,90 <.L2> + 58: 4402 lw s0,0(sp) + 5a: 4612 lw a2,4(sp) + 5c: 8e41 or a2,a2,s0 + 5e: 4422 lw s0,8(sp) + 60: 8e41 or a2,a2,s0 + 62: 8e45 or a2,a2,s1 + 64: e279 bnez a2,12a <.L26> + 66: 00b50663 beq a0,a1,72 <.L4> + +0000006a <.L21>: + 6a: 4505 li a0,1 + 6c: cf11 beqz a4,88 <.L1> + 6e: 557d li a0,-1 + 70: a821 j 88 <.L1> + +00000072 <.L4>: + 72: 0067e7b3 or a5,a5,t1 + +00000076 <.LVL12>: + 76: 0057e7b3 or a5,a5,t0 + 7a: 0077e7b3 or a5,a5,t2 + 7e: 4509 li a0,2 + +00000080 <.LVL13>: + 80: e781 bnez a5,88 <.L1> + +00000082 <.LBB12>: + 82: 4501 li a0,0 + 84: fee693e3 bne a3,a4,6a <.L21> + +00000088 <.L1>: + 88: 5432 lw s0,44(sp) + 8a: 54a2 lw s1,40(sp) + +0000008c <.LVL15>: + 8c: 6145 add sp,sp,48 + +0000008e <.LVL16>: + 8e: 8082 ret + +00000090 <.L2>: + 90: 02c51063 bne a0,a2,b0 <.L10> + 94: 0067e633 or a2,a5,t1 + 98: 00566633 or a2,a2,t0 + 9c: 00766633 or a2,a2,t2 + a0: e649 bnez a2,12a <.L26> + +000000a2 <.LBB13>: + a2: c185 beqz a1,c2 <.L11> + +000000a4 <.LVL18>: + a4: fce693e3 bne a3,a4,6a <.L21> + +000000a8 <.L22>: + a8: 557d li a0,-1 + aa: df79 beqz a4,88 <.L1> + ac: 853a mv a0,a4 + ae: bfe9 j 88 <.L1> + +000000b0 <.L10>: + b0: c585 beqz a1,d8 <.L13> + +000000b2 <.LVL21>: + b2: dd45 beqz a0,6a <.L21> + +000000b4 <.L14>: + b4: fae69be3 bne a3,a4,6a <.L21> + b8: fab549e3 blt a0,a1,6a <.L21> + bc: 02a5df63 bge a1,a0,fa <.L18> + c0: b7e5 j a8 <.L22> + +000000c2 <.L11>: + c2: 4402 lw s0,0(sp) + c4: 4612 lw a2,4(sp) + c6: 8e41 or a2,a2,s0 + c8: 4422 lw s0,8(sp) + ca: 8e41 or a2,a2,s0 + cc: 8e45 or a2,a2,s1 + +000000ce <.L15>: + ce: f27d bnez a2,b4 <.L14> + +000000d0 <.L17>: + d0: 557d li a0,-1 + +000000d2 <.LVL25>: + d2: dadd beqz a3,88 <.L1> + d4: 8536 mv a0,a3 + d6: bf4d j 88 <.L1> + +000000d8 <.L13>: + d8: 4402 lw s0,0(sp) + da: 4612 lw a2,4(sp) + dc: 8e41 or a2,a2,s0 + de: 4422 lw s0,8(sp) + e0: 8e41 or a2,a2,s0 + e2: 8e45 or a2,a2,s1 + +000000e4 <.LVL27>: + e4: f56d bnez a0,ce <.L15> + e6: 0067e5b3 or a1,a5,t1 + +000000ea <.LVL28>: + ea: 0055e5b3 or a1,a1,t0 + ee: 0075e5b3 or a1,a1,t2 + f2: c995 beqz a1,126 <.L16> + +000000f4 <.LVL29>: + f4: de71 beqz a2,d0 <.L17> + +000000f6 <.LVL30>: + f6: f6e69ae3 bne a3,a4,6a <.L21> + +000000fa <.L18>: + fa: f693e8e3 bltu t2,s1,6a <.L21> + fe: fa7495e3 bne s1,t2,a8 <.L22> + 102: 46a2 lw a3,8(sp) + +00000104 <.LVL31>: + 104: f6d2e3e3 bltu t0,a3,6a <.L21> + 108: fa5690e3 bne a3,t0,a8 <.L22> + 10c: 4692 lw a3,4(sp) + 10e: f4d36ee3 bltu t1,a3,6a <.L21> + 112: f8669be3 bne a3,t1,a8 <.L22> + 116: 4682 lw a3,0(sp) + 118: f4d7e9e3 bltu a5,a3,6a <.L21> + 11c: 4682 lw a3,0(sp) + 11e: 4501 li a0,0 + +00000120 <.LVL32>: + 120: f8f6e4e3 bltu a3,a5,a8 <.L22> + 124: b795 j 88 <.L1> + +00000126 <.L16>: + 126: d22d beqz a2,88 <.L1> + 128: b789 j 6a <.L21> + +0000012a <.L26>: + 12a: 4509 li a0,2 + +0000012c <.LVL35>: + 12c: bfb1 j 88 <.L1> + +multf3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__multf3>: + 0: 4218 lw a4,0(a2) + 2: f3c10113 add sp,sp,-196 + 6: 419c lw a5,0(a1) + 8: c43a sw a4,8(sp) + a: 4618 lw a4,8(a2) + c: 4594 lw a3,8(a1) + e: cc2a sw a0,24(sp) + 10: c23a sw a4,4(sp) + 12: 4658 lw a4,12(a2) + 14: 41c8 lw a0,4(a1) + 16: 45cc lw a1,12(a1) + 18: c63a sw a4,12(sp) + 1a: 0ab10713 add a4,sp,171 + 1e: 9b41 and a4,a4,-16 + 20: df22 sw s0,188(sp) + 22: dd26 sw s1,184(sp) + 24: c186 sw ra,192(sp) + +00000026 <.LBB3>: + 26: c74c sw a1,12(a4) + +00000028 <.LBE3>: + 28: 4244 lw s1,4(a2) + 2a: c03a sw a4,0(sp) + +0000002c <.LBB4>: + 2c: c31c sw a5,0(a4) + 2e: c348 sw a0,4(a4) + 30: c714 sw a3,8(a4) + 32: 6621 lui a2,0x8 + 34: 01059713 sll a4,a1,0x10 + 38: 0105d413 srl s0,a1,0x10 + 3c: 8341 srl a4,a4,0x10 + 3e: 167d add a2,a2,-1 # 7fff <.LLST246+0x5acb> + 40: 81fd srl a1,a1,0x1f + 42: c6be sw a5,76(sp) + 44: c8aa sw a0,80(sp) + 46: cab6 sw a3,84(sp) + 48: ccba sw a4,88(sp) + 4a: 8c71 and s0,s0,a2 + +0000004c <.LVL2>: + 4c: c82e sw a1,16(sp) + +0000004e <.LBE4>: + 4e: 28040de3 beqz s0,ae8 <.L2> + 52: 38c40de3 beq s0,a2,bec <.L3> + 56: 67c1 lui a5,0x10 + 58: 8fd9 or a5,a5,a4 + 5a: ccbe sw a5,88(sp) + +0000005c <.LBB5>: + 5c: 0090 add a2,sp,64 + 5e: 00fc add a5,sp,76 + +00000060 <.L4>: + 60: 47d8 lw a4,12(a5) + 62: 4794 lw a3,8(a5) + 64: 17f1 add a5,a5,-4 # fffc <.LLST246+0xdac8> + 66: 070e sll a4,a4,0x3 + 68: 82f5 srl a3,a3,0x1d + 6a: 8f55 or a4,a4,a3 + 6c: cb98 sw a4,16(a5) + 6e: fef619e3 bne a2,a5,60 <.L4> + +00000072 <.LVL6>: + 72: 47b6 lw a5,76(sp) + 74: 078e sll a5,a5,0x3 + 76: c6be sw a5,76(sp) + +00000078 <.LBE5>: + 78: 77f1 lui a5,0xffffc + 7a: 0785 add a5,a5,1 # ffffc001 <.LLST246+0xffff9acd> + 7c: 943e add s0,s0,a5 + +0000007e <.L205>: + 7e: 4701 li a4,0 + +00000080 <.L5>: + 80: 4782 lw a5,0(sp) + 82: 46a2 lw a3,8(sp) + 84: 4632 lw a2,12(sp) + 86: c3c4 sw s1,4(a5) + 88: c394 sw a3,0(a5) + 8a: 4692 lw a3,4(sp) + 8c: 00c15503 lhu a0,12(sp) + 90: 827d srl a2,a2,0x1f + 92: c794 sw a3,8(a5) + 94: 46b2 lw a3,12(sp) + 96: d0a6 sw s1,96(sp) + 98: d4aa sw a0,104(sp) + 9a: c7d4 sw a3,12(a5) + 9c: 47a2 lw a5,8(sp) + 9e: c632 sw a2,12(sp) + a0: cebe sw a5,92(sp) + a2: 4792 lw a5,4(sp) + a4: d2be sw a5,100(sp) + a6: 0106d793 srl a5,a3,0x10 + aa: 66a1 lui a3,0x8 + ac: 16fd add a3,a3,-1 # 7fff <.LLST246+0x5acb> + ae: 8ff5 and a5,a5,a3 + +000000b0 <.LBE11>: + b0: 34078be3 beqz a5,c06 <.L18> + b4: 46d787e3 beq a5,a3,d22 <.L19> + b8: 66c1 lui a3,0x10 + ba: 8ec9 or a3,a3,a0 + bc: d4b6 sw a3,104(sp) + +000000be <.LBB12>: + be: 0888 add a0,sp,80 + c0: 08f4 add a3,sp,92 + +000000c2 <.L20>: + c2: 46d0 lw a2,12(a3) + c4: 468c lw a1,8(a3) + c6: 16f1 add a3,a3,-4 # fffc <.LLST246+0xdac8> + c8: 060e sll a2,a2,0x3 + ca: 81f5 srl a1,a1,0x1d + cc: 8e4d or a2,a2,a1 + ce: ca90 sw a2,16(a3) + d0: fed519e3 bne a0,a3,c2 <.L20> + +000000d4 <.LVL12>: + d4: 46f6 lw a3,92(sp) + d6: 068e sll a3,a3,0x3 + d8: ceb6 sw a3,92(sp) + +000000da <.LBE12>: + da: 76f1 lui a3,0xffffc + dc: 0685 add a3,a3,1 # ffffc001 <.LLST246+0xffff9acd> + de: 97b6 add a5,a5,a3 + +000000e0 <.L207>: + e0: 4681 li a3,0 + +000000e2 <.L21>: + e2: 4642 lw a2,16(sp) + e4: 45b2 lw a1,12(sp) + e6: 97a2 add a5,a5,s0 + +000000e8 <.LVL15>: + e8: d43e sw a5,40(sp) + ea: 0785 add a5,a5,1 + ec: 8e2d xor a2,a2,a1 + ee: d23e sw a5,36(sp) + f0: 00271793 sll a5,a4,0x2 + f4: ce32 sw a2,28(sp) + +000000f6 <.LVL16>: + f6: 8fd5 or a5,a5,a3 + f8: 4629 li a2,10 + +000000fa <.LVL17>: + fa: 46f649e3 blt a2,a5,d6c <.L34> + fe: 4609 li a2,2 + 100: 44f641e3 blt a2,a5,d42 <.L35> + 104: 17fd add a5,a5,-1 + 106: 4705 li a4,1 + 108: 4af772e3 bgeu a4,a5,dac <.L37> + +0000010c <.L36>: + 10c: 47b6 lw a5,76(sp) + 10e: 44f6 lw s1,92(sp) + 110: 62c1 lui t0,0x10 + 112: fff28313 add t1,t0,-1 # ffff <.LLST246+0xdacb> + 116: c23e sw a5,4(sp) + +00000118 <.LVL19>: + 118: 0107d413 srl s0,a5,0x10 + +0000011c <.LVL20>: + 11c: 0067f7b3 and a5,a5,t1 + 120: 0064f333 and t1,s1,t1 + 124: 0104d393 srl t2,s1,0x10 + +00000128 <.LBB21>: + 128: 853e mv a0,a5 + 12a: 859a mv a1,t1 + 12c: 00000097 auipc ra,0x0 + 130: 000080e7 jalr ra # 12c <.LBB21+0x4> + +00000134 <.LVL22>: + 134: 872a mv a4,a0 + +00000136 <.LBB22>: + 136: 859e mv a1,t2 + 138: 853e mv a0,a5 + +0000013a <.LVL24>: + 13a: 00000097 auipc ra,0x0 + 13e: 000080e7 jalr ra # 13a <.LVL24> + 142: 87aa mv a5,a0 + +00000144 <.LBB23>: + 144: 859a mv a1,t1 + 146: 8522 mv a0,s0 + +00000148 <.LVL26>: + 148: 00000097 auipc ra,0x0 + 14c: 000080e7 jalr ra # 148 <.LVL26> + 150: 832a mv t1,a0 + +00000152 <.LBB24>: + 152: 859e mv a1,t2 + 154: 8522 mv a0,s0 + 156: 00000097 auipc ra,0x0 + 15a: 000080e7 jalr ra # 156 <.LBB24+0x4> + +0000015e <.LBE24>: + 15e: 01075693 srl a3,a4,0x10 + 162: 979a add a5,a5,t1 + +00000164 <.LVL29>: + 164: 96be add a3,a3,a5 + +00000166 <.LVL30>: + 166: 0066f363 bgeu a3,t1,16c <.L42> + 16a: 9516 add a0,a0,t0 + +0000016c <.L42>: + 16c: 0106d793 srl a5,a3,0x10 + 170: 97aa add a5,a5,a0 + 172: 6441 lui s0,0x10 + +00000174 <.LVL32>: + 174: c13e sw a5,128(sp) + 176: fff40793 add a5,s0,-1 # ffff <.LLST246+0xdacb> + 17a: 8efd and a3,a3,a5 + +0000017c <.LVL33>: + 17c: 8f7d and a4,a4,a5 + +0000017e <.LVL34>: + 17e: 06c2 sll a3,a3,0x10 + 180: 96ba add a3,a3,a4 + +00000182 <.LBB25>: + 182: 4712 lw a4,4(sp) + +00000184 <.LBB31>: + 184: deb6 sw a3,124(sp) + +00000186 <.LBB32>: + 186: 01075393 srl t2,a4,0x10 + +0000018a <.LVL36>: + 18a: 5706 lw a4,96(sp) + 18c: c43a sw a4,8(sp) + +0000018e <.LVL37>: + 18e: 8341 srl a4,a4,0x10 + 190: c63a sw a4,12(sp) + +00000192 <.LBB26>: + 192: 4712 lw a4,4(sp) + 194: 00f77333 and t1,a4,a5 + +00000198 <.LVL39>: + 198: 4722 lw a4,8(sp) + 19a: 851a mv a0,t1 + +0000019c <.LVL40>: + 19c: 00f772b3 and t0,a4,a5 + 1a0: 8596 mv a1,t0 + 1a2: 00000097 auipc ra,0x0 + 1a6: 000080e7 jalr ra # 1a2 <.LVL40+0x6> + 1aa: 872a mv a4,a0 + +000001ac <.LBB27>: + 1ac: 45b2 lw a1,12(sp) + 1ae: 851a mv a0,t1 + +000001b0 <.LVL42>: + 1b0: 00000097 auipc ra,0x0 + 1b4: 000080e7 jalr ra # 1b0 <.LVL42> + 1b8: 832a mv t1,a0 + +000001ba <.LBB28>: + 1ba: 8596 mv a1,t0 + 1bc: 851e mv a0,t2 + 1be: 00000097 auipc ra,0x0 + 1c2: 000080e7 jalr ra # 1be <.LBB28+0x4> + 1c6: 82aa mv t0,a0 + +000001c8 <.LBB29>: + 1c8: 45b2 lw a1,12(sp) + 1ca: 851e mv a0,t2 + 1cc: 00000097 auipc ra,0x0 + 1d0: 000080e7 jalr ra # 1cc <.LBB29+0x4> + +000001d4 <.LBE29>: + 1d4: 01075693 srl a3,a4,0x10 + 1d8: 9316 add t1,t1,t0 + +000001da <.LBB30>: + 1da: ca2a sw a0,20(sp) + +000001dc <.LBE30>: + 1dc: 9336 add t1,t1,a3 + +000001de <.LVL47>: + 1de: 00537563 bgeu t1,t0,1e8 <.L43> + 1e2: 008506b3 add a3,a0,s0 + 1e6: ca36 sw a3,20(sp) + +000001e8 <.L43>: + 1e8: 01035693 srl a3,t1,0x10 + 1ec: 00f37333 and t1,t1,a5 + +000001f0 <.LVL49>: + 1f0: 0342 sll t1,t1,0x10 + 1f2: 8f7d and a4,a4,a5 + +000001f4 <.LVL50>: + 1f4: 971a add a4,a4,t1 + 1f6: da3a sw a4,52(sp) + +000001f8 <.LBB33>: + 1f8: 4746 lw a4,80(sp) + +000001fa <.LBB38>: + 1fa: d836 sw a3,48(sp) + +000001fc <.LBB39>: + 1fc: c63a sw a4,12(sp) + +000001fe <.LVL52>: + 1fe: 46b2 lw a3,12(sp) + +00000200 <.LVL53>: + 200: 01075293 srl t0,a4,0x10 + +00000204 <.LVL54>: + 204: 0104d713 srl a4,s1,0x10 + +00000208 <.LBB34>: + 208: 00f6f3b3 and t2,a3,a5 + 20c: 8fe5 and a5,a5,s1 + 20e: 851e mv a0,t2 + 210: 85be mv a1,a5 + 212: 00000097 auipc ra,0x0 + 216: 000080e7 jalr ra # 212 <.LBB34+0xa> + 21a: 832a mv t1,a0 + +0000021c <.LBB35>: + 21c: 85ba mv a1,a4 + 21e: 851e mv a0,t2 + 220: 00000097 auipc ra,0x0 + 224: 000080e7 jalr ra # 220 <.LBB35+0x4> + 228: 83aa mv t2,a0 + +0000022a <.LBB36>: + 22a: 85be mv a1,a5 + 22c: 8516 mv a0,t0 + 22e: 00000097 auipc ra,0x0 + 232: 000080e7 jalr ra # 22e <.LBB36+0x4> + 236: 87aa mv a5,a0 + +00000238 <.LBB37>: + 238: 85ba mv a1,a4 + 23a: 8516 mv a0,t0 + +0000023c <.LVL58>: + 23c: 00000097 auipc ra,0x0 + 240: 000080e7 jalr ra # 23c <.LVL58> + +00000244 <.LBE37>: + 244: 01035713 srl a4,t1,0x10 + 248: 93be add t2,t2,a5 + +0000024a <.LVL60>: + 24a: 93ba add t2,t2,a4 + +0000024c <.LVL61>: + 24c: 00f3f463 bgeu t2,a5,254 <.L44> + 250: 67c1 lui a5,0x10 + +00000252 <.LVL62>: + 252: 953e add a0,a0,a5 + +00000254 <.L44>: + 254: 6441 lui s0,0x10 + 256: fff40713 add a4,s0,-1 # ffff <.LLST246+0xdacb> + 25a: 0103d793 srl a5,t2,0x10 + 25e: 00e3f3b3 and t2,t2,a4 + +00000262 <.LVL64>: + 262: 97aa add a5,a5,a0 + 264: 00e37333 and t1,t1,a4 + +00000268 <.LVL65>: + 268: 03c2 sll t2,t2,0x10 + 26a: dc3e sw a5,56(sp) + +0000026c <.LVL66>: + 26c: 006387b3 add a5,t2,t1 + +00000270 <.LVL67>: + 270: de3e sw a5,60(sp) + +00000272 <.LBB40>: + 272: 47b2 lw a5,12(sp) + +00000274 <.LVL69>: + 274: 46a2 lw a3,8(sp) + 276: 0107d393 srl t2,a5,0x10 + +0000027a <.LVL70>: + 27a: 47a2 lw a5,8(sp) + 27c: 0107d293 srl t0,a5,0x10 + +00000280 <.LBB41>: + 280: 47b2 lw a5,12(sp) + 282: 8ff9 and a5,a5,a4 + 284: 8f75 and a4,a4,a3 + 286: 853e mv a0,a5 + +00000288 <.LVL72>: + 288: 85ba mv a1,a4 + 28a: 00000097 auipc ra,0x0 + 28e: 000080e7 jalr ra # 28a <.LVL72+0x2> + 292: 832a mv t1,a0 + +00000294 <.LBB42>: + 294: 8596 mv a1,t0 + 296: 853e mv a0,a5 + 298: 00000097 auipc ra,0x0 + 29c: 000080e7 jalr ra # 298 <.LBB42+0x4> + 2a0: 87aa mv a5,a0 + +000002a2 <.LBB43>: + 2a2: 85ba mv a1,a4 + 2a4: 851e mv a0,t2 + +000002a6 <.LVL75>: + 2a6: 00000097 auipc ra,0x0 + 2aa: 000080e7 jalr ra # 2a6 <.LVL75> + 2ae: 872a mv a4,a0 + +000002b0 <.LBB44>: + 2b0: 8596 mv a1,t0 + 2b2: 851e mv a0,t2 + +000002b4 <.LVL77>: + 2b4: 00000097 auipc ra,0x0 + 2b8: 000080e7 jalr ra # 2b4 <.LVL77> + +000002bc <.LBE44>: + 2bc: 97ba add a5,a5,a4 + +000002be <.LVL79>: + 2be: 01035693 srl a3,t1,0x10 + 2c2: 96be add a3,a3,a5 + +000002c4 <.LVL80>: + 2c4: 00e6f363 bgeu a3,a4,2ca <.L45> + 2c8: 9522 add a0,a0,s0 + +000002ca <.L45>: + 2ca: 0106d793 srl a5,a3,0x10 + 2ce: 97aa add a5,a5,a0 + 2d0: 63c1 lui t2,0x10 + 2d2: c0be sw a5,64(sp) + +000002d4 <.LVL82>: + 2d4: fff38793 add a5,t2,-1 # ffff <.LLST246+0xdacb> + +000002d8 <.LVL83>: + 2d8: 8efd and a3,a3,a5 + +000002da <.LVL84>: + 2da: 00f37333 and t1,t1,a5 + +000002de <.LVL85>: + 2de: 06c2 sll a3,a3,0x10 + 2e0: 00668733 add a4,a3,t1 + +000002e4 <.LVL86>: + 2e4: c2ba sw a4,68(sp) + +000002e6 <.LBB45>: + 2e6: 4712 lw a4,4(sp) + +000002e8 <.LVL88>: + 2e8: 01075293 srl t0,a4,0x10 + 2ec: 5716 lw a4,100(sp) + 2ee: d03a sw a4,32(sp) + +000002f0 <.LVL89>: + 2f0: 01075413 srl s0,a4,0x10 + +000002f4 <.LBB46>: + 2f4: 4712 lw a4,4(sp) + 2f6: 00f77333 and t1,a4,a5 + 2fa: 5702 lw a4,32(sp) + 2fc: 851a mv a0,t1 + +000002fe <.LVL91>: + 2fe: 8ff9 and a5,a5,a4 + 300: 85be mv a1,a5 + 302: 00000097 auipc ra,0x0 + 306: 000080e7 jalr ra # 302 <.LVL91+0x4> + 30a: 872a mv a4,a0 + +0000030c <.LBB47>: + 30c: 85a2 mv a1,s0 + 30e: 851a mv a0,t1 + +00000310 <.LVL93>: + 310: 00000097 auipc ra,0x0 + 314: 000080e7 jalr ra # 310 <.LVL93> + 318: 832a mv t1,a0 + +0000031a <.LBB48>: + 31a: 85be mv a1,a5 + 31c: 8516 mv a0,t0 + 31e: 00000097 auipc ra,0x0 + 322: 000080e7 jalr ra # 31e <.LBB48+0x4> + 326: 87aa mv a5,a0 + +00000328 <.LBB49>: + 328: 85a2 mv a1,s0 + 32a: 8516 mv a0,t0 + +0000032c <.LVL96>: + 32c: 00000097 auipc ra,0x0 + 330: 000080e7 jalr ra # 32c <.LVL96> + +00000334 <.LBE49>: + 334: 01075693 srl a3,a4,0x10 + 338: 933e add t1,t1,a5 + +0000033a <.LVL98>: + 33a: 9336 add t1,t1,a3 + +0000033c <.LVL99>: + 33c: 00f37363 bgeu t1,a5,342 <.L46> + 340: 951e add a0,a0,t2 + +00000342 <.L46>: + 342: 01035793 srl a5,t1,0x10 + +00000346 <.LVL101>: + 346: 63c1 lui t2,0x10 + 348: 00a78433 add s0,a5,a0 + +0000034c <.LVL102>: + 34c: fff38793 add a5,t2,-1 # ffff <.LLST246+0xdacb> + 350: 00f37333 and t1,t1,a5 + +00000354 <.LVL103>: + 354: 0342 sll t1,t1,0x10 + 356: 8f7d and a4,a4,a5 + +00000358 <.LVL104>: + 358: 971a add a4,a4,t1 + 35a: c4ba sw a4,72(sp) + +0000035c <.LBB50>: + 35c: 4756 lw a4,84(sp) + +0000035e <.LVL106>: + 35e: 0104d293 srl t0,s1,0x10 + 362: c83a sw a4,16(sp) + +00000364 <.LVL107>: + 364: 8341 srl a4,a4,0x10 + 366: d63a sw a4,44(sp) + +00000368 <.LBB51>: + 368: 4742 lw a4,16(sp) + 36a: 00f77333 and t1,a4,a5 + 36e: 8fe5 and a5,a5,s1 + 370: 851a mv a0,t1 + +00000372 <.LVL109>: + 372: 85be mv a1,a5 + 374: 00000097 auipc ra,0x0 + 378: 000080e7 jalr ra # 374 <.LVL109+0x2> + 37c: 872a mv a4,a0 + +0000037e <.LBB52>: + 37e: 8596 mv a1,t0 + 380: 851a mv a0,t1 + +00000382 <.LVL111>: + 382: 00000097 auipc ra,0x0 + 386: 000080e7 jalr ra # 382 <.LVL111> + 38a: 832a mv t1,a0 + +0000038c <.LBB53>: + 38c: 85be mv a1,a5 + 38e: 5532 lw a0,44(sp) + 390: 00000097 auipc ra,0x0 + 394: 000080e7 jalr ra # 390 <.LBB53+0x4> + 398: 87aa mv a5,a0 + +0000039a <.LBB54>: + 39a: 8596 mv a1,t0 + 39c: 5532 lw a0,44(sp) + +0000039e <.LVL114>: + 39e: 00000097 auipc ra,0x0 + 3a2: 000080e7 jalr ra # 39e <.LVL114> + +000003a6 <.LBE54>: + 3a6: 01075693 srl a3,a4,0x10 + 3aa: 933e add t1,t1,a5 + +000003ac <.LVL116>: + 3ac: 9336 add t1,t1,a3 + +000003ae <.LVL117>: + 3ae: 00f37363 bgeu t1,a5,3b4 <.L47> + 3b2: 951e add a0,a0,t2 + +000003b4 <.L47>: + 3b4: 01035793 srl a5,t1,0x10 + +000003b8 <.LVL119>: + 3b8: 460a lw a2,128(sp) + 3ba: 953e add a0,a0,a5 + +000003bc <.LVL120>: + 3bc: 57d2 lw a5,52(sp) + 3be: 62c1 lui t0,0x10 + 3c0: fff28593 add a1,t0,-1 # ffff <.LLST246+0xdacb> + 3c4: 00f603b3 add t2,a2,a5 + +000003c8 <.LBB55>: + 3c8: 57c2 lw a5,48(sp) + 3ca: 00c3b633 sltu a2,t2,a2 + +000003ce <.LBB56>: + 3ce: 00b37333 and t1,t1,a1 + +000003d2 <.LBB57>: + 3d2: 00c786b3 add a3,a5,a2 + 3d6: 47d2 lw a5,20(sp) + +000003d8 <.LBB58>: + 3d8: 0342 sll t1,t1,0x10 + 3da: 8f6d and a4,a4,a1 + +000003dc <.LBB59>: + 3dc: 96be add a3,a3,a5 + 3de: 57f2 lw a5,60(sp) + +000003e0 <.LBB60>: + 3e0: 971a add a4,a4,t1 + +000003e2 <.LBB61>: + 3e2: 5362 lw t1,56(sp) + 3e4: 979e add a5,a5,t2 + 3e6: c13e sw a5,128(sp) + +000003e8 <.LVL124>: + 3e8: 9336 add t1,t1,a3 + +000003ea <.LVL125>: + 3ea: 0077b7b3 sltu a5,a5,t2 + +000003ee <.LVL126>: + 3ee: 979a add a5,a5,t1 + +000003f0 <.LVL127>: + 3f0: 00d333b3 sltu t2,t1,a3 + +000003f4 <.LVL128>: + 3f4: 0067b333 sltu t1,a5,t1 + +000003f8 <.LBB63>: + 3f8: 00c6b6b3 sltu a3,a3,a2 + +000003fc <.LBB64>: + 3fc: 0063e3b3 or t2,t2,t1 + +00000400 <.LVL131>: + 400: 93b6 add t2,t2,a3 + +00000402 <.LBB65>: + 402: 4696 lw a3,68(sp) + 404: 4326 lw t1,72(sp) + +00000406 <.LVL132>: + 406: 00d78633 add a2,a5,a3 + +0000040a <.LVL133>: + 40a: 4686 lw a3,64(sp) + 40c: 00f637b3 sltu a5,a2,a5 + +00000410 <.LVL134>: + 410: 9332 add t1,t1,a2 + 412: 969e add a3,a3,t2 + +00000414 <.LVL135>: + 414: 97b6 add a5,a5,a3 + +00000416 <.LBB66>: + 416: 943e add s0,s0,a5 + +00000418 <.LVL137>: + 418: 00c33633 sltu a2,t1,a2 + +0000041c <.LVL138>: + 41c: 9622 add a2,a2,s0 + +0000041e <.LVL139>: + 41e: 971a add a4,a4,t1 + +00000420 <.LVL140>: + 420: 9532 add a0,a0,a2 + +00000422 <.LBB67>: + 422: c33a sw a4,132(sp) + 424: 00673733 sltu a4,a4,t1 + +00000428 <.LBB68>: + 428: 0076b3b3 sltu t2,a3,t2 + +0000042c <.LVL142>: + 42c: 972a add a4,a4,a0 + 42e: 00d7b6b3 sltu a3,a5,a3 + +00000432 <.LBB69>: + 432: 00f437b3 sltu a5,s0,a5 + +00000436 <.LVL144>: + 436: 00863433 sltu s0,a2,s0 + +0000043a <.LBB70>: + 43a: 00d3e6b3 or a3,t2,a3 + +0000043e <.LBB71>: + 43e: 8fc1 or a5,a5,s0 + +00000440 <.LBB72>: + 440: c53a sw a4,136(sp) + 442: 00c53633 sltu a2,a0,a2 + 446: 00a73733 sltu a4,a4,a0 + +0000044a <.LBB73>: + 44a: 97b6 add a5,a5,a3 + +0000044c <.LBB74>: + 44c: 8e59 or a2,a2,a4 + 44e: 963e add a2,a2,a5 + +00000450 <.LBB75>: + 450: 4792 lw a5,4(sp) + +00000452 <.LBB80>: + 452: c732 sw a2,140(sp) + +00000454 <.LBB81>: + 454: 0107d313 srl t1,a5,0x10 + +00000458 <.LVL150>: + 458: 57a6 lw a5,104(sp) + 45a: ca3e sw a5,20(sp) + +0000045c <.LVL151>: + 45c: 0107d713 srl a4,a5,0x10 + +00000460 <.LBB76>: + 460: 4792 lw a5,4(sp) + 462: 00b7f3b3 and t2,a5,a1 + 466: 47d2 lw a5,20(sp) + 468: 851e mv a0,t2 + 46a: 00b7f433 and s0,a5,a1 + 46e: 85a2 mv a1,s0 + 470: 00000097 auipc ra,0x0 + 474: 000080e7 jalr ra # 470 <.LBB76+0x10> + 478: 87aa mv a5,a0 + +0000047a <.LBB77>: + 47a: 85ba mv a1,a4 + 47c: 851e mv a0,t2 + +0000047e <.LVL154>: + 47e: 00000097 auipc ra,0x0 + 482: 000080e7 jalr ra # 47e <.LVL154> + 486: 83aa mv t2,a0 + +00000488 <.LBB78>: + 488: 85a2 mv a1,s0 + 48a: 851a mv a0,t1 + 48c: 00000097 auipc ra,0x0 + 490: 000080e7 jalr ra # 48c <.LBB78+0x4> + 494: 842a mv s0,a0 + +00000496 <.LBB79>: + 496: 85ba mv a1,a4 + 498: 851a mv a0,t1 + 49a: 00000097 auipc ra,0x0 + 49e: 000080e7 jalr ra # 49a <.LBB79+0x4> + +000004a2 <.LBE79>: + 4a2: 0107d713 srl a4,a5,0x10 + +000004a6 <.LVL158>: + 4a6: 93a2 add t2,t2,s0 + +000004a8 <.LVL159>: + 4a8: 93ba add t2,t2,a4 + +000004aa <.LVL160>: + 4aa: 0083f363 bgeu t2,s0,4b0 <.L74> + 4ae: 9516 add a0,a0,t0 + +000004b0 <.L74>: + 4b0: 0103d713 srl a4,t2,0x10 + 4b4: 972a add a4,a4,a0 + 4b6: d63a sw a4,44(sp) + +000004b8 <.LVL162>: + 4b8: 6741 lui a4,0x10 + +000004ba <.LVL163>: + 4ba: fff70693 add a3,a4,-1 # ffff <.LLST246+0xdacb> + 4be: 00d3f3b3 and t2,t2,a3 + +000004c2 <.LVL164>: + 4c2: 03c2 sll t2,t2,0x10 + 4c4: 8ff5 and a5,a5,a3 + +000004c6 <.LVL165>: + 4c6: 979e add a5,a5,t2 + 4c8: d83e sw a5,48(sp) + +000004ca <.LBB82>: + 4ca: 47e6 lw a5,88(sp) + +000004cc <.LVL167>: + 4cc: 0104d313 srl t1,s1,0x10 + +000004d0 <.LVL168>: + 4d0: 00d7f3b3 and t2,a5,a3 + 4d4: c23e sw a5,4(sp) + +000004d6 <.LVL169>: + 4d6: 0107d293 srl t0,a5,0x10 + +000004da <.LBB83>: + 4da: 00d4f7b3 and a5,s1,a3 + 4de: 851e mv a0,t2 + +000004e0 <.LVL171>: + 4e0: 85be mv a1,a5 + 4e2: 00000097 auipc ra,0x0 + 4e6: 000080e7 jalr ra # 4e2 <.LVL171+0x2> + 4ea: 842a mv s0,a0 + +000004ec <.LBB84>: + 4ec: 859a mv a1,t1 + 4ee: 851e mv a0,t2 + 4f0: 00000097 auipc ra,0x0 + 4f4: 000080e7 jalr ra # 4f0 <.LBB84+0x4> + 4f8: 83aa mv t2,a0 + +000004fa <.LBB85>: + 4fa: 85be mv a1,a5 + 4fc: 8516 mv a0,t0 + 4fe: 00000097 auipc ra,0x0 + 502: 000080e7 jalr ra # 4fe <.LBB85+0x4> + 506: 87aa mv a5,a0 + +00000508 <.LBB86>: + 508: 859a mv a1,t1 + 50a: 8516 mv a0,t0 + +0000050c <.LVL175>: + 50c: 00000097 auipc ra,0x0 + 510: 000080e7 jalr ra # 50c <.LVL175> + +00000514 <.LBE86>: + 514: 01045693 srl a3,s0,0x10 + 518: 93be add t2,t2,a5 + +0000051a <.LVL177>: + 51a: 93b6 add t2,t2,a3 + +0000051c <.LVL178>: + 51c: 00f3f363 bgeu t2,a5,522 <.L75> + 520: 953a add a0,a0,a4 + +00000522 <.L75>: + 522: 6741 lui a4,0x10 + 524: fff70693 add a3,a4,-1 # ffff <.LLST246+0xdacb> + 528: 0103d793 srl a5,t2,0x10 + +0000052c <.LVL180>: + 52c: 00d3f3b3 and t2,t2,a3 + +00000530 <.LVL181>: + 530: 97aa add a5,a5,a0 + 532: 8c75 and s0,s0,a3 + +00000534 <.LVL182>: + 534: 03c2 sll t2,t2,0x10 + 536: 4632 lw a2,12(sp) + 538: da3e sw a5,52(sp) + +0000053a <.LVL183>: + 53a: 008387b3 add a5,t2,s0 + +0000053e <.LVL184>: + 53e: dc3e sw a5,56(sp) + +00000540 <.LBB87>: + 540: 47b2 lw a5,12(sp) + +00000542 <.LVL186>: + 542: 00d673b3 and t2,a2,a3 + 546: 5602 lw a2,32(sp) + 548: 0107d293 srl t0,a5,0x10 + +0000054c <.LVL187>: + 54c: 5782 lw a5,32(sp) + 54e: 00d67433 and s0,a2,a3 + +00000552 <.LBB88>: + 552: 851e mv a0,t2 + +00000554 <.LBE88>: + 554: 83c1 srl a5,a5,0x10 + +00000556 <.LBB89>: + 556: 85a2 mv a1,s0 + 558: 00000097 auipc ra,0x0 + 55c: 000080e7 jalr ra # 558 <.LBB89+0x2> + 560: 832a mv t1,a0 + +00000562 <.LBB90>: + 562: 85be mv a1,a5 + 564: 851e mv a0,t2 + 566: 00000097 auipc ra,0x0 + 56a: 000080e7 jalr ra # 566 <.LBB90+0x4> + 56e: 83aa mv t2,a0 + +00000570 <.LBB91>: + 570: 85a2 mv a1,s0 + 572: 8516 mv a0,t0 + 574: 00000097 auipc ra,0x0 + 578: 000080e7 jalr ra # 574 <.LBB91+0x4> + 57c: 842a mv s0,a0 + +0000057e <.LBB92>: + 57e: 85be mv a1,a5 + 580: 8516 mv a0,t0 + 582: 00000097 auipc ra,0x0 + 586: 000080e7 jalr ra # 582 <.LBB92+0x4> + +0000058a <.LBE92>: + 58a: 01035793 srl a5,t1,0x10 + +0000058e <.LVL194>: + 58e: 93a2 add t2,t2,s0 + +00000590 <.LVL195>: + 590: 979e add a5,a5,t2 + +00000592 <.LVL196>: + 592: 0087f363 bgeu a5,s0,598 <.L76> + 596: 953a add a0,a0,a4 + +00000598 <.L76>: + 598: 46c2 lw a3,16(sp) + +0000059a <.LBB98>: + 59a: 0107d713 srl a4,a5,0x10 + 59e: 972a add a4,a4,a0 + +000005a0 <.LBB99>: + 5a0: 0106d393 srl t2,a3,0x10 + 5a4: 46a2 lw a3,8(sp) + +000005a6 <.LBB100>: + 5a6: 6441 lui s0,0x10 + +000005a8 <.LVL198>: + 5a8: c63a sw a4,12(sp) + +000005aa <.LBB101>: + 5aa: 0106d493 srl s1,a3,0x10 + +000005ae <.LVL200>: + 5ae: 46c2 lw a3,16(sp) + +000005b0 <.LBB102>: + 5b0: fff40713 add a4,s0,-1 # ffff <.LLST246+0xdacb> + +000005b4 <.LVL201>: + 5b4: 8ff9 and a5,a5,a4 + +000005b6 <.LVL202>: + 5b6: 00e6f2b3 and t0,a3,a4 + +000005ba <.LVL203>: + 5ba: 46a2 lw a3,8(sp) + 5bc: 00e37333 and t1,t1,a4 + +000005c0 <.LVL204>: + 5c0: 07c2 sll a5,a5,0x10 + 5c2: 8f75 and a4,a4,a3 + 5c4: 979a add a5,a5,t1 + +000005c6 <.LBB103>: + 5c6: 8516 mv a0,t0 + +000005c8 <.LVL206>: + 5c8: 85ba mv a1,a4 + 5ca: 00000097 auipc ra,0x0 + 5ce: 000080e7 jalr ra # 5ca <.LVL206+0x2> + 5d2: 832a mv t1,a0 + +000005d4 <.LBB95>: + 5d4: 85a6 mv a1,s1 + 5d6: 8516 mv a0,t0 + 5d8: 00000097 auipc ra,0x0 + 5dc: 000080e7 jalr ra # 5d8 <.LBB95+0x4> + 5e0: 82aa mv t0,a0 + +000005e2 <.LBB96>: + 5e2: 85ba mv a1,a4 + 5e4: 851e mv a0,t2 + 5e6: 00000097 auipc ra,0x0 + 5ea: 000080e7 jalr ra # 5e6 <.LBB96+0x4> + 5ee: 872a mv a4,a0 + +000005f0 <.LBB97>: + 5f0: 85a6 mv a1,s1 + 5f2: 851e mv a0,t2 + +000005f4 <.LVL210>: + 5f4: 00000097 auipc ra,0x0 + 5f8: 000080e7 jalr ra # 5f4 <.LVL210> + +000005fc <.LBE97>: + 5fc: 01035693 srl a3,t1,0x10 + 600: 92ba add t0,t0,a4 + +00000602 <.LVL212>: + 602: 92b6 add t0,t0,a3 + +00000604 <.LVL213>: + 604: 00e2f363 bgeu t0,a4,60a <.L77> + 608: 9522 add a0,a0,s0 + +0000060a <.L77>: + 60a: 63c1 lui t2,0x10 + 60c: fff38593 add a1,t2,-1 # ffff <.LLST246+0xdacb> + 610: 44ba lw s1,140(sp) + +00000612 <.LVL215>: + 612: 56b2 lw a3,44(sp) + 614: 0102d713 srl a4,t0,0x10 + +00000618 <.LVL216>: + 618: 462a lw a2,136(sp) + 61a: 953a add a0,a0,a4 + +0000061c <.LVL217>: + 61c: 00b2f2b3 and t0,t0,a1 + +00000620 <.LVL218>: + 620: 5742 lw a4,48(sp) + 622: 02c2 sll t0,t0,0x10 + 624: 00b37333 and t1,t1,a1 + +00000628 <.LVL219>: + 628: 9316 add t1,t1,t0 + +0000062a <.LBB104>: + 62a: 00d482b3 add t0,s1,a3 + 62e: 56e2 lw a3,56(sp) + 630: 9732 add a4,a4,a2 + +00000632 <.LVL221>: + 632: 5452 lw s0,52(sp) + 634: 00c73633 sltu a2,a4,a2 + +00000638 <.LVL222>: + 638: 9616 add a2,a2,t0 + +0000063a <.LBB105>: + 63a: 96ba add a3,a3,a4 + +0000063c <.LVL224>: + 63c: 9432 add s0,s0,a2 + +0000063e <.LVL225>: + 63e: 00e6b733 sltu a4,a3,a4 + +00000642 <.LVL226>: + 642: 9722 add a4,a4,s0 + +00000644 <.LBB106>: + 644: 0092b4b3 sltu s1,t0,s1 + +00000648 <.LVL228>: + 648: 005632b3 sltu t0,a2,t0 + +0000064c <.LBB107>: + 64c: 00c43633 sltu a2,s0,a2 + +00000650 <.LVL230>: + 650: 00873433 sltu s0,a4,s0 + +00000654 <.LVL231>: + 654: 8e41 or a2,a2,s0 + +00000656 <.LVL232>: + 656: 4432 lw s0,12(sp) + +00000658 <.LVL233>: + 658: 97b6 add a5,a5,a3 + +0000065a <.LBB108>: + 65a: 0054e2b3 or t0,s1,t0 + +0000065e <.LBB109>: + 65e: 9616 add a2,a2,t0 + +00000660 <.LBB110>: + 660: 00d7b6b3 sltu a3,a5,a3 + +00000664 <.LVL237>: + 664: 008702b3 add t0,a4,s0 + +00000668 <.LVL238>: + 668: 9696 add a3,a3,t0 + +0000066a <.LVL239>: + 66a: 933e add t1,t1,a5 + +0000066c <.LVL240>: + 66c: 9536 add a0,a0,a3 + +0000066e <.LBB111>: + 66e: c51a sw t1,136(sp) + +00000670 <.LVL242>: + 670: 00f33333 sltu t1,t1,a5 + 674: 932a add t1,t1,a0 + +00000676 <.LBB112>: + 676: 00e2b733 sltu a4,t0,a4 + +0000067a <.LVL243>: + 67a: 0056b2b3 sltu t0,a3,t0 + +0000067e <.LVL244>: + 67e: 00576733 or a4,a4,t0 + +00000682 <.LBB113>: + 682: c71a sw t1,140(sp) + 684: 00d536b3 sltu a3,a0,a3 + 688: 00a33333 sltu t1,t1,a0 + +0000068c <.LBB114>: + 68c: 9732 add a4,a4,a2 + +0000068e <.LBB115>: + 68e: 0066e6b3 or a3,a3,t1 + 692: 96ba add a3,a3,a4 + +00000694 <.LBB116>: + 694: 5316 lw t1,100(sp) + 696: 4742 lw a4,16(sp) + 698: 47c2 lw a5,16(sp) + 69a: 00b374b3 and s1,t1,a1 + 69e: 00b77433 and s0,a4,a1 + 6a2: 0107d293 srl t0,a5,0x10 + +000006a6 <.LBB121>: + 6a6: c936 sw a3,144(sp) + +000006a8 <.LBB122>: + 6a8: 01035793 srl a5,t1,0x10 + +000006ac <.LBB117>: + 6ac: 8522 mv a0,s0 + 6ae: 85a6 mv a1,s1 + 6b0: 00000097 auipc ra,0x0 + 6b4: 000080e7 jalr ra # 6b0 <.LBB117+0x4> + 6b8: 872a mv a4,a0 + +000006ba <.LBB118>: + 6ba: 85be mv a1,a5 + 6bc: 8522 mv a0,s0 + +000006be <.LVL250>: + 6be: 00000097 auipc ra,0x0 + 6c2: 000080e7 jalr ra # 6be <.LVL250> + 6c6: 842a mv s0,a0 + +000006c8 <.LBB119>: + 6c8: 85a6 mv a1,s1 + 6ca: 8516 mv a0,t0 + 6cc: 00000097 auipc ra,0x0 + 6d0: 000080e7 jalr ra # 6cc <.LBB119+0x4> + 6d4: 84aa mv s1,a0 + +000006d6 <.LBB120>: + 6d6: 85be mv a1,a5 + 6d8: 8516 mv a0,t0 + 6da: 00000097 auipc ra,0x0 + 6de: 000080e7 jalr ra # 6da <.LBB120+0x4> + +000006e2 <.LBE120>: + 6e2: 01075793 srl a5,a4,0x10 + +000006e6 <.LVL254>: + 6e6: 9426 add s0,s0,s1 + +000006e8 <.LVL255>: + 6e8: 943e add s0,s0,a5 + +000006ea <.LVL256>: + 6ea: 00947363 bgeu s0,s1,6f0 <.L102> + 6ee: 951e add a0,a0,t2 + +000006f0 <.L102>: + 6f0: 01045793 srl a5,s0,0x10 + 6f4: 97aa add a5,a5,a0 + 6f6: 63c1 lui t2,0x10 + 6f8: c43e sw a5,8(sp) + +000006fa <.LVL258>: + 6fa: fff38793 add a5,t2,-1 # ffff <.LLST246+0xdacb> + +000006fe <.LVL259>: + 6fe: 8c7d and s0,s0,a5 + +00000700 <.LVL260>: + 700: 0442 sll s0,s0,0x10 + 702: 8f7d and a4,a4,a5 + +00000704 <.LVL261>: + 704: 9722 add a4,a4,s0 + +00000706 <.LBB123>: + 706: 42c6 lw t0,80(sp) + +00000708 <.LBB128>: + 708: c63a sw a4,12(sp) + +0000070a <.LBB129>: + 70a: 4752 lw a4,20(sp) + +0000070c <.LVL264>: + 70c: 0102d413 srl s0,t0,0x10 + +00000710 <.LVL265>: + 710: 00f2f2b3 and t0,t0,a5 + +00000714 <.LVL266>: + 714: 8ff9 and a5,a5,a4 + 716: 01075493 srl s1,a4,0x10 + +0000071a <.LBB124>: + 71a: 8516 mv a0,t0 + +0000071c <.LVL268>: + 71c: 85be mv a1,a5 + 71e: 00000097 auipc ra,0x0 + 722: 000080e7 jalr ra # 71e <.LVL268+0x2> + 726: 872a mv a4,a0 + +00000728 <.LBB125>: + 728: 85a6 mv a1,s1 + 72a: 8516 mv a0,t0 + +0000072c <.LVL270>: + 72c: 00000097 auipc ra,0x0 + 730: 000080e7 jalr ra # 72c <.LVL270> + 734: 82aa mv t0,a0 + +00000736 <.LBB126>: + 736: 85be mv a1,a5 + 738: 8522 mv a0,s0 + 73a: 00000097 auipc ra,0x0 + 73e: 000080e7 jalr ra # 73a <.LBB126+0x4> + 742: 87aa mv a5,a0 + +00000744 <.LBB127>: + 744: 85a6 mv a1,s1 + 746: 8522 mv a0,s0 + +00000748 <.LVL273>: + 748: 00000097 auipc ra,0x0 + 74c: 000080e7 jalr ra # 748 <.LVL273> + +00000750 <.LBE127>: + 750: 01075693 srl a3,a4,0x10 + 754: 92be add t0,t0,a5 + +00000756 <.LVL275>: + 756: 92b6 add t0,t0,a3 + +00000758 <.LVL276>: + 758: 00f2f363 bgeu t0,a5,75e <.L103> + 75c: 951e add a0,a0,t2 + +0000075e <.L103>: + 75e: 0102d793 srl a5,t0,0x10 + +00000762 <.LVL278>: + 762: 97aa add a5,a5,a0 + 764: 6441 lui s0,0x10 + +00000766 <.LVL279>: + 766: c83e sw a5,16(sp) + +00000768 <.LVL280>: + 768: fff40793 add a5,s0,-1 # ffff <.LLST246+0xdacb> + +0000076c <.LVL281>: + 76c: 00f2f2b3 and t0,t0,a5 + +00000770 <.LVL282>: + 770: 02c2 sll t0,t0,0x10 + 772: 8f7d and a4,a4,a5 + +00000774 <.LVL283>: + 774: 9716 add a4,a4,t0 + 776: d03a sw a4,32(sp) + +00000778 <.LBB130>: + 778: 5286 lw t0,96(sp) + 77a: 4712 lw a4,4(sp) + +0000077c <.LVL285>: + 77c: 0102d493 srl s1,t0,0x10 + 780: 01075393 srl t2,a4,0x10 + +00000784 <.LBB131>: + 784: 00f2f2b3 and t0,t0,a5 + +00000788 <.LVL287>: + 788: 8f7d and a4,a4,a5 + 78a: 853a mv a0,a4 + +0000078c <.LVL288>: + 78c: 8596 mv a1,t0 + 78e: 00000097 auipc ra,0x0 + 792: 000080e7 jalr ra # 78e <.LVL288+0x2> + 796: 87aa mv a5,a0 + +00000798 <.LBB132>: + 798: 85a6 mv a1,s1 + 79a: 853a mv a0,a4 + +0000079c <.LVL290>: + 79c: 00000097 auipc ra,0x0 + 7a0: 000080e7 jalr ra # 79c <.LVL290> + 7a4: 872a mv a4,a0 + +000007a6 <.LBB133>: + 7a6: 8596 mv a1,t0 + 7a8: 851e mv a0,t2 + +000007aa <.LVL292>: + 7aa: 00000097 auipc ra,0x0 + 7ae: 000080e7 jalr ra # 7aa <.LVL292> + 7b2: 82aa mv t0,a0 + +000007b4 <.LBB134>: + 7b4: 85a6 mv a1,s1 + 7b6: 851e mv a0,t2 + 7b8: 00000097 auipc ra,0x0 + 7bc: 000080e7 jalr ra # 7b8 <.LBB134+0x4> + +000007c0 <.LBE134>: + 7c0: 0107d693 srl a3,a5,0x10 + 7c4: 9716 add a4,a4,t0 + +000007c6 <.LVL295>: + 7c6: 9736 add a4,a4,a3 + +000007c8 <.LVL296>: + 7c8: 00577363 bgeu a4,t0,7ce <.L104> + 7cc: 9522 add a0,a0,s0 + +000007ce <.L104>: + 7ce: 62c1 lui t0,0x10 + +000007d0 <.LVL298>: + 7d0: fff28493 add s1,t0,-1 # ffff <.LLST246+0xdacb> + +000007d4 <.LVL299>: + 7d4: 01075693 srl a3,a4,0x10 + 7d8: 8f65 and a4,a4,s1 + +000007da <.LVL300>: + 7da: 0742 sll a4,a4,0x10 + 7dc: 8fe5 and a5,a5,s1 + +000007de <.LVL301>: + 7de: 97ba add a5,a5,a4 + 7e0: d83e sw a5,48(sp) + +000007e2 <.LBB135>: + 7e2: 4756 lw a4,84(sp) + 7e4: 47d2 lw a5,20(sp) + +000007e6 <.LBB140>: + 7e6: 96aa add a3,a3,a0 + +000007e8 <.LBB141>: + 7e8: 01075413 srl s0,a4,0x10 + 7ec: 8f65 and a4,a4,s1 + 7ee: 8cfd and s1,s1,a5 + +000007f0 <.LBB142>: + 7f0: d636 sw a3,44(sp) + +000007f2 <.LBB143>: + 7f2: 0107d393 srl t2,a5,0x10 + +000007f6 <.LBB136>: + 7f6: 853a mv a0,a4 + +000007f8 <.LVL304>: + 7f8: 85a6 mv a1,s1 + 7fa: 00000097 auipc ra,0x0 + 7fe: 000080e7 jalr ra # 7fa <.LVL304+0x2> + +00000802 <.LVL305>: + 802: 87aa mv a5,a0 + +00000804 <.LBB137>: + 804: 859e mv a1,t2 + 806: 853a mv a0,a4 + +00000808 <.LVL307>: + 808: 00000097 auipc ra,0x0 + 80c: 000080e7 jalr ra # 808 <.LVL307> + 810: 872a mv a4,a0 + +00000812 <.LBB138>: + 812: 85a6 mv a1,s1 + 814: 8522 mv a0,s0 + +00000816 <.LVL309>: + 816: 00000097 auipc ra,0x0 + 81a: 000080e7 jalr ra # 816 <.LVL309> + 81e: 84aa mv s1,a0 + +00000820 <.LBB139>: + 820: 859e mv a1,t2 + 822: 8522 mv a0,s0 + 824: 00000097 auipc ra,0x0 + 828: 000080e7 jalr ra # 824 <.LBB139+0x4> + +0000082c <.LBE139>: + 82c: 0107d693 srl a3,a5,0x10 + 830: 9726 add a4,a4,s1 + +00000832 <.LVL312>: + 832: 9736 add a4,a4,a3 + +00000834 <.LVL313>: + 834: 00977363 bgeu a4,s1,83a <.L105> + 838: 9516 add a0,a0,t0 + +0000083a <.L105>: + 83a: 01075693 srl a3,a4,0x10 + 83e: 96aa add a3,a3,a0 + 840: 63c1 lui t2,0x10 + +00000842 <.LVL315>: + 842: ca36 sw a3,20(sp) + +00000844 <.LVL316>: + 844: fff38693 add a3,t2,-1 # ffff <.LLST246+0xdacb> + +00000848 <.LVL317>: + 848: 8f75 and a4,a4,a3 + +0000084a <.LVL318>: + 84a: 8ff5 and a5,a5,a3 + +0000084c <.LVL319>: + 84c: 0742 sll a4,a4,0x10 + 84e: 973e add a4,a4,a5 + +00000850 <.LBB144>: + 850: 4792 lw a5,4(sp) + 852: 01035413 srl s0,t1,0x10 + +00000856 <.LVL321>: + 856: 00d37333 and t1,t1,a3 + +0000085a <.LVL322>: + 85a: 0107d493 srl s1,a5,0x10 + +0000085e <.LBB145>: + 85e: 8ff5 and a5,a5,a3 + 860: 853e mv a0,a5 + +00000862 <.LVL324>: + 862: 859a mv a1,t1 + 864: 00000097 auipc ra,0x0 + 868: 000080e7 jalr ra # 864 <.LVL324+0x2> + 86c: 82aa mv t0,a0 + +0000086e <.LBB146>: + 86e: 85a2 mv a1,s0 + 870: 853e mv a0,a5 + 872: 00000097 auipc ra,0x0 + 876: 000080e7 jalr ra # 872 <.LBB146+0x4> + 87a: 87aa mv a5,a0 + +0000087c <.LBB147>: + 87c: 859a mv a1,t1 + 87e: 8526 mv a0,s1 + +00000880 <.LVL327>: + 880: 00000097 auipc ra,0x0 + 884: 000080e7 jalr ra # 880 <.LVL327> + 888: 832a mv t1,a0 + +0000088a <.LBB148>: + 88a: 85a2 mv a1,s0 + 88c: 8526 mv a0,s1 + 88e: 00000097 auipc ra,0x0 + 892: 000080e7 jalr ra # 88e <.LBB148+0x4> + +00000896 <.LBE148>: + 896: 979a add a5,a5,t1 + +00000898 <.LVL330>: + 898: 0102d693 srl a3,t0,0x10 + 89c: 97b6 add a5,a5,a3 + +0000089e <.LVL331>: + 89e: 0067f363 bgeu a5,t1,8a4 <.L106> + 8a2: 951e add a0,a0,t2 + +000008a4 <.L106>: + 8a4: 63c1 lui t2,0x10 + 8a6: fff38313 add t1,t2,-1 # ffff <.LLST246+0xdacb> + +000008aa <.LVL333>: + 8aa: 0107d693 srl a3,a5,0x10 + 8ae: 0067f7b3 and a5,a5,t1 + +000008b2 <.LVL334>: + 8b2: 07c2 sll a5,a5,0x10 + 8b4: 0062f2b3 and t0,t0,t1 + +000008b8 <.LVL335>: + 8b8: 9536 add a0,a0,a3 + +000008ba <.LVL336>: + 8ba: 92be add t0,t0,a5 + +000008bc <.LBB149>: + 8bc: 46ba lw a3,140(sp) + 8be: 47b2 lw a5,12(sp) + 8c0: 5582 lw a1,32(sp) + 8c2: 444a lw s0,144(sp) + +000008c4 <.LVL338>: + 8c4: 4622 lw a2,8(sp) + 8c6: 97b6 add a5,a5,a3 + +000008c8 <.LVL339>: + 8c8: 00b784b3 add s1,a5,a1 + +000008cc <.LVL340>: + 8cc: 45c2 lw a1,16(sp) + 8ce: 9622 add a2,a2,s0 + +000008d0 <.LVL341>: + 8d0: 00d7b6b3 sltu a3,a5,a3 + +000008d4 <.LVL342>: + 8d4: 96b2 add a3,a3,a2 + +000008d6 <.LBB150>: + 8d6: 95b6 add a1,a1,a3 + +000008d8 <.LVL344>: + 8d8: 00f4b7b3 sltu a5,s1,a5 + +000008dc <.LVL345>: + 8dc: 97ae add a5,a5,a1 + +000008de <.LBB151>: + 8de: 00863433 sltu s0,a2,s0 + +000008e2 <.LVL347>: + 8e2: 00c6b633 sltu a2,a3,a2 + +000008e6 <.LBB152>: + 8e6: 00d5b6b3 sltu a3,a1,a3 + +000008ea <.LVL349>: + 8ea: 00b7b5b3 sltu a1,a5,a1 + +000008ee <.LBB153>: + 8ee: 8e41 or a2,a2,s0 + +000008f0 <.LBB154>: + 8f0: 8ecd or a3,a3,a1 + +000008f2 <.LVL352>: + 8f2: 96b2 add a3,a3,a2 + +000008f4 <.LBB155>: + 8f4: 5642 lw a2,48(sp) + 8f6: 55b2 lw a1,44(sp) + +000008f8 <.LVL353>: + 8f8: 9626 add a2,a2,s1 + 8fa: 95be add a1,a1,a5 + 8fc: c732 sw a2,140(sp) + +000008fe <.LVL354>: + 8fe: 00963633 sltu a2,a2,s1 + +00000902 <.LVL355>: + 902: 962e add a2,a2,a1 + +00000904 <.LVL356>: + 904: 00f5b7b3 sltu a5,a1,a5 + +00000908 <.LVL357>: + 908: 00b635b3 sltu a1,a2,a1 + +0000090c <.LVL358>: + 90c: 8fcd or a5,a5,a1 + +0000090e <.LVL359>: + 90e: 97b6 add a5,a5,a3 + +00000910 <.LBB156>: + 910: 46d2 lw a3,20(sp) + 912: 9732 add a4,a4,a2 + +00000914 <.LVL360>: + 914: 00c73633 sltu a2,a4,a2 + +00000918 <.LVL361>: + 918: 96be add a3,a3,a5 + +0000091a <.LVL362>: + 91a: 9636 add a2,a2,a3 + +0000091c <.LBB157>: + 91c: 92ba add t0,t0,a4 + +0000091e <.LVL364>: + 91e: 9532 add a0,a0,a2 + +00000920 <.LVL365>: + 920: c916 sw t0,144(sp) + +00000922 <.LVL366>: + 922: 00e2b2b3 sltu t0,t0,a4 + +00000926 <.LVL367>: + 926: 92aa add t0,t0,a0 + +00000928 <.LVL368>: + 928: cb16 sw t0,148(sp) + +0000092a <.LBB158>: + 92a: 00f6b7b3 sltu a5,a3,a5 + +0000092e <.LBB159>: + 92e: 00a2b2b3 sltu t0,t0,a0 + +00000932 <.LBB160>: + 932: 00d636b3 sltu a3,a2,a3 + +00000936 <.LBB161>: + 936: 00c53633 sltu a2,a0,a2 + +0000093a <.LBB162>: + 93a: 4766 lw a4,88(sp) + +0000093c <.LBB167>: + 93c: 00566633 or a2,a2,t0 + +00000940 <.LBB168>: + 940: 52a6 lw t0,104(sp) + +00000942 <.LBB169>: + 942: 8fd5 or a5,a5,a3 + +00000944 <.LBB170>: + 944: 97b2 add a5,a5,a2 + +00000946 <.LBB171>: + 946: 01075493 srl s1,a4,0x10 + +0000094a <.LVL377>: + 94a: 0102d413 srl s0,t0,0x10 + 94e: 00677733 and a4,a4,t1 + 952: 0062f2b3 and t0,t0,t1 + +00000956 <.LBB172>: + 956: cd3e sw a5,152(sp) + +00000958 <.LBB163>: + 958: 853a mv a0,a4 + 95a: 8596 mv a1,t0 + 95c: 00000097 auipc ra,0x0 + 960: 000080e7 jalr ra # 95c <.LBB163+0x4> + 964: 87aa mv a5,a0 + +00000966 <.LBB164>: + 966: 85a2 mv a1,s0 + 968: 853a mv a0,a4 + +0000096a <.LVL380>: + 96a: 00000097 auipc ra,0x0 + 96e: 000080e7 jalr ra # 96a <.LVL380> + 972: 872a mv a4,a0 + +00000974 <.LBB165>: + 974: 8596 mv a1,t0 + 976: 8526 mv a0,s1 + +00000978 <.LVL382>: + 978: 00000097 auipc ra,0x0 + 97c: 000080e7 jalr ra # 978 <.LVL382> + 980: 82aa mv t0,a0 + +00000982 <.LBB166>: + 982: 85a2 mv a1,s0 + 984: 8526 mv a0,s1 + 986: 00000097 auipc ra,0x0 + 98a: 000080e7 jalr ra # 986 <.LBB166+0x4> + +0000098e <.LBE166>: + 98e: 0107d693 srl a3,a5,0x10 + 992: 9716 add a4,a4,t0 + +00000994 <.LVL385>: + 994: 9736 add a4,a4,a3 + +00000996 <.LVL386>: + 996: 00577363 bgeu a4,t0,99c <.L137> + 99a: 951e add a0,a0,t2 + +0000099c <.L137>: + 99c: 006776b3 and a3,a4,t1 + 9a0: 465a lw a2,148(sp) + 9a2: 0067f7b3 and a5,a5,t1 + +000009a6 <.LVL388>: + 9a6: 06c2 sll a3,a3,0x10 + 9a8: 96be add a3,a3,a5 + 9aa: 01075793 srl a5,a4,0x10 + +000009ae <.LBB176>: + 9ae: 476a lw a4,152(sp) + +000009b0 <.LVL389>: + 9b0: 96b2 add a3,a3,a2 + +000009b2 <.LVL390>: + 9b2: 00c6b633 sltu a2,a3,a2 + 9b6: 97ba add a5,a5,a4 + 9b8: 97b2 add a5,a5,a2 + 9ba: 953e add a0,a0,a5 + +000009bc <.LBB178>: + 9bc: 470a lw a4,128(sp) + 9be: 57f6 lw a5,124(sp) + +000009c0 <.LBB177>: + 9c0: cd2a sw a0,152(sp) + 9c2: cb36 sw a3,148(sp) + +000009c4 <.LBB180>: + 9c4: 8f5d or a4,a4,a5 + +000009c6 <.LVL393>: + 9c6: 479a lw a5,132(sp) + 9c8: 0170 add a2,sp,140 + 9ca: 8f5d or a4,a4,a5 + +000009cc <.LVL394>: + 9cc: 47aa lw a5,136(sp) + 9ce: 07b6 sll a5,a5,0xd + 9d0: 8fd9 or a5,a5,a4 + +000009d2 <.LVL395>: + 9d2: 18f8 add a4,sp,124 + +000009d4 <.L140>: + 9d4: 4754 lw a3,12(a4) + 9d6: 4b0c lw a1,16(a4) + 9d8: 82cd srl a3,a3,0x13 + 9da: 05b6 sll a1,a1,0xd + 9dc: 8ecd or a3,a3,a1 + 9de: c314 sw a3,0(a4) + 9e0: 0711 add a4,a4,4 + 9e2: fee619e3 bne a2,a4,9d4 <.L140> + +000009e6 <.LBE180>: + 9e6: 469a lw a3,132(sp) + +000009e8 <.LBB181>: + 9e8: 5776 lw a4,124(sp) + 9ea: 00f037b3 snez a5,a5 + +000009ee <.LBE181>: + 9ee: dab6 sw a3,116(sp) + 9f0: 468a lw a3,128(sp) + +000009f2 <.LBB182>: + 9f2: 8fd9 or a5,a5,a4 + +000009f4 <.LBE182>: + 9f4: 472a lw a4,136(sp) + 9f6: d8b6 sw a3,112(sp) + +000009f8 <.LBE18>: + 9f8: 001006b7 lui a3,0x100 + +000009fc <.LBB183>: + 9fc: dcba sw a4,120(sp) + 9fe: d6be sw a5,108(sp) + +00000a00 <.LBE183>: + a00: 8f75 and a4,a4,a3 + a02: 3a070e63 beqz a4,dbe <.L180> + +00000a06 <.LBB184>: + a06: 07fe sll a5,a5,0x1f + +00000a08 <.LVL399>: + a08: 10f8 add a4,sp,108 + a0a: 18ac add a1,sp,120 + +00000a0c <.L142>: + a0c: 4314 lw a3,0(a4) + a0e: 4350 lw a2,4(a4) + a10: 8285 srl a3,a3,0x1 + a12: 067e sll a2,a2,0x1f + a14: 8ed1 or a3,a3,a2 + a16: c314 sw a3,0(a4) + a18: 0711 add a4,a4,4 + a1a: fee599e3 bne a1,a4,a0c <.L142> + +00000a1e <.LVL401>: + a1e: 5766 lw a4,120(sp) + a20: 8305 srl a4,a4,0x1 + a22: dcba sw a4,120(sp) + +00000a24 <.LBB186>: + a24: 00f03733 snez a4,a5 + +00000a28 <.LBE186>: + a28: 57b6 lw a5,108(sp) + +00000a2a <.LVL403>: + a2a: 8fd9 or a5,a5,a4 + a2c: d6be sw a5,108(sp) + +00000a2e <.L141>: + a2e: 5712 lw a4,36(sp) + a30: 6791 lui a5,0x4 + a32: 17fd add a5,a5,-1 # 3fff <.LLST246+0x1acb> + a34: 97ba add a5,a5,a4 + +00000a36 <.LVL405>: + a36: 38f05e63 blez a5,dd2 <.L146> + a3a: 5736 lw a4,108(sp) + a3c: 00777693 and a3,a4,7 + a40: c69d beqz a3,a6e <.L147> + a42: 00f77693 and a3,a4,15 + a46: 4611 li a2,4 + a48: 02c68363 beq a3,a2,a6e <.L147> + +00000a4c <.LBB187>: + a4c: 0711 add a4,a4,4 + a4e: 00473693 sltiu a3,a4,4 + a52: d6ba sw a4,108(sp) + +00000a54 <.LVL406>: + a54: 5746 lw a4,112(sp) + +00000a56 <.LVL407>: + a56: 9736 add a4,a4,a3 + a58: d8ba sw a4,112(sp) + +00000a5a <.LVL408>: + a5a: 00d73733 sltu a4,a4,a3 + +00000a5e <.LVL409>: + a5e: 56d6 lw a3,116(sp) + a60: 9736 add a4,a4,a3 + +00000a62 <.LVL410>: + a62: daba sw a4,116(sp) + +00000a64 <.LVL411>: + a64: 00d73733 sltu a4,a4,a3 + +00000a68 <.LVL412>: + a68: 56e6 lw a3,120(sp) + a6a: 9736 add a4,a4,a3 + +00000a6c <.LVL413>: + a6c: dcba sw a4,120(sp) + +00000a6e <.L147>: + a6e: 5766 lw a4,120(sp) + a70: 001006b7 lui a3,0x100 + a74: 8ef9 and a3,a3,a4 + a76: ca89 beqz a3,a88 <.L152> + a78: fff007b7 lui a5,0xfff00 + +00000a7c <.LVL415>: + a7c: 17fd add a5,a5,-1 # ffefffff <.LLST246+0xffefdacb> + a7e: 8f7d and a4,a4,a5 + a80: dcba sw a4,120(sp) + a82: 5712 lw a4,36(sp) + a84: 6791 lui a5,0x4 + +00000a86 <.LVL416>: + a86: 97ba add a5,a5,a4 + +00000a88 <.L152>: + a88: 10f8 add a4,sp,108 + a8a: 18ac add a1,sp,120 + +00000a8c <.L153>: + a8c: 4314 lw a3,0(a4) + a8e: 4350 lw a2,4(a4) + a90: 828d srl a3,a3,0x3 + a92: 0676 sll a2,a2,0x1d + a94: 8ed1 or a3,a3,a2 + a96: c314 sw a3,0(a4) + a98: 0711 add a4,a4,4 + a9a: feb719e3 bne a4,a1,a8c <.L153> + +00000a9e <.LBE188>: + a9e: 66a1 lui a3,0x8 + aa0: ffe68613 add a2,a3,-2 # 7ffe <.LLST246+0x5aca> + +00000aa4 <.LBB189>: + aa4: 5766 lw a4,120(sp) + +00000aa6 <.LBE189>: + aa6: 30f64f63 blt a2,a5,dc4 <.L154> + +00000aaa <.LBB190>: + aaa: 830d srl a4,a4,0x3 + aac: dcba sw a4,120(sp) + +00000aae <.L155>: + aae: 4702 lw a4,0(sp) + ab0: 55b6 lw a1,108(sp) + ab2: 5646 lw a2,112(sp) + ab4: 56d6 lw a3,116(sp) + ab6: 4502 lw a0,0(sp) + ab8: c30c sw a1,0(a4) + aba: c350 sw a2,4(a4) + abc: c714 sw a3,8(a4) + abe: 5766 lw a4,120(sp) + +00000ac0 <.LBE191>: + ac0: 408e lw ra,192(sp) + ac2: 547a lw s0,188(sp) + +00000ac4 <.LBB192>: + ac4: 00e51623 sh a4,12(a0) + ac8: 4772 lw a4,28(sp) + +00000aca <.LBE192>: + aca: 54ea lw s1,184(sp) + +00000acc <.LBB193>: + acc: 073e sll a4,a4,0xf + ace: 8fd9 or a5,a5,a4 + +00000ad0 <.LVL421>: + ad0: 00f51723 sh a5,14(a0) + +00000ad4 <.LBE193>: + ad4: 4762 lw a4,24(sp) + +00000ad6 <.LBB194>: + ad6: 455c lw a5,12(a0) + +00000ad8 <.LBE194>: + ad8: c30c sw a1,0(a4) + ada: c350 sw a2,4(a4) + adc: c714 sw a3,8(a4) + ade: c75c sw a5,12(a4) + ae0: 853a mv a0,a4 + ae2: 0c410113 add sp,sp,196 + +00000ae6 <.LVL423>: + ae6: 8082 ret + +00000ae8 <.L2>: + ae8: 00a7e633 or a2,a5,a0 + aec: 8e55 or a2,a2,a3 + aee: 8e59 or a2,a2,a4 + af0: 10060763 beqz a2,bfe <.L176> + +00000af4 <.LBB195>: + af4: c729 beqz a4,b3e <.L6> + af6: 853a mv a0,a4 + af8: 00000097 auipc ra,0x0 + afc: 000080e7 jalr ra # af8 <.LBB195+0x4> + +00000b00 <.LBB7>: + b00: ff450713 add a4,a0,-12 + +00000b04 <.LVL426>: + b04: 02000613 li a2,32 + b08: 8e19 sub a2,a2,a4 + +00000b0a <.LVL427>: + b0a: 4781 li a5,0 + +00000b0c <.L7>: + b0c: 40f005b3 neg a1,a5 + b10: 058a sll a1,a1,0x2 + b12: 04c10293 add t0,sp,76 + b16: 00c58693 add a3,a1,12 + b1a: 9696 add a3,a3,t0 + b1c: 40b00433 neg s0,a1 + +00000b20 <.L12>: + b20: 0ad29763 bne t0,a3,bce <.L15> + b24: fff78693 add a3,a5,-1 # 3fff <.LLST246+0x1acb> + +00000b28 <.LVL430>: + b28: 078a sll a5,a5,0x2 + b2a: 00f0 add a2,sp,76 + +00000b2c <.LVL431>: + b2c: 06c78793 add a5,a5,108 + b30: 97b2 add a5,a5,a2 + b32: 4636 lw a2,76(sp) + b34: 00e61733 sll a4,a2,a4 + +00000b38 <.LVL432>: + b38: f8e7aa23 sw a4,-108(a5) + b3c: a095 j ba0 <.L14> + +00000b3e <.L6>: + b3e: c295 beqz a3,b62 <.L8> + b40: 8536 mv a0,a3 + b42: 00000097 auipc ra,0x0 + b46: 000080e7 jalr ra # b42 <.L6+0x4> + +00000b4a <.LVL434>: + b4a: 02050513 add a0,a0,32 + +00000b4e <.L9>: + b4e: ff450713 add a4,a0,-12 + b52: 40575793 sra a5,a4,0x5 + +00000b56 <.LVL436>: + b56: 8b7d and a4,a4,31 + +00000b58 <.LVL437>: + b58: c70d beqz a4,b82 <.L11> + b5a: 02000613 li a2,32 + b5e: 8e19 sub a2,a2,a4 + +00000b60 <.LVL438>: + b60: b775 j b0c <.L7> + +00000b62 <.L8>: + b62: c901 beqz a0,b72 <.L10> + b64: 00000097 auipc ra,0x0 + b68: 000080e7 jalr ra # b64 <.L8+0x2> + +00000b6c <.LVL440>: + b6c: 04050513 add a0,a0,64 + b70: bff9 j b4e <.L9> + +00000b72 <.L10>: + b72: 853e mv a0,a5 + b74: 00000097 auipc ra,0x0 + b78: 000080e7 jalr ra # b74 <.L10+0x2> + +00000b7c <.LVL443>: + b7c: 06050513 add a0,a0,96 + b80: b7f9 j b4e <.L9> + +00000b82 <.L11>: + b82: 40f00633 neg a2,a5 + b86: 08b8 add a4,sp,88 + +00000b88 <.LVL446>: + b88: 060a sll a2,a2,0x2 + +00000b8a <.LBB9>: + b8a: 468d li a3,3 + +00000b8c <.L13>: + b8c: 00c705b3 add a1,a4,a2 + b90: 418c lw a1,0(a1) + b92: 16fd add a3,a3,-1 + +00000b94 <.LVL448>: + b94: 1771 add a4,a4,-4 + b96: c34c sw a1,4(a4) + +00000b98 <.LVL449>: + b98: fef6dae3 bge a3,a5,b8c <.L13> + b9c: fff78693 add a3,a5,-1 + +00000ba0 <.L14>: + ba0: 00168793 add a5,a3,1 + ba4: 078a sll a5,a5,0x2 + ba6: 46a1 li a3,8 + ba8: 00f8 add a4,sp,76 + baa: 00d7e863 bltu a5,a3,bba <.L16> + bae: 00072023 sw zero,0(a4) + bb2: 00072223 sw zero,4(a4) + bb6: 17e1 add a5,a5,-8 + bb8: 08d8 add a4,sp,84 + +00000bba <.L16>: + bba: 4691 li a3,4 + bbc: 00d7e463 bltu a5,a3,bc4 <.L17> + bc0: 00072023 sw zero,0(a4) + +00000bc4 <.L17>: + bc4: 7471 lui s0,0xffffc + bc6: 0445 add s0,s0,17 # ffffc011 <.LLST246+0xffff9add> + bc8: 8c09 sub s0,s0,a0 + bca: cb4ff06f j 7e <.L205> + +00000bce <.L15>: + bce: 428c lw a1,0(a3) + bd0: ffc6a303 lw t1,-4(a3) + bd4: 008683b3 add t2,a3,s0 + bd8: 00e595b3 sll a1,a1,a4 + bdc: 00c35333 srl t1,t1,a2 + be0: 0065e5b3 or a1,a1,t1 + be4: 00b3a023 sw a1,0(t2) + be8: 16f1 add a3,a3,-4 + bea: bf1d j b20 <.L12> + +00000bec <.L3>: + bec: 8fc9 or a5,a5,a0 + bee: 8fd5 or a5,a5,a3 + bf0: 8fd9 or a5,a5,a4 + bf2: 4709 li a4,2 + bf4: c8078663 beqz a5,80 <.L5> + bf8: 470d li a4,3 + bfa: c86ff06f j 80 <.L5> + +00000bfe <.L176>: + bfe: 4401 li s0,0 + +00000c00 <.LBE196>: + c00: 4705 li a4,1 + c02: c7eff06f j 80 <.L5> + +00000c06 <.L18>: + c06: 47a2 lw a5,8(sp) + +00000c08 <.LVL455>: + c08: 4692 lw a3,4(sp) + +00000c0a <.LVL456>: + c0a: 8fc5 or a5,a5,s1 + c0c: 8fd5 or a5,a5,a3 + c0e: 8fc9 or a5,a5,a0 + c10: 12078263 beqz a5,d34 <.L178> + +00000c14 <.LBB197>: + c14: c539 beqz a0,c62 <.L22> + c16: c23a sw a4,4(sp) + c18: 00000097 auipc ra,0x0 + c1c: 000080e7 jalr ra # c18 <.LBB197+0x4> + +00000c20 <.LBB14>: + c20: 4712 lw a4,4(sp) + c22: ff450693 add a3,a0,-12 + +00000c26 <.LVL458>: + c26: 02000593 li a1,32 + c2a: 8d95 sub a1,a1,a3 + +00000c2c <.LVL459>: + c2c: 4781 li a5,0 + +00000c2e <.L23>: + c2e: 40f00333 neg t1,a5 + c32: 030a sll t1,t1,0x2 + c34: 05c10393 add t2,sp,92 + c38: 00c30613 add a2,t1,12 + c3c: 406004b3 neg s1,t1 + c40: 961e add a2,a2,t2 + c42: c226 sw s1,4(sp) + +00000c44 <.L28>: + c44: 0ac39f63 bne t2,a2,d02 <.L31> + c48: fff78613 add a2,a5,-1 + +00000c4c <.LVL461>: + c4c: 078a sll a5,a5,0x2 + c4e: 00ec add a1,sp,76 + +00000c50 <.LVL462>: + c50: 06c78793 add a5,a5,108 + c54: 97ae add a5,a5,a1 + c56: 45f6 lw a1,92(sp) + c58: 00d596b3 sll a3,a1,a3 + +00000c5c <.LVL463>: + c5c: fad7a223 sw a3,-92(a5) + c60: a895 j cd4 <.L30> + +00000c62 <.L22>: + c62: 4792 lw a5,4(sp) + c64: c785 beqz a5,c8c <.L24> + c66: 853e mv a0,a5 + c68: c43a sw a4,8(sp) + c6a: 00000097 auipc ra,0x0 + c6e: 000080e7 jalr ra # c6a <.L22+0x8> + +00000c72 <.LVL465>: + c72: 4722 lw a4,8(sp) + c74: 02050513 add a0,a0,32 + +00000c78 <.L25>: + c78: ff450693 add a3,a0,-12 + c7c: 4056d793 sra a5,a3,0x5 + +00000c80 <.LVL467>: + c80: 8afd and a3,a3,31 + +00000c82 <.LVL468>: + c82: ca85 beqz a3,cb2 <.L27> + c84: 02000593 li a1,32 + c88: 8d95 sub a1,a1,a3 + +00000c8a <.LVL469>: + c8a: b755 j c2e <.L23> + +00000c8c <.L24>: + c8c: c23a sw a4,4(sp) + c8e: c891 beqz s1,ca2 <.L26> + c90: 8526 mv a0,s1 + c92: 00000097 auipc ra,0x0 + c96: 000080e7 jalr ra # c92 <.L24+0x6> + +00000c9a <.LVL471>: + c9a: 04050513 add a0,a0,64 + +00000c9e <.L206>: + c9e: 4712 lw a4,4(sp) + +00000ca0 <.LVL473>: + ca0: bfe1 j c78 <.L25> + +00000ca2 <.L26>: + ca2: 4522 lw a0,8(sp) + ca4: 00000097 auipc ra,0x0 + ca8: 000080e7 jalr ra # ca4 <.L26+0x2> + +00000cac <.LVL475>: + cac: 06050513 add a0,a0,96 + +00000cb0 <.LVL476>: + cb0: b7fd j c9e <.L206> + +00000cb2 <.L27>: + cb2: 40f005b3 neg a1,a5 + cb6: 10b4 add a3,sp,104 + +00000cb8 <.LVL478>: + cb8: 058a sll a1,a1,0x2 + +00000cba <.LBB16>: + cba: 460d li a2,3 + +00000cbc <.L29>: + cbc: 00b68333 add t1,a3,a1 + cc0: 00032303 lw t1,0(t1) + cc4: 167d add a2,a2,-1 + +00000cc6 <.LVL480>: + cc6: 16f1 add a3,a3,-4 + cc8: 0066a223 sw t1,4(a3) + +00000ccc <.LVL481>: + ccc: fef658e3 bge a2,a5,cbc <.L29> + cd0: fff78613 add a2,a5,-1 + +00000cd4 <.L30>: + cd4: 00160793 add a5,a2,1 + cd8: 078a sll a5,a5,0x2 + cda: 4621 li a2,8 + cdc: 08f4 add a3,sp,92 + cde: 00c7e863 bltu a5,a2,cee <.L32> + ce2: 0006a023 sw zero,0(a3) + ce6: 0006a223 sw zero,4(a3) + cea: 17e1 add a5,a5,-8 + cec: 10d4 add a3,sp,100 + +00000cee <.L32>: + cee: 4611 li a2,4 + cf0: 00c7e463 bltu a5,a2,cf8 <.L33> + cf4: 0006a023 sw zero,0(a3) + +00000cf8 <.L33>: + cf8: 77f1 lui a5,0xffffc + cfa: 07c5 add a5,a5,17 # ffffc011 <.LLST246+0xffff9add> + cfc: 8f89 sub a5,a5,a0 + cfe: be2ff06f j e0 <.L207> + +00000d02 <.L31>: + d02: 00062303 lw t1,0(a2) + d06: ffc62283 lw t0,-4(a2) + d0a: 4492 lw s1,4(sp) + d0c: 00d31333 sll t1,t1,a3 + d10: 00b2d2b3 srl t0,t0,a1 + d14: 94b2 add s1,s1,a2 + d16: 00536333 or t1,t1,t0 + d1a: 0064a023 sw t1,0(s1) + d1e: 1671 add a2,a2,-4 + d20: b715 j c44 <.L28> + +00000d22 <.L19>: + d22: 46a2 lw a3,8(sp) + d24: 4612 lw a2,4(sp) + d26: 8ec5 or a3,a3,s1 + d28: 8ed1 or a3,a3,a2 + d2a: 8ec9 or a3,a3,a0 + d2c: ea81 bnez a3,d3c <.L179> + d2e: 4689 li a3,2 + d30: bb2ff06f j e2 <.L21> + +00000d34 <.L178>: + d34: 4781 li a5,0 + +00000d36 <.LBE198>: + d36: 4685 li a3,1 + d38: baaff06f j e2 <.L21> + +00000d3c <.L179>: + d3c: 468d li a3,3 + d3e: ba4ff06f j e2 <.L21> + +00000d42 <.L35>: + d42: 4605 li a2,1 + d44: 00f617b3 sll a5,a2,a5 + d48: 5307f613 and a2,a5,1328 + d4c: ea05 bnez a2,d7c <.L38> + d4e: 0887f713 and a4,a5,136 + d52: eb39 bnez a4,da8 <.L39> + d54: 2407f793 and a5,a5,576 + d58: ba078a63 beqz a5,10c <.L36> + +00000d5c <.L40>: + d5c: 67a1 lui a5,0x8 + d5e: dcbe sw a5,120(sp) + d60: da82 sw zero,116(sp) + d62: d882 sw zero,112(sp) + d64: d682 sw zero,108(sp) + +00000d66 <.LVL489>: + d66: 17fd add a5,a5,-1 # 7fff <.LLST246+0x5acb> + d68: ce02 sw zero,28(sp) + d6a: b391 j aae <.L155> + +00000d6c <.L34>: + d6c: 463d li a2,15 + d6e: fec787e3 beq a5,a2,d5c <.L40> + d72: 462d li a2,11 + d74: 02c78a63 beq a5,a2,da8 <.L39> + +00000d78 <.LBB199>: + d78: 47c2 lw a5,16(sp) + d7a: ce3e sw a5,28(sp) + +00000d7c <.L38>: + d7c: 47b6 lw a5,76(sp) + d7e: d6be sw a5,108(sp) + d80: 47c6 lw a5,80(sp) + d82: d8be sw a5,112(sp) + d84: 47d6 lw a5,84(sp) + d86: dabe sw a5,116(sp) + d88: 47e6 lw a5,88(sp) + +00000d8a <.L143>: + d8a: dcbe sw a5,120(sp) + d8c: 4789 li a5,2 + d8e: 1af70063 beq a4,a5,f2e <.L144> + d92: 478d li a5,3 + d94: fcf704e3 beq a4,a5,d5c <.L40> + d98: 4785 li a5,1 + d9a: c8f71ae3 bne a4,a5,a2e <.L141> + +00000d9e <.L208>: + d9e: dc82 sw zero,120(sp) + da0: da82 sw zero,116(sp) + da2: d882 sw zero,112(sp) + +00000da4 <.LBB208>: + da4: d682 sw zero,108(sp) + da6: aa8d j f18 <.L175> + +00000da8 <.L39>: + da8: 47b2 lw a5,12(sp) + daa: ce3e sw a5,28(sp) + +00000dac <.L37>: + dac: 47f6 lw a5,92(sp) + dae: 8736 mv a4,a3 + db0: d6be sw a5,108(sp) + db2: 5786 lw a5,96(sp) + db4: d8be sw a5,112(sp) + db6: 5796 lw a5,100(sp) + db8: dabe sw a5,116(sp) + dba: 57a6 lw a5,104(sp) + +00000dbc <.LVL497>: + dbc: b7f9 j d8a <.L143> + +00000dbe <.L180>: + dbe: 57a2 lw a5,40(sp) + dc0: d23e sw a5,36(sp) + +00000dc2 <.LVL499>: + dc2: b1b5 j a2e <.L141> + +00000dc4 <.L154>: + dc4: dc82 sw zero,120(sp) + dc6: da82 sw zero,116(sp) + dc8: d882 sw zero,112(sp) + dca: d682 sw zero,108(sp) + dcc: fff68793 add a5,a3,-1 + dd0: b9f9 j aae <.L155> + +00000dd2 <.L146>: + dd2: 4705 li a4,1 + dd4: c791 beqz a5,de0 <.L156> + dd6: 8f1d sub a4,a4,a5 + +00000dd8 <.LVL502>: + dd8: 07400793 li a5,116 + ddc: 14e7c063 blt a5,a4,f1c <.L157> + +00000de0 <.L156>: + de0: 10f4 add a3,sp,108 + de2: 40575513 sra a0,a4,0x5 + +00000de6 <.LVL504>: + de6: 85b6 mv a1,a3 + de8: 8b7d and a4,a4,31 + +00000dea <.LVL505>: + dea: 4781 li a5,0 + dec: 4601 li a2,0 + +00000dee <.L158>: + dee: 02a61563 bne a2,a0,e18 <.L159> + df2: 460d li a2,3 + +00000df4 <.LVL507>: + df4: 8e09 sub a2,a2,a0 + df6: 00251313 sll t1,a0,0x2 + dfa: e715 bnez a4,e26 <.L160> + dfc: 85b6 mv a1,a3 + +00000dfe <.L161>: + dfe: 006582b3 add t0,a1,t1 + e02: 0002a283 lw t0,0(t0) + e06: 0705 add a4,a4,1 + +00000e08 <.LVL509>: + e08: 0055a023 sw t0,0(a1) + +00000e0c <.LVL510>: + e0c: 0591 add a1,a1,4 + e0e: fee658e3 bge a2,a4,dfe <.L161> + e12: 4591 li a1,4 + e14: 8d89 sub a1,a1,a0 + e16: a0b9 j e64 <.L165> + +00000e18 <.L159>: + e18: 0005a303 lw t1,0(a1) + e1c: 0605 add a2,a2,1 + +00000e1e <.LVL512>: + e1e: 0591 add a1,a1,4 + e20: 0067e7b3 or a5,a5,t1 + +00000e24 <.LVL513>: + e24: b7e9 j dee <.L158> + +00000e26 <.L160>: + e26: 00e0 add s0,sp,76 + e28: 06c30593 add a1,t1,108 + e2c: 95a2 add a1,a1,s0 + e2e: fb45a583 lw a1,-76(a1) + e32: 02000293 li t0,32 + e36: 40e282b3 sub t0,t0,a4 + e3a: 005595b3 sll a1,a1,t0 + e3e: 8fcd or a5,a5,a1 + +00000e40 <.LVL515>: + e40: 10ec add a1,sp,108 + e42: 959a add a1,a1,t1 + e44: 8436 mv s0,a3 + e46: 4381 li t2,0 + +00000e48 <.L163>: + e48: 08c3cb63 blt t2,a2,ede <.L164> + e4c: 4591 li a1,4 + e4e: 060a sll a2,a2,0x2 + e50: 8d89 sub a1,a1,a0 + +00000e52 <.LVL517>: + e52: 06c60613 add a2,a2,108 + e56: 00e8 add a0,sp,76 + +00000e58 <.LVL518>: + e58: 962a add a2,a2,a0 + e5a: 5566 lw a0,120(sp) + e5c: 00e55733 srl a4,a0,a4 + +00000e60 <.LVL519>: + e60: fae62a23 sw a4,-76(a2) + +00000e64 <.L165>: + e64: 4711 li a4,4 + e66: 8f0d sub a4,a4,a1 + e68: 10f0 add a2,sp,108 + e6a: 058a sll a1,a1,0x2 + e6c: 95b2 add a1,a1,a2 + e6e: 070a sll a4,a4,0x2 + e70: 4621 li a2,8 + e72: 00c76863 bltu a4,a2,e82 <.L166> + e76: 0005a023 sw zero,0(a1) + e7a: 0005a223 sw zero,4(a1) + e7e: 1761 add a4,a4,-8 + e80: 05a1 add a1,a1,8 + +00000e82 <.L166>: + e82: 4611 li a2,4 + e84: 00c76463 bltu a4,a2,e8c <.L167> + e88: 0005a023 sw zero,0(a1) + +00000e8c <.L167>: + e8c: 5736 lw a4,108(sp) + +00000e8e <.LBB203>: + e8e: 00f037b3 snez a5,a5 + +00000e92 <.LBE203>: + e92: 8fd9 or a5,a5,a4 + e94: d6be sw a5,108(sp) + +00000e96 <.LBE201>: + e96: 0077f713 and a4,a5,7 + e9a: c71d beqz a4,ec8 <.L168> + e9c: 00f7f713 and a4,a5,15 + ea0: 4611 li a2,4 + ea2: 02c70363 beq a4,a2,ec8 <.L168> + +00000ea6 <.LBB205>: + ea6: 5746 lw a4,112(sp) + ea8: 0791 add a5,a5,4 + eaa: d6be sw a5,108(sp) + +00000eac <.LVL522>: + eac: 0047b793 sltiu a5,a5,4 + +00000eb0 <.LVL523>: + eb0: 97ba add a5,a5,a4 + eb2: d8be sw a5,112(sp) + +00000eb4 <.LVL524>: + eb4: 00e7b7b3 sltu a5,a5,a4 + +00000eb8 <.LVL525>: + eb8: 5756 lw a4,116(sp) + eba: 97ba add a5,a5,a4 + +00000ebc <.LVL526>: + ebc: dabe sw a5,116(sp) + +00000ebe <.LVL527>: + ebe: 00e7b7b3 sltu a5,a5,a4 + +00000ec2 <.LVL528>: + ec2: 5766 lw a4,120(sp) + ec4: 97ba add a5,a5,a4 + +00000ec6 <.LVL529>: + ec6: dcbe sw a5,120(sp) + +00000ec8 <.L168>: + ec8: 5766 lw a4,120(sp) + eca: 000807b7 lui a5,0x80 + ece: 8ff9 and a5,a5,a4 + ed0: c795 beqz a5,efc <.L173> + +00000ed2 <.LVL531>: + ed2: dc82 sw zero,120(sp) + ed4: da82 sw zero,116(sp) + ed6: d882 sw zero,112(sp) + ed8: d682 sw zero,108(sp) + eda: 4785 li a5,1 + edc: bec9 j aae <.L155> + +00000ede <.L164>: + ede: 0005a303 lw t1,0(a1) + ee2: 41c4 lw s1,4(a1) + ee4: 0385 add t2,t2,1 + +00000ee6 <.LVL533>: + ee6: 00e35333 srl t1,t1,a4 + eea: 005494b3 sll s1,s1,t0 + eee: 00936333 or t1,t1,s1 + ef2: 00642023 sw t1,0(s0) + +00000ef6 <.LVL534>: + ef6: 0591 add a1,a1,4 + ef8: 0411 add s0,s0,4 + efa: b7b9 j e48 <.L163> + +00000efc <.L173>: + efc: 00c68613 add a2,a3,12 + +00000f00 <.L174>: + f00: 429c lw a5,0(a3) + f02: 42d8 lw a4,4(a3) + f04: 838d srl a5,a5,0x3 + f06: 0776 sll a4,a4,0x1d + f08: 8fd9 or a5,a5,a4 + f0a: c29c sw a5,0(a3) + f0c: 0691 add a3,a3,4 + f0e: fed619e3 bne a2,a3,f00 <.L174> + +00000f12 <.LVL536>: + f12: 57e6 lw a5,120(sp) + f14: 838d srl a5,a5,0x3 + f16: dcbe sw a5,120(sp) + +00000f18 <.L175>: + f18: 4781 li a5,0 + f1a: be51 j aae <.L155> + +00000f1c <.L157>: + f1c: 5746 lw a4,112(sp) + f1e: 57b6 lw a5,108(sp) + f20: 8fd9 or a5,a5,a4 + f22: 5756 lw a4,116(sp) + f24: 8fd9 or a5,a5,a4 + f26: 5766 lw a4,120(sp) + f28: 8fd9 or a5,a5,a4 + f2a: d7fd beqz a5,f18 <.L175> + f2c: bd8d j d9e <.L208> + +00000f2e <.L144>: + f2e: 67a1 lui a5,0x8 + f30: dc82 sw zero,120(sp) + f32: da82 sw zero,116(sp) + f34: d882 sw zero,112(sp) + f36: d682 sw zero,108(sp) + f38: 17fd add a5,a5,-1 # 7fff <.LLST246+0x5acb> + f3a: be95 j aae <.L155> + +negtf2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__negtf2>: + 0: 0005a283 lw t0,0(a1) + 4: 0045a303 lw t1,4(a1) + 8: 4590 lw a2,8(a1) + a: 45cc lw a1,12(a1) + +0000000c <.LBB3>: + c: 1111 add sp,sp,-28 + e: 00f10793 add a5,sp,15 + +00000012 <.LBB4>: + 12: 0105d693 srl a3,a1,0x10 + 16: 63a1 lui t2,0x8 + +00000018 <.LBE4>: + 18: 9bc1 and a5,a5,-16 + +0000001a <.LBB5>: + 1a: 0076c6b3 xor a3,a3,t2 + +0000001e <.LBB6>: + 1e: 00b79623 sh a1,12(a5) + 22: 00d79723 sh a3,14(a5) + +00000026 <.LBB7>: + 26: 0057a023 sw t0,0(a5) + 2a: 0067a223 sw t1,4(a5) + 2e: c790 sw a2,8(a5) + +00000030 <.LBB8>: + 30: 47dc lw a5,12(a5) + +00000032 <.LBE8>: + 32: 00552023 sw t0,0(a0) + 36: 00652223 sw t1,4(a0) + 3a: c510 sw a2,8(a0) + 3c: c55c sw a5,12(a0) + 3e: 0171 add sp,sp,28 + 40: 8082 ret + +subtf3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__subtf3>: + 0: f7c10113 add sp,sp,-132 + 4: 45dc lw a5,12(a1) + 6: 4598 lw a4,8(a1) + 8: 0005a383 lw t2,0(a1) + c: 0045a283 lw t0,4(a1) + 10: 00062303 lw t1,0(a2) + 14: 460c lw a1,8(a2) + 16: 4654 lw a3,12(a2) + 18: cc2a sw a0,24(sp) + 1a: 4248 lw a0,4(a2) + 1c: 06b10613 add a2,sp,107 + 20: dea2 sw s0,124(sp) + 22: 9a41 and a2,a2,-16 + 24: c106 sw ra,128(sp) + 26: dca6 sw s1,120(sp) + +00000028 <.LBB3>: + 28: c618 sw a4,8(a2) + 2a: da3a sw a4,52(sp) + 2c: 01079713 sll a4,a5,0x10 + 30: 00179413 sll s0,a5,0x1 + 34: 00762023 sw t2,0(a2) + 38: c65c sw a5,12(a2) + 3a: d61e sw t2,44(sp) + 3c: 83fd srl a5,a5,0x1f + 3e: 8341 srl a4,a4,0x10 + 40: 02c10393 add t2,sp,44 + 44: 00562223 sw t0,4(a2) + 48: d816 sw t0,48(sp) + 4a: c63e sw a5,12(sp) + +0000004c <.LBE3>: + 4c: c832 sw a2,16(sp) + +0000004e <.LBB4>: + 4e: dc3a sw a4,56(sp) + 50: 8045 srl s0,s0,0x11 + +00000052 <.LBB5>: + 52: 02010293 add t0,sp,32 + +00000056 <.LBB6>: + 56: 879e mv a5,t2 + +00000058 <.L2>: + 58: 47d8 lw a4,12(a5) + 5a: 4790 lw a2,8(a5) + 5c: 17f1 add a5,a5,-4 + 5e: 070e sll a4,a4,0x3 + 60: 8275 srl a2,a2,0x1d + 62: 8f51 or a4,a4,a2 + 64: cb98 sw a4,16(a5) + 66: fef299e3 bne t0,a5,58 <.L2> + +0000006a <.LBB8>: + 6a: 4742 lw a4,16(sp) + +0000006c <.LBB9>: + 6c: 57b2 lw a5,44(sp) + +0000006e <.LBB10>: + 6e: de1a sw t1,60(sp) + 70: 00672023 sw t1,0(a4) + 74: c754 sw a3,12(a4) + 76: c348 sw a0,4(a4) + 78: c70c sw a1,8(a4) + 7a: 01069713 sll a4,a3,0x10 + 7e: 8341 srl a4,a4,0x10 + 80: c4ba sw a4,72(sp) + 82: 00169713 sll a4,a3,0x1 + 86: 8345 srl a4,a4,0x11 + +00000088 <.LBB11>: + 88: 078e sll a5,a5,0x3 + +0000008a <.LBB12>: + 8a: ca3a sw a4,20(sp) + 8c: 1878 add a4,sp,60 + +0000008e <.LBB13>: + 8e: d63e sw a5,44(sp) + +00000090 <.LBB14>: + 90: c0aa sw a0,64(sp) + 92: c2ae sw a1,68(sp) + +00000094 <.LVL5>: + 94: 82fd srl a3,a3,0x1f + +00000096 <.LBB15>: + 96: 03010313 add t1,sp,48 + +0000009a <.LBB16>: + 9a: 863a mv a2,a4 + +0000009c <.L3>: + 9c: 464c lw a1,12(a2) + 9e: 4608 lw a0,8(a2) + a0: 1671 add a2,a2,-4 + a2: 058e sll a1,a1,0x3 + a4: 8175 srl a0,a0,0x1d + a6: 8dc9 or a1,a1,a0 + a8: ca0c sw a1,16(a2) + aa: fec319e3 bne t1,a2,9c <.L3> + +000000ae <.LVL8>: + ae: 5672 lw a2,60(sp) + +000000b0 <.LBE17>: + b0: 45d2 lw a1,20(sp) + b2: 6321 lui t1,0x8 + +000000b4 <.LBB18>: + b4: 00361493 sll s1,a2,0x3 + b8: 4652 lw a2,20(sp) + ba: de26 sw s1,60(sp) + +000000bc <.LBE18>: + bc: 137d add t1,t1,-1 # 7fff <.LLST157+0x5601> + be: 40c40633 sub a2,s0,a2 + c2: 06659363 bne a1,t1,128 <.L4> + c6: 4586 lw a1,64(sp) + c8: 4716 lw a4,68(sp) + +000000ca <.LBB19>: + ca: ce32 sw a2,28(sp) + +000000cc <.LBE19>: + cc: 8f4d or a4,a4,a1 + ce: 45a6 lw a1,72(sp) + d0: 8f4d or a4,a4,a1 + d2: 8f45 or a4,a4,s1 + d4: c721 beqz a4,11c <.L5> + d6: 4732 lw a4,12(sp) + +000000d8 <.LBB54>: + d8: c236 sw a3,4(sp) + +000000da <.L353>: + da: 02d719e3 bne a4,a3,90c <.L7> + +000000de <.L6>: + de: 4706 lw a4,64(sp) + e0: c03a sw a4,0(sp) + e2: 4716 lw a4,68(sp) + e4: c23a sw a4,4(sp) + e6: 4726 lw a4,72(sp) + e8: c43a sw a4,8(sp) + +000000ea <.LBB56>: + ea: 40060a63 beqz a2,4fe <.L48> + ee: 4752 lw a4,20(sp) + f0: 408705b3 sub a1,a4,s0 + +000000f4 <.LVL10>: + f4: 2a041f63 bnez s0,3b2 <.L49> + f8: 5642 lw a2,48(sp) + fa: 5752 lw a4,52(sp) + +000000fc <.LVL11>: + fc: 5562 lw a0,56(sp) + fe: 00e666b3 or a3,a2,a4 + 102: 8ec9 or a3,a3,a0 + 104: 8edd or a3,a3,a5 + 106: 24069a63 bnez a3,35a <.L50> + +0000010a <.LVL12>: + 10a: 4782 lw a5,0(sp) + 10c: c6a6 sw s1,76(sp) + 10e: c8be sw a5,80(sp) + 110: 4792 lw a5,4(sp) + 112: cabe sw a5,84(sp) + 114: 47a2 lw a5,8(sp) + +00000116 <.L362>: + 116: ccbe sw a5,88(sp) + +00000118 <.LBE20>: + 118: 842e mv s0,a1 + 11a: a905 j 54a <.L11> + +0000011c <.L5>: + 11c: 0016c713 xor a4,a3,1 + 120: c23a sw a4,4(sp) + +00000122 <.LVL15>: + 122: 4692 lw a3,4(sp) + 124: 4732 lw a4,12(sp) + +00000126 <.LVL16>: + 126: bf55 j da <.L353> + +00000128 <.L4>: + 128: 0016c693 xor a3,a3,1 + +0000012c <.LVL18>: + 12c: c236 sw a3,4(sp) + +0000012e <.LVL19>: + 12e: 4592 lw a1,4(sp) + 130: 46b2 lw a3,12(sp) + +00000132 <.LBB57>: + 132: ce32 sw a2,28(sp) + +00000134 <.LBE57>: + 134: 5cb69d63 bne a3,a1,70e <.L8> + +00000138 <.LBB58>: + 138: fac053e3 blez a2,de <.L6> + +0000013c <.LVL22>: + 13c: 56c2 lw a3,48(sp) + +0000013e <.LVL23>: + 13e: c036 sw a3,0(sp) + 140: 56d2 lw a3,52(sp) + 142: c236 sw a3,4(sp) + 144: 56e2 lw a3,56(sp) + 146: c436 sw a3,8(sp) + 148: 46d2 lw a3,20(sp) + 14a: eea5 bnez a3,1c2 <.L9> + 14c: 4506 lw a0,64(sp) + 14e: 4596 lw a1,68(sp) + +00000150 <.LVL24>: + 150: 42a6 lw t0,72(sp) + 152: 00b566b3 or a3,a0,a1 + 156: 0056e6b3 or a3,a3,t0 + 15a: 8ec5 or a3,a3,s1 + 15c: ea91 bnez a3,170 <.L10> + +0000015e <.L358>: + 15e: c6be sw a5,76(sp) + 160: 4782 lw a5,0(sp) + +00000162 <.LBB110>: + 162: 8432 mv s0,a2 + +00000164 <.LBB111>: + 164: c8be sw a5,80(sp) + 166: 4792 lw a5,4(sp) + 168: cabe sw a5,84(sp) + 16a: 47a2 lw a5,8(sp) + 16c: ccbe sw a5,88(sp) + +0000016e <.LBB112>: + 16e: aef1 j 54a <.L11> + +00000170 <.L10>: + 170: fff60693 add a3,a2,-1 + +00000174 <.LVL28>: + 174: ee8d bnez a3,1ae <.L12> + +00000176 <.LBB25>: + 176: 4682 lw a3,0(sp) + +00000178 <.LVL29>: + 178: 00978733 add a4,a5,s1 + 17c: c6ba sw a4,76(sp) + +0000017e <.LVL30>: + 17e: 96aa add a3,a3,a0 + +00000180 <.LVL31>: + 180: 00f73733 sltu a4,a4,a5 + +00000184 <.LVL32>: + 184: 4792 lw a5,4(sp) + 186: 9736 add a4,a4,a3 + +00000188 <.LVL33>: + 188: c8ba sw a4,80(sp) + +0000018a <.LVL34>: + 18a: 00a6b533 sltu a0,a3,a0 + +0000018e <.LVL35>: + 18e: 00d73733 sltu a4,a4,a3 + +00000192 <.LVL36>: + 192: 97ae add a5,a5,a1 + +00000194 <.LVL37>: + 194: 8d59 or a0,a0,a4 + +00000196 <.LVL38>: + 196: 953e add a0,a0,a5 + 198: 00b7b733 sltu a4,a5,a1 + +0000019c <.LVL39>: + 19c: caaa sw a0,84(sp) + +0000019e <.LVL40>: + 19e: 00f53533 sltu a0,a0,a5 + +000001a2 <.LVL41>: + 1a2: 47a2 lw a5,8(sp) + 1a4: 8f49 or a4,a4,a0 + +000001a6 <.LVL42>: + 1a6: 92be add t0,t0,a5 + 1a8: 9716 add a4,a4,t0 + +000001aa <.L354>: + 1aa: 4405 li s0,1 + +000001ac <.LBB118>: + 1ac: aa0d j 2de <.L23> + +000001ae <.L12>: + 1ae: 5a661ce3 bne a2,t1,f66 <.L24> + +000001b2 <.L365>: + 1b2: c6be sw a5,76(sp) + 1b4: a2f5 j 3a0 <.L364> + +000001b6 <.L268>: + 1b6: 87a6 mv a5,s1 + 1b8: bfed j 1b2 <.L365> + +000001ba <.L269>: + 1ba: c03a sw a4,0(sp) + 1bc: c236 sw a3,4(sp) + 1be: c432 sw a2,8(sp) + +000001c0 <.LVL48>: + 1c0: bfcd j 1b2 <.L365> + +000001c2 <.L9>: + 1c2: 00641a63 bne s0,t1,1d6 <.L25> + +000001c6 <.LVL50>: + 1c6: c6be sw a5,76(sp) + 1c8: 4782 lw a5,0(sp) + 1ca: c8be sw a5,80(sp) + 1cc: 4792 lw a5,4(sp) + 1ce: cabe sw a5,84(sp) + 1d0: 47a2 lw a5,8(sp) + +000001d2 <.L363>: + 1d2: ccbe sw a5,88(sp) + +000001d4 <.LBB122>: + 1d4: ae9d j 54a <.L11> + +000001d6 <.L25>: + 1d6: 46a6 lw a3,72(sp) + +000001d8 <.LVL53>: + 1d8: 000805b7 lui a1,0x80 + +000001dc <.LVL54>: + 1dc: 8ecd or a3,a3,a1 + 1de: c4b6 sw a3,72(sp) + +000001e0 <.LDL3>: + 1e0: 07400693 li a3,116 + 1e4: 58c6c5e3 blt a3,a2,f6e <.L26> + 1e8: 86b2 mv a3,a2 + +000001ea <.L264>: + 1ea: 4056d513 sra a0,a3,0x5 + +000001ee <.LVL56>: + 1ee: 85ba mv a1,a4 + 1f0: 8afd and a3,a3,31 + +000001f2 <.LVL57>: + 1f2: 4481 li s1,0 + 1f4: 4601 li a2,0 + +000001f6 <.L27>: + 1f6: 02a61463 bne a2,a0,21e <.L28> + 1fa: 460d li a2,3 + +000001fc <.LVL59>: + 1fc: 8e09 sub a2,a2,a0 + 1fe: 00251593 sll a1,a0,0x2 + 202: e68d bnez a3,22c <.L29> + +00000204 <.L30>: + 204: 00b70333 add t1,a4,a1 + 208: 00032303 lw t1,0(t1) + 20c: 0685 add a3,a3,1 + +0000020e <.LVL61>: + 20e: 00672023 sw t1,0(a4) + +00000212 <.LVL62>: + 212: 0711 add a4,a4,4 + 214: fed658e3 bge a2,a3,204 <.L30> + 218: 4711 li a4,4 + 21a: 8f09 sub a4,a4,a0 + 21c: a899 j 272 <.L34> + +0000021e <.L28>: + 21e: 0005a303 lw t1,0(a1) # 80000 <.LLST157+0x7d602> + 222: 0605 add a2,a2,1 + +00000224 <.LVL64>: + 224: 0591 add a1,a1,4 + 226: 0064e4b3 or s1,s1,t1 + +0000022a <.LVL65>: + 22a: b7f1 j 1f6 <.L27> + +0000022c <.L29>: + 22c: 02000293 li t0,32 + 230: 40d28333 sub t1,t0,a3 + 234: ca1a sw t1,20(sp) + +00000236 <.LVL67>: + 236: 02c10293 add t0,sp,44 + 23a: 04c58313 add t1,a1,76 + 23e: 9316 add t1,t1,t0 + 240: fc432303 lw t1,-60(t1) + 244: 42d2 lw t0,20(sp) + 246: 4381 li t2,0 + 248: 00531333 sll t1,t1,t0 + 24c: 0064e4b3 or s1,s1,t1 + +00000250 <.LVL68>: + 250: 03c10313 add t1,sp,60 + 254: 959a add a1,a1,t1 + +00000256 <.L32>: + 256: 0cc3cf63 blt t2,a2,334 <.L33> + 25a: 060a sll a2,a2,0x2 + 25c: 106c add a1,sp,44 + 25e: 04c60613 add a2,a2,76 + 262: 962e add a2,a2,a1 + 264: 45a6 lw a1,72(sp) + 266: 4711 li a4,4 + 268: 8f09 sub a4,a4,a0 + +0000026a <.LVL70>: + 26a: 00d5d5b3 srl a1,a1,a3 + 26e: fcb62223 sw a1,-60(a2) + +00000272 <.L34>: + 272: 4691 li a3,4 + 274: 8e99 sub a3,a3,a4 + 276: 1870 add a2,sp,60 + 278: 070a sll a4,a4,0x2 + 27a: 9732 add a4,a4,a2 + 27c: 068a sll a3,a3,0x2 + 27e: 4621 li a2,8 + 280: 00c6e863 bltu a3,a2,290 <.L35> + 284: 00072023 sw zero,0(a4) + +00000288 <.LVL72>: + 288: 00072223 sw zero,4(a4) + 28c: 16e1 add a3,a3,-8 + 28e: 0721 add a4,a4,8 + +00000290 <.L35>: + 290: 4611 li a2,4 + 292: 00c6e463 bltu a3,a2,29a <.L36> + 296: 00072023 sw zero,0(a4) + +0000029a <.L36>: + 29a: 56f2 lw a3,60(sp) + +0000029c <.LBB28>: + 29c: 00903733 snez a4,s1 + +000002a0 <.LBE28>: + 2a0: 8f55 or a4,a4,a3 + +000002a2 <.L37>: + 2a2: 4686 lw a3,64(sp) + 2a4: 4602 lw a2,0(sp) + +000002a6 <.LBB30>: + 2a6: de3a sw a4,60(sp) + +000002a8 <.LBB31>: + 2a8: 973e add a4,a4,a5 + 2aa: 9636 add a2,a2,a3 + 2ac: c6ba sw a4,76(sp) + +000002ae <.LVL75>: + 2ae: 00f73733 sltu a4,a4,a5 + +000002b2 <.LVL76>: + 2b2: 00e607b3 add a5,a2,a4 + 2b6: 4592 lw a1,4(sp) + 2b8: 4716 lw a4,68(sp) + +000002ba <.LVL77>: + 2ba: c8be sw a5,80(sp) + +000002bc <.LVL78>: + 2bc: 00d636b3 sltu a3,a2,a3 + +000002c0 <.LVL79>: + 2c0: 00c7b7b3 sltu a5,a5,a2 + +000002c4 <.LVL80>: + 2c4: 95ba add a1,a1,a4 + +000002c6 <.LVL81>: + 2c6: 8edd or a3,a3,a5 + +000002c8 <.LVL82>: + 2c8: 96ae add a3,a3,a1 + 2ca: cab6 sw a3,84(sp) + +000002cc <.LVL83>: + 2cc: 00e5b733 sltu a4,a1,a4 + +000002d0 <.LVL84>: + 2d0: 00b6b6b3 sltu a3,a3,a1 + +000002d4 <.LVL85>: + 2d4: 8f55 or a4,a4,a3 + +000002d6 <.LVL86>: + 2d6: 47a6 lw a5,72(sp) + +000002d8 <.LVL87>: + 2d8: 46a2 lw a3,8(sp) + +000002da <.LVL88>: + 2da: 97b6 add a5,a5,a3 + 2dc: 973e add a4,a4,a5 + +000002de <.L23>: + 2de: 000807b7 lui a5,0x80 + +000002e2 <.LBB32>: + 2e2: ccba sw a4,88(sp) + +000002e4 <.LBE32>: + 2e4: 8ff9 and a5,a5,a4 + 2e6: 26078263 beqz a5,54a <.L11> + 2ea: fff807b7 lui a5,0xfff80 + 2ee: 17fd add a5,a5,-1 # fff7ffff <.LLST157+0xfff7d601> + 2f0: 8f7d and a4,a4,a5 + 2f2: ccba sw a4,88(sp) + +000002f4 <.LBB33>: + 2f4: 4736 lw a4,76(sp) + +000002f6 <.LBE33>: + 2f6: 0405 add s0,s0,1 + +000002f8 <.LBB35>: + 2f8: 08ac add a1,sp,88 + 2fa: 01f71693 sll a3,a4,0x1f + +000002fe <.LVL92>: + 2fe: 00f8 add a4,sp,76 + +00000300 <.L120>: + 300: 431c lw a5,0(a4) + 302: 4350 lw a2,4(a4) + 304: 8385 srl a5,a5,0x1 + 306: 067e sll a2,a2,0x1f + 308: 8fd1 or a5,a5,a2 + 30a: c31c sw a5,0(a4) + 30c: 0711 add a4,a4,4 + 30e: fee599e3 bne a1,a4,300 <.L120> + +00000312 <.LVL94>: + 312: 47e6 lw a5,88(sp) + 314: 00d03733 snez a4,a3 + 318: 8385 srl a5,a5,0x1 + 31a: ccbe sw a5,88(sp) + +0000031c <.LBE35>: + 31c: 47b6 lw a5,76(sp) + 31e: 8fd9 or a5,a5,a4 + 320: c6be sw a5,76(sp) + +00000322 <.LBE36>: + 322: 67a1 lui a5,0x8 + 324: 17fd add a5,a5,-1 # 7fff <.LLST157+0x5601> + 326: 22f41263 bne s0,a5,54a <.L11> + +0000032a <.LVL96>: + 32a: cc82 sw zero,88(sp) + 32c: ca82 sw zero,84(sp) + 32e: c882 sw zero,80(sp) + 330: c682 sw zero,76(sp) + +00000332 <.LBB124>: + 332: ac21 j 54a <.L11> + +00000334 <.L33>: + 334: 0005a303 lw t1,0(a1) + 338: 42d2 lw t0,20(sp) + 33a: 0385 add t2,t2,1 + +0000033c <.LVL99>: + 33c: 00d35333 srl t1,t1,a3 + 340: ce1a sw t1,28(sp) + 342: 0045a303 lw t1,4(a1) + 346: 0591 add a1,a1,4 + 348: 00531333 sll t1,t1,t0 + 34c: 42f2 lw t0,28(sp) + 34e: 0062e333 or t1,t0,t1 + 352: 00672023 sw t1,0(a4) + +00000356 <.LVL100>: + 356: 0711 add a4,a4,4 + 358: bdfd j 256 <.L32> + +0000035a <.L50>: + 35a: fff58693 add a3,a1,-1 + +0000035e <.LVL102>: + 35e: ee85 bnez a3,396 <.L51> + +00000360 <.LBB38>: + 360: 4582 lw a1,0(sp) + 362: 009786b3 add a3,a5,s1 + +00000366 <.LVL103>: + 366: c6b6 sw a3,76(sp) + +00000368 <.LVL104>: + 368: 95b2 add a1,a1,a2 + +0000036a <.LVL105>: + 36a: 00f6b6b3 sltu a3,a3,a5 + +0000036e <.LVL106>: + 36e: 4792 lw a5,4(sp) + 370: 96ae add a3,a3,a1 + +00000372 <.LVL107>: + 372: c8b6 sw a3,80(sp) + +00000374 <.LVL108>: + 374: 00c5b633 sltu a2,a1,a2 + +00000378 <.LVL109>: + 378: 00b6b6b3 sltu a3,a3,a1 + +0000037c <.LVL110>: + 37c: 97ba add a5,a5,a4 + +0000037e <.LVL111>: + 37e: 8e55 or a2,a2,a3 + +00000380 <.LVL112>: + 380: 963e add a2,a2,a5 + 382: 00e7b733 sltu a4,a5,a4 + +00000386 <.LVL113>: + 386: cab2 sw a2,84(sp) + +00000388 <.LVL114>: + 388: 00f63633 sltu a2,a2,a5 + +0000038c <.LVL115>: + 38c: 47a2 lw a5,8(sp) + 38e: 8f51 or a4,a4,a2 + +00000390 <.LVL116>: + 390: 953e add a0,a0,a5 + 392: 972a add a4,a4,a0 + 394: bd19 j 1aa <.L354> + +00000396 <.L51>: + 396: 67a1 lui a5,0x8 + 398: 17fd add a5,a5,-1 # 7fff <.LLST157+0x5601> + 39a: 3ef590e3 bne a1,a5,f7a <.L62> + +0000039e <.L63>: + 39e: c6a6 sw s1,76(sp) + +000003a0 <.L364>: + 3a0: 4782 lw a5,0(sp) + 3a2: c8be sw a5,80(sp) + 3a4: 4792 lw a5,4(sp) + 3a6: cabe sw a5,84(sp) + 3a8: 47a2 lw a5,8(sp) + 3aa: ccbe sw a5,88(sp) + +000003ac <.LBB128>: + 3ac: aeb1 j 708 <.L360> + +000003ae <.L270>: + 3ae: 84be mv s1,a5 + 3b0: b7fd j 39e <.L63> + +000003b2 <.L49>: + 3b2: 4752 lw a4,20(sp) + +000003b4 <.LVL122>: + 3b4: 67a1 lui a5,0x8 + 3b6: 17fd add a5,a5,-1 # 7fff <.LLST157+0x5601> + 3b8: fef703e3 beq a4,a5,39e <.L63> + 3bc: 57e2 lw a5,56(sp) + 3be: 00080737 lui a4,0x80 + 3c2: 8fd9 or a5,a5,a4 + 3c4: dc3e sw a5,56(sp) + +000003c6 <.LDL4>: + 3c6: 07400793 li a5,116 + 3ca: 3ab7cce3 blt a5,a1,f82 <.L64> + 3ce: 86ae mv a3,a1 + +000003d0 <.L265>: + 3d0: 41f6d793 sra a5,a3,0x1f + 3d4: 8bfd and a5,a5,31 + 3d6: 97b6 add a5,a5,a3 + 3d8: 8795 sra a5,a5,0x5 + +000003da <.LVL124>: + 3da: 861e mv a2,t2 + 3dc: 4401 li s0,0 + +000003de <.LVL125>: + 3de: 4701 li a4,0 + +000003e0 <.L65>: + 3e0: 02f74663 blt a4,a5,40c <.L66> + 3e4: 460d li a2,3 + 3e6: 01f6f713 and a4,a3,31 + +000003ea <.LVL127>: + 3ea: 40f602b3 sub t0,a2,a5 + 3ee: e705 bnez a4,416 <.L67> + 3f0: 00279613 sll a2,a5,0x2 + +000003f4 <.L68>: + 3f4: 00c386b3 add a3,t2,a2 + 3f8: 4294 lw a3,0(a3) + 3fa: 0705 add a4,a4,1 # 80001 <.LLST157+0x7d603> + +000003fc <.LVL129>: + 3fc: 0391 add t2,t2,4 + 3fe: fed3ae23 sw a3,-4(t2) + +00000402 <.LVL130>: + 402: fee2d9e3 bge t0,a4,3f4 <.L68> + 406: 4511 li a0,4 + 408: 8d1d sub a0,a0,a5 + 40a: a0b5 j 476 <.L74> + +0000040c <.L66>: + 40c: 420c lw a1,0(a2) + 40e: 0705 add a4,a4,1 + +00000410 <.LVL132>: + 410: 0611 add a2,a2,4 + 412: 8c4d or s0,s0,a1 + +00000414 <.LVL133>: + 414: b7f1 j 3e0 <.L65> + +00000416 <.L67>: + 416: 80000637 lui a2,0x80000 + 41a: 067d add a2,a2,31 # 8000001f <.LLST157+0x7fffd621> + 41c: 8ef1 and a3,a3,a2 + +0000041e <.LVL135>: + 41e: 0006d663 bgez a3,42a <.L70> + 422: 16fd add a3,a3,-1 + 424: fe06e693 or a3,a3,-32 + 428: 0685 add a3,a3,1 + +0000042a <.L70>: + 42a: 02000593 li a1,32 + 42e: 8d95 sub a1,a1,a3 + 430: 86be mv a3,a5 + 432: 0007d363 bgez a5,438 <.L71> + +00000436 <.LVL136>: + 436: 4681 li a3,0 + +00000438 <.L71>: + 438: 068a sll a3,a3,0x2 + 43a: 04c68693 add a3,a3,76 + 43e: 1070 add a2,sp,44 + 440: 96b2 add a3,a3,a2 + 442: fb46a683 lw a3,-76(a3) + 446: 4501 li a0,0 + 448: 00b696b3 sll a3,a3,a1 + 44c: 8c55 or s0,s0,a3 + +0000044e <.LVL138>: + 44e: 00279693 sll a3,a5,0x2 + 452: 02c68693 add a3,a3,44 + 456: 968a add a3,a3,sp + +00000458 <.L72>: + 458: 08554463 blt a0,t0,4e0 <.L73> + 45c: 028a sll t0,t0,0x2 + 45e: 4511 li a0,4 + +00000460 <.LVL140>: + 460: 8d1d sub a0,a0,a5 + 462: 1074 add a3,sp,44 + 464: 04c28793 add a5,t0,76 + +00000468 <.LVL142>: + 468: 00d782b3 add t0,a5,a3 + 46c: 57e2 lw a5,56(sp) + 46e: 00e7d7b3 srl a5,a5,a4 + 472: faf2aa23 sw a5,-76(t0) + +00000476 <.L74>: + 476: 4791 li a5,4 + 478: 4601 li a2,0 + 47a: 00a7c563 blt a5,a0,484 <.L76> + 47e: 8f89 sub a5,a5,a0 + 480: 00279613 sll a2,a5,0x2 + +00000484 <.L76>: + 484: 050a sll a0,a0,0x2 + 486: 02c50793 add a5,a0,44 + 48a: 00278533 add a0,a5,sp + 48e: 4581 li a1,0 + 490: 00000097 auipc ra,0x0 + 494: 000080e7 jalr ra # 490 <.L76+0xc> + +00000498 <.LBE40>: + 498: 57b2 lw a5,44(sp) + +0000049a <.LBB41>: + 49a: 00803433 snez s0,s0 + +0000049e <.LBE41>: + 49e: 8c5d or s0,s0,a5 + +000004a0 <.L77>: + 4a0: 57c2 lw a5,48(sp) + 4a2: 4702 lw a4,0(sp) + +000004a4 <.LBB43>: + 4a4: d622 sw s0,44(sp) + +000004a6 <.LBB44>: + 4a6: 9426 add s0,s0,s1 + 4a8: 00e786b3 add a3,a5,a4 + 4ac: 4612 lw a2,4(sp) + 4ae: 5752 lw a4,52(sp) + 4b0: c6a2 sw s0,76(sp) + +000004b2 <.LVL146>: + 4b2: 00943433 sltu s0,s0,s1 + +000004b6 <.LVL147>: + 4b6: 9436 add s0,s0,a3 + +000004b8 <.LVL148>: + 4b8: 00f6b7b3 sltu a5,a3,a5 + +000004bc <.LVL149>: + 4bc: c8a2 sw s0,80(sp) + +000004be <.LVL150>: + 4be: 00d43433 sltu s0,s0,a3 + +000004c2 <.LVL151>: + 4c2: 963a add a2,a2,a4 + +000004c4 <.LVL152>: + 4c4: 8fc1 or a5,a5,s0 + +000004c6 <.LVL153>: + 4c6: 97b2 add a5,a5,a2 + 4c8: cabe sw a5,84(sp) + +000004ca <.LVL154>: + 4ca: 00e63733 sltu a4,a2,a4 + +000004ce <.LVL155>: + 4ce: 00c7b7b3 sltu a5,a5,a2 + +000004d2 <.LVL156>: + 4d2: 8f5d or a4,a4,a5 + +000004d4 <.LVL157>: + 4d4: 46a2 lw a3,8(sp) + +000004d6 <.LVL158>: + 4d6: 57e2 lw a5,56(sp) + +000004d8 <.LBB131>: + 4d8: 4452 lw s0,20(sp) + +000004da <.LBB132>: + 4da: 97b6 add a5,a5,a3 + 4dc: 973e add a4,a4,a5 + +000004de <.LBE45>: + 4de: b501 j 2de <.L23> + +000004e0 <.L73>: + 4e0: 4290 lw a2,0(a3) + 4e2: 0046a303 lw t1,4(a3) + 4e6: 0505 add a0,a0,1 + +000004e8 <.LVL162>: + 4e8: 00e65633 srl a2,a2,a4 + 4ec: 00b31333 sll t1,t1,a1 + 4f0: 00666633 or a2,a2,t1 + 4f4: 00c3a023 sw a2,0(t2) + +000004f8 <.LVL163>: + 4f8: 0691 add a3,a3,4 + 4fa: 0391 add t2,t2,4 + 4fc: bfb1 j 458 <.L72> + +000004fe <.L48>: + 4fe: 6321 lui t1,0x8 + 500: 00140593 add a1,s0,1 + 504: ffe30513 add a0,t1,-2 # 7ffe <.LLST157+0x5600> + 508: 8d6d and a0,a0,a1 + 50a: 5742 lw a4,48(sp) + 50c: 56d2 lw a3,52(sp) + 50e: 5662 lw a2,56(sp) + 510: 18051a63 bnez a0,6a4 <.L88> + 514: 00d765b3 or a1,a4,a3 + 518: 8dd1 or a1,a1,a2 + 51a: 8ddd or a1,a1,a5 + 51c: 14041563 bnez s0,666 <.L89> + +00000520 <.LVL165>: + 520: e991 bnez a1,534 <.L90> + 522: 4782 lw a5,0(sp) + 524: c6a6 sw s1,76(sp) + 526: c8be sw a5,80(sp) + 528: 4792 lw a5,4(sp) + 52a: cabe sw a5,84(sp) + 52c: 47a2 lw a5,8(sp) + 52e: ccbe sw a5,88(sp) + +00000530 <.L357>: + 530: 4401 li s0,0 + 532: a821 j 54a <.L11> + +00000534 <.L90>: + 534: 4512 lw a0,4(sp) + 536: 4582 lw a1,0(sp) + 538: 8dc9 or a1,a1,a0 + 53a: 4522 lw a0,8(sp) + 53c: 8dc9 or a1,a1,a0 + 53e: 8dc5 or a1,a1,s1 + 540: ede1 bnez a1,618 <.L91> + 542: c6be sw a5,76(sp) + 544: c8ba sw a4,80(sp) + 546: cab6 sw a3,84(sp) + 548: ccb2 sw a2,88(sp) + +0000054a <.L11>: + 54a: 47b6 lw a5,76(sp) + 54c: 0077f713 and a4,a5,7 + 550: c71d beqz a4,57e <.L254> + 552: 00f7f713 and a4,a5,15 + 556: 4691 li a3,4 + 558: 02d70363 beq a4,a3,57e <.L254> + +0000055c <.LBB113>: + 55c: 4746 lw a4,80(sp) + 55e: 0791 add a5,a5,4 + 560: c6be sw a5,76(sp) + +00000562 <.LVL169>: + 562: 0047b793 sltiu a5,a5,4 + +00000566 <.LVL170>: + 566: 97ba add a5,a5,a4 + 568: c8be sw a5,80(sp) + +0000056a <.LVL171>: + 56a: 00e7b7b3 sltu a5,a5,a4 + +0000056e <.LVL172>: + 56e: 4756 lw a4,84(sp) + 570: 97ba add a5,a5,a4 + +00000572 <.LVL173>: + 572: cabe sw a5,84(sp) + +00000574 <.LVL174>: + 574: 00e7b7b3 sltu a5,a5,a4 + +00000578 <.LVL175>: + 578: 4766 lw a4,88(sp) + 57a: 97ba add a5,a5,a4 + +0000057c <.LVL176>: + 57c: ccbe sw a5,88(sp) + +0000057e <.L254>: + 57e: 47e6 lw a5,88(sp) + 580: 00080737 lui a4,0x80 + 584: 8f7d and a4,a4,a5 + 586: cb19 beqz a4,59c <.L259> + 588: 6721 lui a4,0x8 + 58a: 0405 add s0,s0,1 + +0000058c <.LVL178>: + 58c: 177d add a4,a4,-1 # 7fff <.LLST157+0x5601> + 58e: 1ce406e3 beq s0,a4,f5a <.L260> + 592: fff80737 lui a4,0xfff80 + 596: 177d add a4,a4,-1 # fff7ffff <.LLST157+0xfff7d601> + 598: 8ff9 and a5,a5,a4 + 59a: ccbe sw a5,88(sp) + +0000059c <.L259>: + 59c: 00fc add a5,sp,76 + 59e: 08b0 add a2,sp,88 + +000005a0 <.L262>: + 5a0: 4398 lw a4,0(a5) + 5a2: 43d4 lw a3,4(a5) + 5a4: 830d srl a4,a4,0x3 + 5a6: 06f6 sll a3,a3,0x1d + 5a8: 8f55 or a4,a4,a3 + 5aa: c398 sw a4,0(a5) + 5ac: 0791 add a5,a5,4 + 5ae: fef619e3 bne a2,a5,5a0 <.L262> + +000005b2 <.LVL181>: + 5b2: 4766 lw a4,88(sp) + +000005b4 <.LBE114>: + 5b4: 66a1 lui a3,0x8 + 5b6: fff68793 add a5,a3,-1 # 7fff <.LLST157+0x5601> + +000005ba <.LBB115>: + 5ba: 830d srl a4,a4,0x3 + 5bc: ccba sw a4,88(sp) + +000005be <.LBE115>: + 5be: 00f41e63 bne s0,a5,5da <.L263> + 5c2: 4646 lw a2,80(sp) + 5c4: 47b6 lw a5,76(sp) + 5c6: 8fd1 or a5,a5,a2 + 5c8: 4656 lw a2,84(sp) + 5ca: 8fd1 or a5,a5,a2 + 5cc: 8fd9 or a5,a5,a4 + 5ce: c791 beqz a5,5da <.L263> + 5d0: ccb6 sw a3,88(sp) + 5d2: ca82 sw zero,84(sp) + 5d4: c882 sw zero,80(sp) + 5d6: c682 sw zero,76(sp) + +000005d8 <.LVL182>: + 5d8: c602 sw zero,12(sp) + +000005da <.L263>: + 5da: 47c2 lw a5,16(sp) + 5dc: 4636 lw a2,76(sp) + 5de: 46c6 lw a3,80(sp) + 5e0: 4756 lw a4,84(sp) + 5e2: 45c2 lw a1,16(sp) + 5e4: c390 sw a2,0(a5) + 5e6: c3d4 sw a3,4(a5) + 5e8: c798 sw a4,8(a5) + 5ea: 47e6 lw a5,88(sp) + 5ec: 0446 sll s0,s0,0x11 + +000005ee <.LVL184>: + 5ee: 8045 srl s0,s0,0x11 + 5f0: 00f59623 sh a5,12(a1) + 5f4: 47b2 lw a5,12(sp) + +000005f6 <.LBE141>: + 5f6: 408a lw ra,128(sp) + 5f8: 54e6 lw s1,120(sp) + +000005fa <.LBB142>: + 5fa: 07be sll a5,a5,0xf + 5fc: 8fc1 or a5,a5,s0 + 5fe: 00f59723 sh a5,14(a1) + 602: 45dc lw a5,12(a1) + +00000604 <.LBE142>: + 604: 45e2 lw a1,24(sp) + 606: 5476 lw s0,124(sp) + 608: c190 sw a2,0(a1) + 60a: c1d4 sw a3,4(a1) + 60c: c598 sw a4,8(a1) + 60e: c5dc sw a5,12(a1) + 610: 852e mv a0,a1 + 612: 08410113 add sp,sp,132 + +00000616 <.LVL186>: + 616: 8082 ret + +00000618 <.L91>: + 618: 4502 lw a0,0(sp) + 61a: 009785b3 add a1,a5,s1 + 61e: c6ae sw a1,76(sp) + +00000620 <.LVL188>: + 620: 953a add a0,a0,a4 + +00000622 <.LVL189>: + 622: 00f5b5b3 sltu a1,a1,a5 + +00000626 <.LVL190>: + 626: 4792 lw a5,4(sp) + 628: 95aa add a1,a1,a0 + +0000062a <.LVL191>: + 62a: c8ae sw a1,80(sp) + +0000062c <.LVL192>: + 62c: 00e53733 sltu a4,a0,a4 + +00000630 <.LVL193>: + 630: 00a5b5b3 sltu a1,a1,a0 + +00000634 <.LVL194>: + 634: 97b6 add a5,a5,a3 + +00000636 <.LVL195>: + 636: 8f4d or a4,a4,a1 + +00000638 <.LVL196>: + 638: 973e add a4,a4,a5 + 63a: 00d7b6b3 sltu a3,a5,a3 + +0000063e <.LVL197>: + 63e: caba sw a4,84(sp) + +00000640 <.LVL198>: + 640: 00f73733 sltu a4,a4,a5 + +00000644 <.LVL199>: + 644: 47a2 lw a5,8(sp) + 646: 8ed9 or a3,a3,a4 + +00000648 <.LVL200>: + 648: 963e add a2,a2,a5 + 64a: 96b2 add a3,a3,a2 + +0000064c <.LBE47>: + 64c: 000807b7 lui a5,0x80 + 650: 8ff5 and a5,a5,a3 + 652: e399 bnez a5,658 <.L102> + +00000654 <.LBB48>: + 654: ccb6 sw a3,88(sp) + 656: bde9 j 530 <.L357> + +00000658 <.L102>: + 658: fff807b7 lui a5,0xfff80 + 65c: 17fd add a5,a5,-1 # fff7ffff <.LLST157+0xfff7d601> + 65e: 8efd and a3,a3,a5 + 660: ccb6 sw a3,88(sp) + +00000662 <.LBB144>: + 662: 4405 li s0,1 + +00000664 <.LVL202>: + 664: b5dd j 54a <.L11> + +00000666 <.L89>: + 666: b40588e3 beqz a1,1b6 <.L268> + 66a: 4512 lw a0,4(sp) + 66c: 4582 lw a1,0(sp) + 66e: 8dc9 or a1,a1,a0 + 670: 4522 lw a0,8(sp) + 672: 8dc9 or a1,a1,a0 + 674: 8dc5 or a1,a1,s1 + 676: b40582e3 beqz a1,1ba <.L269> + +0000067a <.LBB147>: + 67a: cc9a sw t1,88(sp) + 67c: ca82 sw zero,84(sp) + 67e: c882 sw zero,80(sp) + 680: c682 sw zero,76(sp) + +00000682 <.LBB49>: + 682: 00fc add a5,sp,76 + 684: 0090 add a2,sp,64 + +00000686 <.L105>: + 686: 47d8 lw a4,12(a5) + 688: 4794 lw a3,8(a5) + 68a: 17f1 add a5,a5,-4 + 68c: 070e sll a4,a4,0x3 + 68e: 82f5 srl a3,a3,0x1d + 690: 8f55 or a4,a4,a3 + 692: cb98 sw a4,16(a5) + 694: fef619e3 bne a2,a5,686 <.L105> + +00000698 <.L355>: + 698: 47b6 lw a5,76(sp) + +0000069a <.LBE72>: + 69a: 6421 lui s0,0x8 + +0000069c <.LVL208>: + 69c: 147d add s0,s0,-1 # 7fff <.LLST157+0x5601> + +0000069e <.LBB73>: + 69e: 078e sll a5,a5,0x3 + +000006a0 <.LBB149>: + 6a0: c6be sw a5,76(sp) + 6a2: a965 j b5a <.L359> + +000006a4 <.L88>: + 6a4: 4402 lw s0,0(sp) + +000006a6 <.LVL210>: + 6a6: 00978533 add a0,a5,s1 + 6aa: c6aa sw a0,76(sp) + +000006ac <.LVL211>: + 6ac: 00870333 add t1,a4,s0 + +000006b0 <.LVL212>: + 6b0: 00f53533 sltu a0,a0,a5 + +000006b4 <.LVL213>: + 6b4: 4792 lw a5,4(sp) + 6b6: 951a add a0,a0,t1 + +000006b8 <.LVL214>: + 6b8: c8aa sw a0,80(sp) + +000006ba <.LVL215>: + 6ba: 00e33733 sltu a4,t1,a4 + +000006be <.LVL216>: + 6be: 00653533 sltu a0,a0,t1 + +000006c2 <.LVL217>: + 6c2: 97b6 add a5,a5,a3 + +000006c4 <.LVL218>: + 6c4: 8f49 or a4,a4,a0 + +000006c6 <.LVL219>: + 6c6: 973e add a4,a4,a5 + 6c8: 00d7b6b3 sltu a3,a5,a3 + +000006cc <.LVL220>: + 6cc: caba sw a4,84(sp) + +000006ce <.LVL221>: + 6ce: 00f73733 sltu a4,a4,a5 + +000006d2 <.LVL222>: + 6d2: 47a2 lw a5,8(sp) + 6d4: 8ed9 or a3,a3,a4 + +000006d6 <.LVL223>: + 6d6: 963e add a2,a2,a5 + 6d8: 96b2 add a3,a3,a2 + 6da: ccb6 sw a3,88(sp) + +000006dc <.LBB51>: + 6dc: 00fc add a5,sp,76 + +000006de <.LVL225>: + 6de: 08b0 add a2,sp,88 + +000006e0 <.L117>: + 6e0: 4398 lw a4,0(a5) + 6e2: 43d4 lw a3,4(a5) + 6e4: 8305 srl a4,a4,0x1 + 6e6: 06fe sll a3,a3,0x1f + 6e8: 8f55 or a4,a4,a3 + 6ea: c398 sw a4,0(a5) + 6ec: 0791 add a5,a5,4 + 6ee: fef619e3 bne a2,a5,6e0 <.L117> + +000006f2 <.LBE51>: + 6f2: 6721 lui a4,0x8 + 6f4: 177d add a4,a4,-1 # 7fff <.LLST157+0x5601> + +000006f6 <.LBB52>: + 6f6: 47e6 lw a5,88(sp) + +000006f8 <.LBE52>: + 6f8: 00e58463 beq a1,a4,700 <.L118> + +000006fc <.LBB53>: + 6fc: 8385 srl a5,a5,0x1 + 6fe: bc21 j 116 <.L362> + +00000700 <.L118>: + 700: cc82 sw zero,88(sp) + 702: ca82 sw zero,84(sp) + 704: c882 sw zero,80(sp) + 706: c682 sw zero,76(sp) + +00000708 <.L360>: + 708: 6421 lui s0,0x8 + 70a: 147d add s0,s0,-1 # 7fff <.LLST157+0x5601> + 70c: bd3d j 54a <.L11> + +0000070e <.L8>: + 70e: 1ec05f63 blez a2,90c <.L7> + +00000712 <.LBB155>: + 712: 56c2 lw a3,48(sp) + 714: c036 sw a3,0(sp) + 716: 56d2 lw a3,52(sp) + 718: c236 sw a3,4(sp) + 71a: 56e2 lw a3,56(sp) + 71c: c436 sw a3,8(sp) + +0000071e <.LBB156>: + 71e: 46d2 lw a3,20(sp) + 720: e2d1 bnez a3,7a4 <.L123> + 722: 4286 lw t0,64(sp) + 724: 4516 lw a0,68(sp) + 726: 46a6 lw a3,72(sp) + 728: 00a2e5b3 or a1,t0,a0 + +0000072c <.LVL232>: + 72c: 8dd5 or a1,a1,a3 + 72e: 8dc5 or a1,a1,s1 + 730: a20587e3 beqz a1,15e <.L358> + 734: fff60593 add a1,a2,-1 + +00000738 <.LVL233>: + 738: e9b9 bnez a1,78e <.L125> + +0000073a <.LBB75>: + 73a: 4602 lw a2,0(sp) + 73c: 4402 lw s0,0(sp) + +0000073e <.LVL235>: + 73e: 40978733 sub a4,a5,s1 + +00000742 <.LVL236>: + 742: 40560633 sub a2,a2,t0 + 746: 00e7b333 sltu t1,a5,a4 + 74a: 00c43433 sltu s0,s0,a2 + +0000074e <.LVL237>: + 74e: 40660633 sub a2,a2,t1 + +00000752 <.LVL238>: + 752: 4312 lw t1,4(sp) + 754: 84a2 mv s1,s0 + +00000756 <.LVL239>: + 756: 40a303b3 sub t2,t1,a0 + 75a: 00a33333 sltu t1,t1,a0 + 75e: 00e7fc63 bgeu a5,a4,776 <.L130> + 762: 4782 lw a5,0(sp) + 764: 00f29963 bne t0,a5,776 <.L130> + +00000768 <.LVL240>: + 768: fff38793 add a5,t2,-1 + +0000076c <.L131>: + 76c: 4592 lw a1,4(sp) + +0000076e <.LVL242>: + 76e: 8d0d sub a0,a0,a1 + 770: 00153593 seqz a1,a0 + 774: a021 j 77c <.L132> + +00000776 <.L130>: + 776: 409387b3 sub a5,t2,s1 + +0000077a <.LVL244>: + 77a: f86d bnez s0,76c <.L131> + +0000077c <.L132>: + 77c: 4522 lw a0,8(sp) + 77e: 0065e333 or t1,a1,t1 + +00000782 <.LVL246>: + 782: 40d506b3 sub a3,a0,a3 + 786: 406686b3 sub a3,a3,t1 + +0000078a <.L356>: + 78a: 4405 li s0,1 + +0000078c <.LBB158>: + 78c: a295 j 8f0 <.L133> + +0000078e <.L125>: + 78e: a26602e3 beq a2,t1,1b2 <.L365> + 792: 07400693 li a3,116 + 796: 02b6d363 bge a3,a1,7bc <.L266> + +0000079a <.L135>: + 79a: c482 sw zero,72(sp) + 79c: c282 sw zero,68(sp) + 79e: c082 sw zero,64(sp) + 7a0: 4705 li a4,1 + 7a2: a8c9 j 874 <.L146> + +000007a4 <.L123>: + 7a4: c06405e3 beq s0,t1,3ae <.L270> + 7a8: 46a6 lw a3,72(sp) + +000007aa <.LVL251>: + 7aa: 000805b7 lui a1,0x80 + +000007ae <.LVL252>: + 7ae: 8ecd or a3,a3,a1 + 7b0: c4b6 sw a3,72(sp) + +000007b2 <.LDL5>: + 7b2: 07400693 li a3,116 + 7b6: fec6c2e3 blt a3,a2,79a <.L135> + 7ba: 85b2 mv a1,a2 + +000007bc <.L266>: + 7bc: 4055d513 sra a0,a1,0x5 + +000007c0 <.LVL254>: + 7c0: 863a mv a2,a4 + 7c2: 89fd and a1,a1,31 + +000007c4 <.LVL255>: + 7c4: 4481 li s1,0 + 7c6: 4681 li a3,0 + +000007c8 <.L136>: + 7c8: 02a69463 bne a3,a0,7f0 <.L137> + 7cc: 468d li a3,3 + +000007ce <.LVL257>: + 7ce: 8e89 sub a3,a3,a0 + 7d0: 00251613 sll a2,a0,0x2 + 7d4: e58d bnez a1,7fe <.L138> + +000007d6 <.L139>: + 7d6: 00c70333 add t1,a4,a2 + 7da: 00032303 lw t1,0(t1) + 7de: 0585 add a1,a1,1 # 80001 <.LLST157+0x7d603> + +000007e0 <.LVL259>: + 7e0: 00672023 sw t1,0(a4) + +000007e4 <.LVL260>: + 7e4: 0711 add a4,a4,4 + 7e6: feb6d8e3 bge a3,a1,7d6 <.L139> + 7ea: 4711 li a4,4 + 7ec: 8f09 sub a4,a4,a0 + 7ee: a899 j 844 <.L143> + +000007f0 <.L137>: + 7f0: 00062303 lw t1,0(a2) + 7f4: 0685 add a3,a3,1 + +000007f6 <.LVL262>: + 7f6: 0611 add a2,a2,4 + 7f8: 0064e4b3 or s1,s1,t1 + +000007fc <.LVL263>: + 7fc: b7f1 j 7c8 <.L136> + +000007fe <.L138>: + 7fe: 02000293 li t0,32 + 802: 40b28333 sub t1,t0,a1 + 806: ca1a sw t1,20(sp) + +00000808 <.LVL265>: + 808: 02c10293 add t0,sp,44 + 80c: 04c60313 add t1,a2,76 + 810: 9316 add t1,t1,t0 + 812: fc432303 lw t1,-60(t1) + 816: 42d2 lw t0,20(sp) + 818: 4381 li t2,0 + 81a: 00531333 sll t1,t1,t0 + 81e: 0064e4b3 or s1,s1,t1 + +00000822 <.LVL266>: + 822: 03c10313 add t1,sp,60 + 826: 961a add a2,a2,t1 + +00000828 <.L141>: + 828: 08d3c563 blt t2,a3,8b2 <.L142> + 82c: 068a sll a3,a3,0x2 + 82e: 1070 add a2,sp,44 + 830: 04c68693 add a3,a3,76 + 834: 96b2 add a3,a3,a2 + 836: 4626 lw a2,72(sp) + 838: 4711 li a4,4 + 83a: 8f09 sub a4,a4,a0 + +0000083c <.LVL268>: + 83c: 00b65633 srl a2,a2,a1 + 840: fcc6a223 sw a2,-60(a3) + +00000844 <.L143>: + 844: 4691 li a3,4 + 846: 8e99 sub a3,a3,a4 + 848: 1870 add a2,sp,60 + 84a: 070a sll a4,a4,0x2 + 84c: 9732 add a4,a4,a2 + 84e: 068a sll a3,a3,0x2 + 850: 4621 li a2,8 + 852: 00c6e863 bltu a3,a2,862 <.L144> + 856: 00072023 sw zero,0(a4) + +0000085a <.LVL270>: + 85a: 00072223 sw zero,4(a4) + 85e: 16e1 add a3,a3,-8 + 860: 0721 add a4,a4,8 + +00000862 <.L144>: + 862: 4611 li a2,4 + 864: 00c6e463 bltu a3,a2,86c <.L145> + 868: 00072023 sw zero,0(a4) + +0000086c <.L145>: + 86c: 56f2 lw a3,60(sp) + +0000086e <.LBB78>: + 86e: 00903733 snez a4,s1 + +00000872 <.LBE78>: + 872: 8f55 or a4,a4,a3 + +00000874 <.L146>: + 874: 4682 lw a3,0(sp) + +00000876 <.LBB80>: + 876: 4506 lw a0,64(sp) + +00000878 <.LBB81>: + 878: de3a sw a4,60(sp) + +0000087a <.LBB82>: + 87a: 40e78733 sub a4,a5,a4 + +0000087e <.LVL274>: + 87e: 40a68633 sub a2,a3,a0 + 882: 00c6b2b3 sltu t0,a3,a2 + +00000886 <.LVL275>: + 886: 00e7b6b3 sltu a3,a5,a4 + 88a: 4592 lw a1,4(sp) + 88c: 4492 lw s1,4(sp) + 88e: 8e15 sub a2,a2,a3 + +00000890 <.LVL276>: + 890: 4696 lw a3,68(sp) + 892: 8396 mv t2,t0 + +00000894 <.LVL277>: + 894: 8d95 sub a1,a1,a3 + 896: 00d4b333 sltu t1,s1,a3 + 89a: 02e7ff63 bgeu a5,a4,8d8 <.L151> + 89e: 4782 lw a5,0(sp) + 8a0: 02f51c63 bne a0,a5,8d8 <.L151> + +000008a4 <.LVL278>: + 8a4: fff58793 add a5,a1,-1 + +000008a8 <.L152>: + 8a8: 4592 lw a1,4(sp) + 8aa: 8e8d sub a3,a3,a1 + 8ac: 0016b593 seqz a1,a3 + 8b0: a80d j 8e2 <.L153> + +000008b2 <.L142>: + 8b2: 00062303 lw t1,0(a2) + 8b6: 42d2 lw t0,20(sp) + 8b8: 0385 add t2,t2,1 + +000008ba <.LVL281>: + 8ba: 00b35333 srl t1,t1,a1 + 8be: ce1a sw t1,28(sp) + 8c0: 00462303 lw t1,4(a2) + 8c4: 0611 add a2,a2,4 + 8c6: 00531333 sll t1,t1,t0 + 8ca: 42f2 lw t0,28(sp) + 8cc: 0062e333 or t1,t0,t1 + 8d0: 00672023 sw t1,0(a4) + +000008d4 <.LVL282>: + 8d4: 0711 add a4,a4,4 + 8d6: bf89 j 828 <.L141> + +000008d8 <.L151>: + 8d8: 407587b3 sub a5,a1,t2 + +000008dc <.LVL284>: + 8dc: 4581 li a1,0 + 8de: fc0295e3 bnez t0,8a8 <.L152> + +000008e2 <.L153>: + 8e2: 46a6 lw a3,72(sp) + 8e4: 4522 lw a0,8(sp) + 8e6: 0065e5b3 or a1,a1,t1 + +000008ea <.LVL286>: + 8ea: 40d506b3 sub a3,a0,a3 + 8ee: 8e8d sub a3,a3,a1 + +000008f0 <.L133>: + 8f0: cabe sw a5,84(sp) + +000008f2 <.LBE85>: + 8f2: 000807b7 lui a5,0x80 + +000008f6 <.LBB86>: + 8f6: c6ba sw a4,76(sp) + +000008f8 <.LBB87>: + 8f8: ccb6 sw a3,88(sp) + 8fa: c8b2 sw a2,80(sp) + +000008fc <.LBE87>: + 8fc: 00f6f733 and a4,a3,a5 + 900: c40705e3 beqz a4,54a <.L11> + +00000904 <.LBB88>: + 904: 17fd add a5,a5,-1 # 7ffff <.LLST157+0x7d601> + 906: 8efd and a3,a3,a5 + 908: ccb6 sw a3,88(sp) + 90a: a991 j d5e <.L229> + +0000090c <.L7>: + 90c: 4716 lw a4,68(sp) + 90e: 4286 lw t0,64(sp) + 910: c03a sw a4,0(sp) + 912: 4726 lw a4,72(sp) + 914: c43a sw a4,8(sp) + +00000916 <.LBB159>: + 916: 20060163 beqz a2,b18 <.L154> + 91a: 4752 lw a4,20(sp) + 91c: 8f01 sub a4,a4,s0 + +0000091e <.LVL290>: + 91e: e851 bnez s0,9b2 <.L155> + 920: 5442 lw s0,48(sp) + +00000922 <.LVL291>: + 922: 5552 lw a0,52(sp) + 924: 56e2 lw a3,56(sp) + 926: 00a46633 or a2,s0,a0 + 92a: 8e55 or a2,a2,a3 + 92c: 8e5d or a2,a2,a5 + 92e: ea19 bnez a2,944 <.L156> + +00000930 <.LVL292>: + 930: 4782 lw a5,0(sp) + 932: c6a6 sw s1,76(sp) + 934: c896 sw t0,80(sp) + 936: cabe sw a5,84(sp) + 938: 47a2 lw a5,8(sp) + +0000093a <.LBB160>: + 93a: 843a mv s0,a4 + +0000093c <.LBB161>: + 93c: ccbe sw a5,88(sp) + +0000093e <.L208>: + 93e: 4792 lw a5,4(sp) + 940: c63e sw a5,12(sp) + 942: b121 j 54a <.L11> + +00000944 <.L156>: + 944: fff70593 add a1,a4,-1 + +00000948 <.LVL295>: + 948: e9a1 bnez a1,998 <.L157> + +0000094a <.LBB89>: + 94a: 40f48733 sub a4,s1,a5 + +0000094e <.LVL297>: + 94e: 40828633 sub a2,t0,s0 + 952: 00e4b7b3 sltu a5,s1,a4 + 956: 00c2b3b3 sltu t2,t0,a2 + +0000095a <.LVL298>: + 95a: 4302 lw t1,0(sp) + 95c: 8e1d sub a2,a2,a5 + +0000095e <.LVL299>: + 95e: 4782 lw a5,0(sp) + 960: c61e sw t2,12(sp) + +00000962 <.LVL300>: + 962: 00a33333 sltu t1,t1,a0 + 966: 8f89 sub a5,a5,a0 + 968: 00e4fa63 bgeu s1,a4,97c <.L162> + 96c: 00541863 bne s0,t0,97c <.L162> + +00000970 <.LVL301>: + 970: 17fd add a5,a5,-1 + +00000972 <.L163>: + 972: 4582 lw a1,0(sp) + +00000974 <.LVL303>: + 974: 8d0d sub a0,a0,a1 + 976: 00153593 seqz a1,a0 + 97a: a029 j 984 <.L164> + +0000097c <.L162>: + 97c: 4432 lw s0,12(sp) + 97e: 8f81 sub a5,a5,s0 + +00000980 <.LVL305>: + 980: fe0399e3 bnez t2,972 <.L163> + +00000984 <.L164>: + 984: 4522 lw a0,8(sp) + 986: 0065e333 or t1,a1,t1 + +0000098a <.LBE89>: + 98a: 4592 lw a1,4(sp) + +0000098c <.LBB90>: + 98c: 40d506b3 sub a3,a0,a3 + 990: 406686b3 sub a3,a3,t1 + +00000994 <.LBE90>: + 994: c62e sw a1,12(sp) + 996: bbd5 j 78a <.L356> + +00000998 <.L157>: + 998: 67a1 lui a5,0x8 + 99a: 17fd add a5,a5,-1 # 7fff <.LLST157+0x5601> + 99c: 5ef71963 bne a4,a5,f8e <.L165> + +000009a0 <.L166>: + 9a0: 4782 lw a5,0(sp) + 9a2: c6a6 sw s1,76(sp) + 9a4: c896 sw t0,80(sp) + 9a6: cabe sw a5,84(sp) + 9a8: 47a2 lw a5,8(sp) + 9aa: ccbe sw a5,88(sp) + 9ac: 4792 lw a5,4(sp) + 9ae: c63e sw a5,12(sp) + +000009b0 <.LVL310>: + 9b0: bba1 j 708 <.L360> + +000009b2 <.L155>: + 9b2: 46d2 lw a3,20(sp) + 9b4: 67a1 lui a5,0x8 + 9b6: 17fd add a5,a5,-1 # 7fff <.LLST157+0x5601> + 9b8: fef684e3 beq a3,a5,9a0 <.L166> + 9bc: 57e2 lw a5,56(sp) + 9be: 000806b7 lui a3,0x80 + 9c2: 8fd5 or a5,a5,a3 + 9c4: dc3e sw a5,56(sp) + +000009c6 <.LDL6>: + 9c6: 07400793 li a5,116 + 9ca: 5ce7c663 blt a5,a4,f96 <.L167> + 9ce: 85ba mv a1,a4 + +000009d0 <.L267>: + 9d0: 41f5d793 sra a5,a1,0x1f + 9d4: 8bfd and a5,a5,31 + 9d6: 97ae add a5,a5,a1 + 9d8: 8795 sra a5,a5,0x5 + +000009da <.LVL313>: + 9da: 869e mv a3,t2 + 9dc: 4401 li s0,0 + 9de: 4701 li a4,0 + +000009e0 <.L168>: + 9e0: 02f74663 blt a4,a5,a0c <.L169> + 9e4: 468d li a3,3 + 9e6: 01f5f713 and a4,a1,31 + +000009ea <.LVL315>: + 9ea: 40f680b3 sub ra,a3,a5 + 9ee: e705 bnez a4,a16 <.L170> + 9f0: 00279613 sll a2,a5,0x2 + +000009f4 <.L171>: + 9f4: 00c386b3 add a3,t2,a2 + 9f8: 4294 lw a3,0(a3) + 9fa: 0705 add a4,a4,1 + +000009fc <.LVL317>: + 9fc: 0391 add t2,t2,4 + 9fe: fed3ae23 sw a3,-4(t2) + +00000a02 <.LVL318>: + a02: fee0d9e3 bge ra,a4,9f4 <.L171> + a06: 4511 li a0,4 + a08: 8d1d sub a0,a0,a5 + a0a: a0b5 j a76 <.L177> + +00000a0c <.L169>: + a0c: 4290 lw a2,0(a3) + a0e: 0705 add a4,a4,1 + +00000a10 <.LVL319>: + a10: 0691 add a3,a3,4 # 80004 <.LLST157+0x7d606> + a12: 8c51 or s0,s0,a2 + +00000a14 <.LVL320>: + a14: b7f1 j 9e0 <.L168> + +00000a16 <.L170>: + a16: 800006b7 lui a3,0x80000 + a1a: 06fd add a3,a3,31 # 8000001f <.LLST157+0x7fffd621> + a1c: 8eed and a3,a3,a1 + a1e: 0006d663 bgez a3,a2a <.L173> + a22: 16fd add a3,a3,-1 + a24: fe06e693 or a3,a3,-32 + a28: 0685 add a3,a3,1 + +00000a2a <.L173>: + a2a: 02000593 li a1,32 + +00000a2e <.LVL322>: + a2e: 8d95 sub a1,a1,a3 + a30: 86be mv a3,a5 + a32: 0007d363 bgez a5,a38 <.L174> + +00000a36 <.LVL323>: + a36: 4681 li a3,0 + +00000a38 <.L174>: + a38: 068a sll a3,a3,0x2 + a3a: 04c68693 add a3,a3,76 + a3e: 1070 add a2,sp,44 + a40: 96b2 add a3,a3,a2 + a42: fb46a683 lw a3,-76(a3) + a46: 4501 li a0,0 + a48: 00b696b3 sll a3,a3,a1 + a4c: 8c55 or s0,s0,a3 + +00000a4e <.LVL325>: + a4e: 00279693 sll a3,a5,0x2 + a52: 02c68693 add a3,a3,44 + a56: 968a add a3,a3,sp + +00000a58 <.L175>: + a58: 08154263 blt a0,ra,adc <.L176> + a5c: 4511 li a0,4 + +00000a5e <.LVL327>: + a5e: 8d1d sub a0,a0,a5 + +00000a60 <.LVL328>: + a60: 00209793 sll a5,ra,0x2 + +00000a64 <.LVL329>: + a64: 04c78793 add a5,a5,76 + a68: 1074 add a3,sp,44 + a6a: 96be add a3,a3,a5 + a6c: 57e2 lw a5,56(sp) + a6e: 00e7d7b3 srl a5,a5,a4 + a72: faf6aa23 sw a5,-76(a3) + +00000a76 <.L177>: + a76: 4791 li a5,4 + a78: 4601 li a2,0 + a7a: 00a7c563 blt a5,a0,a84 <.L179> + a7e: 8f89 sub a5,a5,a0 + a80: 00279613 sll a2,a5,0x2 + +00000a84 <.L179>: + a84: 050a sll a0,a0,0x2 + a86: 02c50793 add a5,a0,44 + a8a: 00278533 add a0,a5,sp + a8e: 4581 li a1,0 + a90: c616 sw t0,12(sp) + +00000a92 <.LVL331>: + a92: 00000097 auipc ra,0x0 + a96: 000080e7 jalr ra # a92 <.LVL331> + +00000a9a <.LBE92>: + a9a: 57b2 lw a5,44(sp) + +00000a9c <.LBE91>: + a9c: 42b2 lw t0,12(sp) + +00000a9e <.LBB93>: + a9e: 00803733 snez a4,s0 + +00000aa2 <.LBE93>: + aa2: 8f5d or a4,a4,a5 + +00000aa4 <.L180>: + aa4: 55c2 lw a1,48(sp) + +00000aa6 <.LBB97>: + aa6: d63a sw a4,44(sp) + +00000aa8 <.LBB98>: + aa8: 40e48733 sub a4,s1,a4 + +00000aac <.LVL335>: + aac: 40b28633 sub a2,t0,a1 + ab0: 00e4b7b3 sltu a5,s1,a4 + ab4: 56d2 lw a3,52(sp) + ab6: 00c2b333 sltu t1,t0,a2 + +00000aba <.LVL336>: + aba: 4502 lw a0,0(sp) + abc: 8e1d sub a2,a2,a5 + +00000abe <.LVL337>: + abe: 4782 lw a5,0(sp) + ac0: 839a mv t2,t1 + +00000ac2 <.LVL338>: + ac2: 00d53533 sltu a0,a0,a3 + ac6: 8f95 sub a5,a5,a3 + ac8: 02e4f963 bgeu s1,a4,afa <.L185> + acc: 02559763 bne a1,t0,afa <.L185> + +00000ad0 <.LVL339>: + ad0: 17fd add a5,a5,-1 + +00000ad2 <.L186>: + ad2: 4582 lw a1,0(sp) + ad4: 8e8d sub a3,a3,a1 + ad6: 0016b593 seqz a1,a3 + ada: a02d j b04 <.L187> + +00000adc <.L176>: + adc: 4290 lw a2,0(a3) + ade: 0046a303 lw t1,4(a3) + ae2: 0505 add a0,a0,1 + +00000ae4 <.LVL342>: + ae4: 00e65633 srl a2,a2,a4 + ae8: 00b31333 sll t1,t1,a1 + aec: 00666633 or a2,a2,t1 + af0: 00c3a023 sw a2,0(t2) + +00000af4 <.LVL343>: + af4: 0691 add a3,a3,4 + af6: 0391 add t2,t2,4 + af8: b785 j a58 <.L175> + +00000afa <.L185>: + afa: 407787b3 sub a5,a5,t2 + +00000afe <.LVL345>: + afe: 4581 li a1,0 + b00: fc0319e3 bnez t1,ad2 <.L186> + +00000b04 <.L187>: + b04: 4422 lw s0,8(sp) + b06: 56e2 lw a3,56(sp) + b08: 8dc9 or a1,a1,a0 + +00000b0a <.LVL347>: + b0a: 40d406b3 sub a3,s0,a3 + b0e: 8e8d sub a3,a3,a1 + +00000b10 <.LBE100>: + b10: 4592 lw a1,4(sp) + +00000b12 <.LBB164>: + b12: 4452 lw s0,20(sp) + +00000b14 <.LBB165>: + b14: c62e sw a1,12(sp) + b16: bbe9 j 8f0 <.L133> + +00000b18 <.L154>: + b18: 6621 lui a2,0x8 + b1a: 00140593 add a1,s0,1 + b1e: ffe60513 add a0,a2,-2 # 7ffe <.LLST157+0x5600> + b22: 8de9 and a1,a1,a0 + +00000b24 <.LBB166>: + b24: 56c2 lw a3,48(sp) + b26: 5752 lw a4,52(sp) + b28: 53e2 lw t2,56(sp) + +00000b2a <.LBB167>: + b2a: 16059963 bnez a1,c9c <.L188> + b2e: 4582 lw a1,0(sp) + b30: 4522 lw a0,8(sp) + b32: 00b2e5b3 or a1,t0,a1 + b36: 8dc9 or a1,a1,a0 + b38: 00e6e533 or a0,a3,a4 + b3c: 00756533 or a0,a0,t2 + b40: 8dc5 or a1,a1,s1 + b42: 8d5d or a0,a0,a5 + b44: e86d bnez s0,c36 <.L189> + +00000b46 <.LVL350>: + b46: ed01 bnez a0,b5e <.L190> + b48: 4782 lw a5,0(sp) + b4a: c6a6 sw s1,76(sp) + b4c: c896 sw t0,80(sp) + b4e: cabe sw a5,84(sp) + b50: 47a2 lw a5,8(sp) + b52: ccbe sw a5,88(sp) + b54: de0595e3 bnez a1,93e <.L208> + +00000b58 <.L191>: + b58: 4401 li s0,0 + +00000b5a <.L359>: + b5a: c602 sw zero,12(sp) + +00000b5c <.LVL353>: + b5c: b2fd j 54a <.L11> + +00000b5e <.L190>: + b5e: e591 bnez a1,b6a <.L192> + b60: c6be sw a5,76(sp) + b62: c8b6 sw a3,80(sp) + b64: caba sw a4,84(sp) + b66: cc9e sw t2,88(sp) + +00000b68 <.LBB170>: + b68: b2e1 j 530 <.L357> + +00000b6a <.L192>: + b6a: 40978633 sub a2,a5,s1 + +00000b6e <.LVL357>: + b6e: 40568533 sub a0,a3,t0 + b72: 00c7b333 sltu t1,a5,a2 + b76: 00a6b5b3 sltu a1,a3,a0 + b7a: 40650533 sub a0,a0,t1 + b7e: ca2a sw a0,20(sp) + +00000b80 <.LVL358>: + b80: 4502 lw a0,0(sp) + b82: d02e sw a1,32(sp) + +00000b84 <.LVL359>: + b84: 40a70333 sub t1,a4,a0 + b88: 00a73533 sltu a0,a4,a0 + b8c: d22a sw a0,36(sp) + b8e: 00c7fa63 bgeu a5,a2,ba2 <.L197> + b92: 00569863 bne a3,t0,ba2 <.L197> + +00000b96 <.LVL360>: + b96: fff30593 add a1,t1,-1 + +00000b9a <.L198>: + b9a: 00133513 seqz a0,t1 + b9e: ce2a sw a0,28(sp) + ba0: a031 j bac <.L199> + +00000ba2 <.L197>: + ba2: 5502 lw a0,32(sp) + ba4: ce02 sw zero,28(sp) + ba6: 40b305b3 sub a1,t1,a1 + +00000baa <.LVL363>: + baa: f965 bnez a0,b9a <.L198> + +00000bac <.L199>: + bac: 4522 lw a0,8(sp) + bae: 4372 lw t1,28(sp) + bb0: caae sw a1,84(sp) + bb2: 40a38533 sub a0,t2,a0 + bb6: d02a sw a0,32(sp) + bb8: 5512 lw a0,36(sp) + bba: c6b2 sw a2,76(sp) + bbc: 00a36533 or a0,t1,a0 + +00000bc0 <.LVL365>: + bc0: 5302 lw t1,32(sp) + bc2: 40a30333 sub t1,t1,a0 + bc6: 4552 lw a0,20(sp) + +00000bc8 <.LVL366>: + bc8: cc9a sw t1,88(sp) + bca: c8aa sw a0,80(sp) + +00000bcc <.LBE101>: + bcc: 00080537 lui a0,0x80 + bd0: 00a37533 and a0,t1,a0 + bd4: c931 beqz a0,c28 <.L200> + +00000bd6 <.LBB102>: + bd6: 40f487b3 sub a5,s1,a5 + +00000bda <.LVL368>: + bda: 40d28633 sub a2,t0,a3 + +00000bde <.LVL369>: + bde: 00f4b5b3 sltu a1,s1,a5 + +00000be2 <.LVL370>: + be2: 00c2b333 sltu t1,t0,a2 + +00000be6 <.LVL371>: + be6: 4502 lw a0,0(sp) + be8: 8e0d sub a2,a2,a1 + +00000bea <.LVL372>: + bea: 4582 lw a1,0(sp) + bec: c61a sw t1,12(sp) + +00000bee <.LVL373>: + bee: 00e53533 sltu a0,a0,a4 + bf2: 8d99 sub a1,a1,a4 + bf4: 00f4fb63 bgeu s1,a5,c0a <.L205> + bf8: 00569963 bne a3,t0,c0a <.L205> + +00000bfc <.LVL374>: + bfc: 15fd add a1,a1,-1 + +00000bfe <.L206>: + bfe: 4682 lw a3,0(sp) + c00: 40d706b3 sub a3,a4,a3 + c04: 0016b693 seqz a3,a3 + c08: a031 j c14 <.L207> + +00000c0a <.L205>: + c0a: 46b2 lw a3,12(sp) + c0c: 8d95 sub a1,a1,a3 + +00000c0e <.LVL377>: + c0e: 4681 li a3,0 + c10: fe0317e3 bnez t1,bfe <.L206> + +00000c14 <.L207>: + c14: 4722 lw a4,8(sp) + c16: 8ec9 or a3,a3,a0 + +00000c18 <.LVL379>: + c18: caae sw a1,84(sp) + +00000c1a <.LVL380>: + c1a: 40770733 sub a4,a4,t2 + c1e: 8f15 sub a4,a4,a3 + c20: ccba sw a4,88(sp) + c22: c8b2 sw a2,80(sp) + c24: c6be sw a5,76(sp) + +00000c26 <.LBB172>: + c26: bb21 j 93e <.L208> + +00000c28 <.L200>: + c28: 47d2 lw a5,20(sp) + c2a: 8e5d or a2,a2,a5 + +00000c2c <.LVL383>: + c2c: 8e4d or a2,a2,a1 + c2e: 00666633 or a2,a2,t1 + c32: d21d beqz a2,b58 <.L191> + c34: b8f5 j 530 <.L357> + +00000c36 <.L189>: + c36: ed0d bnez a0,c70 <.L209> + c38: e18d bnez a1,c5a <.L210> + +00000c3a <.LVL385>: + c3a: ccb2 sw a2,88(sp) + c3c: ca82 sw zero,84(sp) + c3e: c882 sw zero,80(sp) + c40: c682 sw zero,76(sp) + +00000c42 <.LBB103>: + c42: 00fc add a5,sp,76 + c44: 0090 add a2,sp,64 + +00000c46 <.L211>: + c46: 47d8 lw a4,12(a5) + c48: 4794 lw a3,8(a5) + c4a: 17f1 add a5,a5,-4 + c4c: 070e sll a4,a4,0x3 + c4e: 82f5 srl a3,a3,0x1d + c50: 8f55 or a4,a4,a3 + c52: cb98 sw a4,16(a5) + c54: fef619e3 bne a2,a5,c46 <.L211> + c58: b481 j 698 <.L355> + +00000c5a <.L210>: + c5a: 4782 lw a5,0(sp) + c5c: c6a6 sw s1,76(sp) + c5e: c896 sw t0,80(sp) + c60: cabe sw a5,84(sp) + c62: 47a2 lw a5,8(sp) + c64: ccbe sw a5,88(sp) + +00000c66 <.LBB174>: + c66: 4792 lw a5,4(sp) + c68: c63e sw a5,12(sp) + +00000c6a <.L361>: + c6a: fff60413 add s0,a2,-1 + +00000c6e <.LVL390>: + c6e: b8f1 j 54a <.L11> + +00000c70 <.L209>: + c70: e591 bnez a1,c7c <.L212> + +00000c72 <.LVL392>: + c72: c6be sw a5,76(sp) + c74: c8b6 sw a3,80(sp) + c76: caba sw a4,84(sp) + c78: cc9e sw t2,88(sp) + c7a: bfc5 j c6a <.L361> + +00000c7c <.L212>: + c7c: ccb2 sw a2,88(sp) + c7e: ca82 sw zero,84(sp) + c80: c882 sw zero,80(sp) + c82: c682 sw zero,76(sp) + +00000c84 <.LBB104>: + c84: 00fc add a5,sp,76 + c86: 0090 add a2,sp,64 + +00000c88 <.L213>: + c88: 47d8 lw a4,12(a5) + c8a: 4794 lw a3,8(a5) + c8c: 17f1 add a5,a5,-4 + c8e: 070e sll a4,a4,0x3 + c90: 82f5 srl a3,a3,0x1d + c92: 8f55 or a4,a4,a3 + c94: cb98 sw a4,16(a5) + c96: fef619e3 bne a2,a5,c88 <.L213> + c9a: bafd j 698 <.L355> + +00000c9c <.L188>: + c9c: 40978633 sub a2,a5,s1 + +00000ca0 <.LVL397>: + ca0: 40568533 sub a0,a3,t0 + ca4: 00c7b333 sltu t1,a5,a2 + ca8: 00a6b5b3 sltu a1,a3,a0 + cac: 40650533 sub a0,a0,t1 + cb0: ca2a sw a0,20(sp) + +00000cb2 <.LVL398>: + cb2: 4502 lw a0,0(sp) + cb4: d22e sw a1,36(sp) + +00000cb6 <.LVL399>: + cb6: 40a70333 sub t1,a4,a0 + cba: 00a73533 sltu a0,a4,a0 + cbe: d42a sw a0,40(sp) + cc0: 00c7fa63 bgeu a5,a2,cd4 <.L218> + cc4: 00569863 bne a3,t0,cd4 <.L218> + +00000cc8 <.LVL400>: + cc8: fff30593 add a1,t1,-1 + +00000ccc <.L219>: + ccc: 00133513 seqz a0,t1 + cd0: d02a sw a0,32(sp) + cd2: a031 j cde <.L220> + +00000cd4 <.L218>: + cd4: 5512 lw a0,36(sp) + cd6: d002 sw zero,32(sp) + cd8: 40b305b3 sub a1,t1,a1 + +00000cdc <.LVL403>: + cdc: f965 bnez a0,ccc <.L219> + +00000cde <.L220>: + cde: 4522 lw a0,8(sp) + ce0: 5302 lw t1,32(sp) + ce2: caae sw a1,84(sp) + ce4: 40a38533 sub a0,t2,a0 + ce8: d22a sw a0,36(sp) + cea: 5522 lw a0,40(sp) + cec: c6b2 sw a2,76(sp) + cee: 00a36533 or a0,t1,a0 + +00000cf2 <.LVL405>: + cf2: 5312 lw t1,36(sp) + cf4: 40a30333 sub t1,t1,a0 + cf8: 4552 lw a0,20(sp) + +00000cfa <.LVL406>: + cfa: cc9a sw t1,88(sp) + cfc: c8aa sw a0,80(sp) + +00000cfe <.LBE105>: + cfe: 00080537 lui a0,0x80 + d02: 00a37533 and a0,t1,a0 + d06: 12050463 beqz a0,e2e <.L221> + +00000d0a <.LBB106>: + d0a: 40f487b3 sub a5,s1,a5 + +00000d0e <.LVL408>: + d0e: 40d28633 sub a2,t0,a3 + +00000d12 <.LVL409>: + d12: 00f4b5b3 sltu a1,s1,a5 + +00000d16 <.LVL410>: + d16: 00c2b333 sltu t1,t0,a2 + +00000d1a <.LVL411>: + d1a: 4502 lw a0,0(sp) + d1c: 8e0d sub a2,a2,a1 + +00000d1e <.LVL412>: + d1e: 4582 lw a1,0(sp) + d20: 809a mv ra,t1 + +00000d22 <.LVL413>: + d22: 00e53533 sltu a0,a0,a4 + d26: 8d99 sub a1,a1,a4 + d28: 00f4fb63 bgeu s1,a5,d3e <.L226> + d2c: 00569963 bne a3,t0,d3e <.L226> + +00000d30 <.LVL414>: + d30: 15fd add a1,a1,-1 + +00000d32 <.L227>: + d32: 4682 lw a3,0(sp) + d34: 8f15 sub a4,a4,a3 + d36: 00173713 seqz a4,a4 + d3a: ce3a sw a4,28(sp) + d3c: a029 j d46 <.L228> + +00000d3e <.L226>: + d3e: 401585b3 sub a1,a1,ra + +00000d42 <.LVL417>: + d42: fe0318e3 bnez t1,d32 <.L227> + +00000d46 <.L228>: + d46: 4722 lw a4,8(sp) + d48: 46f2 lw a3,28(sp) + d4a: c6be sw a5,76(sp) + +00000d4c <.LBE106>: + d4c: 4792 lw a5,4(sp) + +00000d4e <.LBB107>: + d4e: 40770733 sub a4,a4,t2 + d52: 8ec9 or a3,a3,a0 + +00000d54 <.LVL421>: + d54: 8f15 sub a4,a4,a3 + d56: ccba sw a4,88(sp) + d58: caae sw a1,84(sp) + +00000d5a <.LVL422>: + d5a: c8b2 sw a2,80(sp) + +00000d5c <.LBE107>: + d5c: c63e sw a5,12(sp) + +00000d5e <.L229>: + d5e: 4566 lw a0,88(sp) + d60: cd79 beqz a0,e3e <.L230> + d62: 00000097 auipc ra,0x0 + d66: 000080e7 jalr ra # d62 <.L229+0x4> + +00000d6a <.L231>: + d6a: 1551 add a0,a0,-12 # 7fff4 <.LLST157+0x7d5f6> + +00000d6c <.LBB66>: + d6c: 41f55793 sra a5,a0,0x1f + d70: 8bfd and a5,a5,31 + d72: 97aa add a5,a5,a0 + d74: 8795 sra a5,a5,0x5 + +00000d76 <.LVL427>: + d76: 01f57593 and a1,a0,31 + d7a: 40f00733 neg a4,a5 + d7e: c9f5 beqz a1,e72 <.L234> + d80: 800006b7 lui a3,0x80000 + d84: 06fd add a3,a3,31 # 8000001f <.LLST157+0x7fffd621> + d86: 8ee9 and a3,a3,a0 + d88: 0006d663 bgez a3,d94 <.L235> + d8c: 16fd add a3,a3,-1 + d8e: fe06e693 or a3,a3,-32 + d92: 0685 add a3,a3,1 + +00000d94 <.L235>: + d94: 070a sll a4,a4,0x2 + d96: 02000313 li t1,32 + d9a: 40d30333 sub t1,t1,a3 + d9e: 04c10393 add t2,sp,76 + da2: 00c70693 add a3,a4,12 + da6: 969e add a3,a3,t2 + da8: 40e00733 neg a4,a4 + +00000dac <.L236>: + dac: 0ed39163 bne t2,a3,e8e <.L239> + db0: fff78713 add a4,a5,-1 + +00000db4 <.LVL428>: + db4: 078a sll a5,a5,0x2 + +00000db6 <.LVL429>: + db6: 1074 add a3,sp,44 + db8: 04c78793 add a5,a5,76 + dbc: 97b6 add a5,a5,a3 + dbe: 46b6 lw a3,76(sp) + dc0: 00b696b3 sll a3,a3,a1 + dc4: fcd7aa23 sw a3,-44(a5) + +00000dc8 <.L240>: + dc8: 0705 add a4,a4,1 + dca: 00f4 add a3,sp,76 + dcc: 070a sll a4,a4,0x2 + dce: 4621 li a2,8 + dd0: 87b6 mv a5,a3 + dd2: 00c76863 bltu a4,a2,de2 <.L241> + dd6: 0006a023 sw zero,0(a3) + dda: 0006a223 sw zero,4(a3) + dde: 1761 add a4,a4,-8 + de0: 08d4 add a3,sp,84 + +00000de2 <.L241>: + de2: 4611 li a2,4 + de4: 00c76463 bltu a4,a2,dec <.L242> + de8: 0006a023 sw zero,0(a3) + +00000dec <.L242>: + dec: 14854f63 blt a0,s0,f4a <.L243> + df0: 8d01 sub a0,a0,s0 + +00000df2 <.LVL431>: + df2: 0505 add a0,a0,1 + +00000df4 <.LBB62>: + df4: 40555313 sra t1,a0,0x5 + +00000df8 <.LVL433>: + df8: 85be mv a1,a5 + dfa: 897d and a0,a0,31 + +00000dfc <.LVL434>: + dfc: 86be mv a3,a5 + dfe: 4601 li a2,0 + e00: 4701 li a4,0 + +00000e02 <.L244>: + e02: 0a671463 bne a4,t1,eaa <.L245> + e06: 470d li a4,3 + +00000e08 <.LVL436>: + e08: 40670733 sub a4,a4,t1 + e0c: 00231693 sll a3,t1,0x2 + e10: e545 bnez a0,eb8 <.L246> + +00000e12 <.L247>: + e12: 00d582b3 add t0,a1,a3 + e16: 0002a283 lw t0,0(t0) + e1a: 0505 add a0,a0,1 + +00000e1c <.LVL438>: + e1c: 0055a023 sw t0,0(a1) + +00000e20 <.LVL439>: + e20: 0591 add a1,a1,4 + e22: fea758e3 bge a4,a0,e12 <.L247> + e26: 4691 li a3,4 + e28: 406686b3 sub a3,a3,t1 + e2c: a0f1 j ef8 <.L251> + +00000e2e <.L221>: + e2e: 47d2 lw a5,20(sp) + e30: 8e5d or a2,a2,a5 + +00000e32 <.LVL441>: + e32: 8e4d or a2,a2,a1 + e34: 00666633 or a2,a2,t1 + e38: d20600e3 beqz a2,b58 <.L191> + e3c: b70d j d5e <.L229> + +00000e3e <.L230>: + e3e: 4556 lw a0,84(sp) + e40: c901 beqz a0,e50 <.L232> + e42: 00000097 auipc ra,0x0 + e46: 000080e7 jalr ra # e42 <.L230+0x4> + +00000e4a <.LVL443>: + e4a: 02050513 add a0,a0,32 + e4e: bf31 j d6a <.L231> + +00000e50 <.L232>: + e50: 4546 lw a0,80(sp) + e52: c901 beqz a0,e62 <.L233> + e54: 00000097 auipc ra,0x0 + e58: 000080e7 jalr ra # e54 <.L232+0x4> + +00000e5c <.LVL446>: + e5c: 04050513 add a0,a0,64 + e60: b729 j d6a <.L231> + +00000e62 <.L233>: + e62: 4536 lw a0,76(sp) + e64: 00000097 auipc ra,0x0 + e68: 000080e7 jalr ra # e64 <.L233+0x2> + +00000e6c <.LVL449>: + e6c: 06050513 add a0,a0,96 + e70: bded j d6a <.L231> + +00000e72 <.L234>: + e72: 08b4 add a3,sp,88 + e74: 070a sll a4,a4,0x2 + +00000e76 <.LBB68>: + e76: 460d li a2,3 + +00000e78 <.L237>: + e78: 00e685b3 add a1,a3,a4 + e7c: 418c lw a1,0(a1) + e7e: 167d add a2,a2,-1 + +00000e80 <.LVL453>: + e80: 16f1 add a3,a3,-4 + e82: c2cc sw a1,4(a3) + +00000e84 <.LVL454>: + e84: fef65ae3 bge a2,a5,e78 <.L237> + e88: fff78713 add a4,a5,-1 + e8c: bf35 j dc8 <.L240> + +00000e8e <.L239>: + e8e: 4290 lw a2,0(a3) + e90: ffc6a283 lw t0,-4(a3) + e94: 00e684b3 add s1,a3,a4 + e98: 00b61633 sll a2,a2,a1 + e9c: 0062d2b3 srl t0,t0,t1 + ea0: 00566633 or a2,a2,t0 + ea4: c090 sw a2,0(s1) + ea6: 16f1 add a3,a3,-4 + ea8: b711 j dac <.L236> + +00000eaa <.L245>: + eaa: 0006a283 lw t0,0(a3) + eae: 0705 add a4,a4,1 + +00000eb0 <.LVL457>: + eb0: 0691 add a3,a3,4 + eb2: 00566633 or a2,a2,t0 + +00000eb6 <.LVL458>: + eb6: b7b1 j e02 <.L244> + +00000eb8 <.L246>: + eb8: 04c68413 add s0,a3,76 + +00000ebc <.LVL460>: + ebc: 1064 add s1,sp,44 + ebe: 009402b3 add t0,s0,s1 + ec2: fd42a283 lw t0,-44(t0) + ec6: 02000393 li t2,32 + eca: 40a383b3 sub t2,t2,a0 + ece: 007292b3 sll t0,t0,t2 + ed2: 00566633 or a2,a2,t0 + +00000ed6 <.LVL461>: + ed6: 96be add a3,a3,a5 + ed8: 4401 li s0,0 + +00000eda <.L249>: + eda: 04e44963 blt s0,a4,f2c <.L250> + ede: 070a sll a4,a4,0x2 + ee0: 106c add a1,sp,44 + ee2: 04c70713 add a4,a4,76 + ee6: 972e add a4,a4,a1 + ee8: 45e6 lw a1,88(sp) + eea: 4691 li a3,4 + eec: 406686b3 sub a3,a3,t1 + +00000ef0 <.LVL463>: + ef0: 00a5d5b3 srl a1,a1,a0 + ef4: fcb72a23 sw a1,-44(a4) + +00000ef8 <.L251>: + ef8: 4711 li a4,4 + efa: 8f15 sub a4,a4,a3 + efc: 068a sll a3,a3,0x2 + efe: 97b6 add a5,a5,a3 + f00: 070a sll a4,a4,0x2 + f02: 46a1 li a3,8 + f04: 00d76863 bltu a4,a3,f14 <.L252> + f08: 0007a023 sw zero,0(a5) + f0c: 0007a223 sw zero,4(a5) + f10: 1761 add a4,a4,-8 + f12: 07a1 add a5,a5,8 + +00000f14 <.L252>: + f14: 4691 li a3,4 + f16: 00d76463 bltu a4,a3,f1e <.L253> + f1a: 0007a023 sw zero,0(a5) + +00000f1e <.L253>: + f1e: 47b6 lw a5,76(sp) + +00000f20 <.LBB64>: + f20: 00c03633 snez a2,a2 + +00000f24 <.LBE64>: + f24: 8fd1 or a5,a5,a2 + f26: c6be sw a5,76(sp) + f28: e08ff06f j 530 <.L357> + +00000f2c <.L250>: + f2c: 0006a283 lw t0,0(a3) + f30: 42c4 lw s1,4(a3) + f32: 0405 add s0,s0,1 + +00000f34 <.LVL468>: + f34: 00a2d2b3 srl t0,t0,a0 + f38: 007494b3 sll s1,s1,t2 + f3c: 0092e2b3 or t0,t0,s1 + f40: 0055a023 sw t0,0(a1) + +00000f44 <.LVL469>: + f44: 0691 add a3,a3,4 + f46: 0591 add a1,a1,4 + f48: bf49 j eda <.L249> + +00000f4a <.L243>: + f4a: 47e6 lw a5,88(sp) + f4c: fff80737 lui a4,0xfff80 + f50: 177d add a4,a4,-1 # fff7ffff <.LLST157+0xfff7d601> + f52: 8c09 sub s0,s0,a0 + f54: 8ff9 and a5,a5,a4 + f56: a7cff06f j 1d2 <.L363> + +00000f5a <.L260>: + f5a: cc82 sw zero,88(sp) + f5c: ca82 sw zero,84(sp) + f5e: c882 sw zero,80(sp) + f60: c682 sw zero,76(sp) + f62: e3aff06f j 59c <.L259> + +00000f66 <.L24>: + f66: 07400613 li a2,116 + f6a: a8d65063 bge a2,a3,1ea <.L264> + +00000f6e <.L26>: + f6e: c482 sw zero,72(sp) + f70: c282 sw zero,68(sp) + f72: c082 sw zero,64(sp) + f74: 4705 li a4,1 + f76: b2cff06f j 2a2 <.L37> + +00000f7a <.L62>: + f7a: 07400793 li a5,116 + f7e: c4d7d963 bge a5,a3,3d0 <.L265> + +00000f82 <.L64>: + f82: dc02 sw zero,56(sp) + f84: da02 sw zero,52(sp) + f86: d802 sw zero,48(sp) + f88: 4405 li s0,1 + +00000f8a <.LVL477>: + f8a: d16ff06f j 4a0 <.L77> + +00000f8e <.L165>: + f8e: 07400793 li a5,116 + f92: a2b7dfe3 bge a5,a1,9d0 <.L267> + +00000f96 <.L167>: + f96: dc02 sw zero,56(sp) + f98: da02 sw zero,52(sp) + f9a: d802 sw zero,48(sp) + f9c: 4705 li a4,1 + f9e: b619 j aa4 <.L180> + +unordtf2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__unordtf2>: + 0: fdc10113 add sp,sp,-36 + 4: d022 sw s0,32(sp) + 6: 4118 lw a4,0(a0) + 8: 4140 lw s0,4(a0) + a: 00852383 lw t2,8(a0) + e: 4548 lw a0,12(a0) + 10: 45d4 lw a3,12(a1) + 12: 419c lw a5,0(a1) + 14: 0045a283 lw t0,4(a1) + 18: 0085a303 lw t1,8(a1) + +0000001c <.LBB2>: + 1c: 6621 lui a2,0x8 + +0000001e <.LBE2>: + 1e: 00f10593 add a1,sp,15 + 22: ce26 sw s1,28(sp) + 24: 99c1 and a1,a1,-16 + +00000026 <.LBB3>: + 26: 167d add a2,a2,-1 # 7fff <.LASF19+0x7e4a> + 28: 01055493 srl s1,a0,0x10 + +0000002c <.LBB4>: + 2c: c19c sw a5,0(a1) + 2e: 0055a223 sw t0,4(a1) + 32: 0065a423 sw t1,8(a1) + 36: c5d4 sw a3,12(a1) + +00000038 <.LBB5>: + 38: 8cf1 and s1,s1,a2 + +0000003a <.LBB6>: + 3a: 0106d593 srl a1,a3,0x10 + 3e: 8df1 and a1,a1,a2 + +00000040 <.LBE6>: + 40: 00c49a63 bne s1,a2,54 <.L2> + 44: 8f41 or a4,a4,s0 + +00000046 <.LBB7>: + 46: 0542 sll a0,a0,0x10 + 48: 8141 srl a0,a0,0x10 + +0000004a <.LBE7>: + 4a: 00776733 or a4,a4,t2 + 4e: 8f49 or a4,a4,a0 + 50: 4505 li a0,1 + 52: ef19 bnez a4,70 <.L1> + +00000054 <.L2>: + 54: 6721 lui a4,0x8 + 56: 177d add a4,a4,-1 # 7fff <.LASF19+0x7e4a> + 58: 4501 li a0,0 + 5a: 00e59b63 bne a1,a4,70 <.L1> + 5e: 0057e533 or a0,a5,t0 + +00000062 <.LBB8>: + 62: 06c2 sll a3,a3,0x10 + +00000064 <.LBE8>: + 64: 00656533 or a0,a0,t1 + +00000068 <.LBB9>: + 68: 82c1 srl a3,a3,0x10 + +0000006a <.LBE9>: + 6a: 8d55 or a0,a0,a3 + 6c: 00a03533 snez a0,a0 + +00000070 <.L1>: + 70: 5402 lw s0,32(sp) + 72: 44f2 lw s1,28(sp) + +00000074 <.LVL6>: + 74: 02410113 add sp,sp,36 + +00000078 <.LVL7>: + 78: 8082 ret + +fixtfsi.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__fixtfsi>: + 0: 4114 lw a3,0(a0) + 2: 4150 lw a2,4(a0) + 4: 450c lw a1,8(a0) + 6: fd410113 add sp,sp,-44 + a: 4558 lw a4,12(a0) + c: 01f10793 add a5,sp,31 + 10: 9bc1 and a5,a5,-16 + +00000012 <.LBB3>: + 12: c3d0 sw a2,4(a5) + 14: c394 sw a3,0(a5) + 16: c78c sw a1,8(a5) + 18: c7d8 sw a4,12(a5) + 1a: 00171513 sll a0,a4,0x1 + +0000001e <.LBE3>: + 1e: 6791 lui a5,0x4 + +00000020 <.LBB4>: + 20: c036 sw a3,0(sp) + 22: c42e sw a1,8(sp) + 24: 8145 srl a0,a0,0x11 + +00000026 <.LBE4>: + 26: ffe78613 add a2,a5,-2 # 3ffe <.LLST11+0x3da5> + 2a: 08a65163 bge a2,a0,ac <.L8> + 2e: 01d78613 add a2,a5,29 + 32: 01f75693 srl a3,a4,0x1f + 36: 00a65a63 bge a2,a0,4a <.L3> + +0000003a <.LVL2>: + 3a: 80000537 lui a0,0x80000 + +0000003e <.LVL3>: + 3e: fff54513 not a0,a0 + 42: 9536 add a0,a0,a3 + +00000044 <.L2>: + 44: 02c10113 add sp,sp,44 + +00000048 <.LVL5>: + 48: 8082 ret + +0000004a <.L3>: + 4a: 0742 sll a4,a4,0x10 + +0000004c <.LVL7>: + 4c: 8341 srl a4,a4,0x10 + +0000004e <.LBB11>: + 4e: 6641 lui a2,0x10 + +00000050 <.LBB6>: + 50: 06f78793 add a5,a5,111 + 54: 8f89 sub a5,a5,a0 + +00000056 <.LBE6>: + 56: 8e59 or a2,a2,a4 + +00000058 <.LBB7>: + 58: 02000513 li a0,32 + +0000005c <.LVL8>: + 5c: 4057d713 sra a4,a5,0x5 + +00000060 <.LBE7>: + 60: c632 sw a2,12(sp) + +00000062 <.LBB8>: + 62: 8bfd and a5,a5,31 + +00000064 <.LVL10>: + 64: 8d1d sub a0,a0,a5 + +00000066 <.LVL11>: + 66: ef95 bnez a5,a2 <.L4> + +00000068 <.LVL12>: + 68: 070a sll a4,a4,0x2 + +0000006a <.LVL13>: + 6a: 02c70793 add a5,a4,44 + +0000006e <.LVL14>: + 6e: 00278733 add a4,a5,sp + 72: fd472783 lw a5,-44(a4) + 76: c03e sw a5,0(sp) + +00000078 <.L5>: + 78: 4502 lw a0,0(sp) + +0000007a <.LVL16>: + 7a: d6e9 beqz a3,44 <.L2> + 7c: 40a00533 neg a0,a0 + 80: b7d1 j 44 <.L2> + +00000082 <.L7>: + 82: 00f5d5b3 srl a1,a1,a5 + 86: 00a61533 sll a0,a2,a0 + +0000008a <.LVL19>: + 8a: 8dc9 or a1,a1,a0 + 8c: c02e sw a1,0(sp) + +0000008e <.LVL20>: + 8e: 4705 li a4,1 + +00000090 <.L6>: + 90: 070a sll a4,a4,0x2 + +00000092 <.LVL22>: + 92: 02c70713 add a4,a4,44 + 96: 970a add a4,a4,sp + 98: 00f65633 srl a2,a2,a5 + 9c: fcc72a23 sw a2,-44(a4) + a0: bfe1 j 78 <.L5> + +000000a2 <.L4>: + a2: 4309 li t1,2 + a4: fc670fe3 beq a4,t1,82 <.L7> + a8: 4701 li a4,0 + +000000aa <.LVL24>: + aa: b7dd j 90 <.L6> + +000000ac <.L8>: + ac: 4501 li a0,0 + +000000ae <.LVL26>: + ae: bf59 j 44 <.L2> + +fixunstfsi.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__fixunstfsi>: + 0: 4114 lw a3,0(a0) + 2: 414c lw a1,4(a0) + 4: 4510 lw a2,8(a0) + 6: 4558 lw a4,12(a0) + 8: fd410113 add sp,sp,-44 + c: 01f10793 add a5,sp,31 + 10: 9bc1 and a5,a5,-16 + +00000012 <.LBB3>: + 12: c3cc sw a1,4(a5) + 14: c394 sw a3,0(a5) + 16: c790 sw a2,8(a5) + 18: c7d8 sw a4,12(a5) + 1a: 00171593 sll a1,a4,0x1 + +0000001e <.LBE3>: + 1e: 6791 lui a5,0x4 + +00000020 <.LBB4>: + 20: c036 sw a3,0(sp) + 22: c432 sw a2,8(sp) + 24: 81c5 srl a1,a1,0x11 + +00000026 <.LBE4>: + 26: ffe78513 add a0,a5,-2 # 3ffe <.LASF19+0x3dea> + 2a: 06b55b63 bge a0,a1,a0 <.L7> + 2e: 01f75693 srl a3,a4,0x1f + 32: 4501 li a0,0 + 34: ee95 bnez a3,70 <.L1> + 36: 01e78693 add a3,a5,30 + 3a: 557d li a0,-1 + 3c: 02b6ca63 blt a3,a1,70 <.L1> + +00000040 <.LBB10>: + 40: 0742 sll a4,a4,0x10 + +00000042 <.LVL3>: + 42: 8341 srl a4,a4,0x10 + +00000044 <.LBB11>: + 44: 66c1 lui a3,0x10 + +00000046 <.LBB6>: + 46: 06f78793 add a5,a5,111 + 4a: 8f8d sub a5,a5,a1 + +0000004c <.LBE6>: + 4c: 8ed9 or a3,a3,a4 + +0000004e <.LBB7>: + 4e: 02000593 li a1,32 + +00000052 <.LVL4>: + 52: 4057d713 sra a4,a5,0x5 + +00000056 <.LBE7>: + 56: c636 sw a3,12(sp) + +00000058 <.LBB8>: + 58: 8bfd and a5,a5,31 + +0000005a <.LVL6>: + 5a: 8d9d sub a1,a1,a5 + +0000005c <.LVL7>: + 5c: ef8d bnez a5,96 <.L3> + +0000005e <.LVL8>: + 5e: 070a sll a4,a4,0x2 + +00000060 <.LVL9>: + 60: 02c70793 add a5,a4,44 + +00000064 <.LVL10>: + 64: 00278733 add a4,a5,sp + 68: fd472783 lw a5,-44(a4) + 6c: c03e sw a5,0(sp) + +0000006e <.L4>: + 6e: 4502 lw a0,0(sp) + +00000070 <.L1>: + 70: 02c10113 add sp,sp,44 + +00000074 <.LVL13>: + 74: 8082 ret + +00000076 <.L6>: + 76: 00f65633 srl a2,a2,a5 + 7a: 00b695b3 sll a1,a3,a1 + +0000007e <.LVL15>: + 7e: 8e4d or a2,a2,a1 + 80: c032 sw a2,0(sp) + +00000082 <.LVL16>: + 82: 4705 li a4,1 + +00000084 <.L5>: + 84: 070a sll a4,a4,0x2 + +00000086 <.LVL18>: + 86: 02c70713 add a4,a4,44 + 8a: 970a add a4,a4,sp + 8c: 00f6d6b3 srl a3,a3,a5 + 90: fcd72a23 sw a3,-44(a4) + 94: bfe9 j 6e <.L4> + +00000096 <.L3>: + 96: 4509 li a0,2 + 98: fca70fe3 beq a4,a0,76 <.L6> + 9c: 4701 li a4,0 + +0000009e <.LVL20>: + 9e: b7dd j 84 <.L5> + +000000a0 <.L7>: + a0: 4501 li a0,0 + a2: b7f9 j 70 <.L1> + +floatsitf.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__floatsitf>: + 0: 7139 add sp,sp,-64 + 2: da26 sw s1,52(sp) + 4: 02710693 add a3,sp,39 + 8: de06 sw ra,60(sp) + a: dc22 sw s0,56(sp) + c: 84aa mv s1,a0 + e: 9ac1 and a3,a3,-16 + +00000010 <.LBB13>: + 10: c5f9 beqz a1,de <.L2> + +00000012 <.LBB3>: + 12: 41f5d793 sra a5,a1,0x1f + 16: 00b7c433 xor s0,a5,a1 + 1a: 8c1d sub s0,s0,a5 + 1c: 01f5d313 srl t1,a1,0x1f + +00000020 <.LBB4>: + 20: 8522 mv a0,s0 + 22: c236 sw a3,4(sp) + +00000024 <.LBE4>: + 24: c01a sw t1,0(sp) + +00000026 <.LBB5>: + 26: 00000097 auipc ra,0x0 + 2a: 000080e7 jalr ra # 26 <.LBB5> + +0000002e <.LBE5>: + 2e: 05150793 add a5,a0,81 + +00000032 <.LBB6>: + 32: 6611 lui a2,0x4 + 34: 0679 add a2,a2,30 # 401e <.LASF30+0x3d46> + +00000036 <.LBB7>: + 36: 4057d713 sra a4,a5,0x5 + +0000003a <.LBE7>: + 3a: c422 sw s0,8(sp) + 3c: c602 sw zero,12(sp) + 3e: c802 sw zero,16(sp) + 40: ca02 sw zero,20(sp) + +00000042 <.LBB8>: + 42: 8bfd and a5,a5,31 + 44: 4302 lw t1,0(sp) + 46: 4692 lw a3,4(sp) + +00000048 <.LBB9>: + 48: 8e09 sub a2,a2,a0 + +0000004a <.LBB10>: + 4a: c795 beqz a5,76 <.L4> + +0000004c <.LVL6>: + 4c: 4589 li a1,2 + 4e: 08b71663 bne a4,a1,da <.L9> + 52: 02000593 li a1,32 + 56: 8d9d sub a1,a1,a5 + +00000058 <.LVL7>: + 58: 00b455b3 srl a1,s0,a1 + +0000005c <.LVL8>: + 5c: ca2e sw a1,20(sp) + +0000005e <.L5>: + 5e: fff70593 add a1,a4,-1 + +00000062 <.LVL10>: + 62: 070a sll a4,a4,0x2 + 64: 02c70713 add a4,a4,44 + 68: 0028 add a0,sp,8 + +0000006a <.LVL11>: + 6a: 972a add a4,a4,a0 + 6c: 00f41433 sll s0,s0,a5 + +00000070 <.LVL12>: + 70: fc872a23 sw s0,-44(a4) + 74: a00d j 96 <.L6> + +00000076 <.L4>: + 76: 478d li a5,3 + +00000078 <.LVL14>: + 78: 8f99 sub a5,a5,a4 + 7a: 078a sll a5,a5,0x2 + 7c: 002c add a1,sp,8 + 7e: 02c78793 add a5,a5,44 + 82: 97ae add a5,a5,a1 + 84: fd47a783 lw a5,-44(a5) + 88: 4589 li a1,2 + 8a: ca3e sw a5,20(sp) + +0000008c <.LVL15>: + 8c: 4789 li a5,2 + 8e: 00f71463 bne a4,a5,96 <.L6> + 92: c822 sw s0,16(sp) + +00000094 <.LVL16>: + 94: 4585 li a1,1 + +00000096 <.L6>: + 96: 058a sll a1,a1,0x2 + 98: c402 sw zero,8(sp) + +0000009a <.LVL18>: + 9a: c602 sw zero,12(sp) + 9c: 15f1 add a1,a1,-4 + 9e: 4791 li a5,4 + a0: 00f5e363 bltu a1,a5,a6 <.L7> + a4: c802 sw zero,16(sp) + +000000a6 <.L7>: + a6: 859a mv a1,t1 + +000000a8 <.L8>: + a8: 4352 lw t1,20(sp) + aa: 4522 lw a0,8(sp) + ac: 4732 lw a4,12(sp) + ae: 47c2 lw a5,16(sp) + b0: 00f59413 sll s0,a1,0xf + b4: 8c51 or s0,s0,a2 + b6: 00869723 sh s0,14(a3) + ba: 00669623 sh t1,12(a3) + be: c288 sw a0,0(a3) + c0: c2d8 sw a4,4(a3) + c2: c69c sw a5,8(a3) + c4: 46d4 lw a3,12(a3) + +000000c6 <.LBE14>: + c6: 50f2 lw ra,60(sp) + c8: 5462 lw s0,56(sp) + ca: c088 sw a0,0(s1) + cc: c0d8 sw a4,4(s1) + ce: c49c sw a5,8(s1) + d0: c4d4 sw a3,12(s1) + d2: 8526 mv a0,s1 + +000000d4 <.LVL21>: + d4: 54d2 lw s1,52(sp) + d6: 6121 add sp,sp,64 + +000000d8 <.LVL23>: + d8: 8082 ret + +000000da <.L9>: + da: 470d li a4,3 + +000000dc <.LVL25>: + dc: b749 j 5e <.L5> + +000000de <.L2>: + de: ca02 sw zero,20(sp) + e0: c802 sw zero,16(sp) + e2: c602 sw zero,12(sp) + e4: c402 sw zero,8(sp) + e6: 4601 li a2,0 + e8: b7c1 j a8 <.L8> + +floatunsitf.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__floatunsitf>: + 0: fc410113 add sp,sp,-60 + 4: d826 sw s1,48(sp) + 6: dc06 sw ra,56(sp) + 8: 02310493 add s1,sp,35 + c: da22 sw s0,52(sp) + e: 86aa mv a3,a0 + 10: 98c1 and s1,s1,-16 + +00000012 <.LBB12>: + 12: cdc5 beqz a1,ca <.L2> + 14: c02a sw a0,0(sp) + +00000016 <.LBB3>: + 16: 852e mv a0,a1 + 18: 842e mv s0,a1 + 1a: 00000097 auipc ra,0x0 + 1e: 000080e7 jalr ra # 1a <.LBB3+0x4> + +00000022 <.LBE4>: + 22: 05150793 add a5,a0,81 + +00000026 <.LBB5>: + 26: 6591 lui a1,0x4 + 28: 05f9 add a1,a1,30 # 401e <.LASF29+0x3d4b> + +0000002a <.LBB6>: + 2a: 4057d713 sra a4,a5,0x5 + +0000002e <.LBE6>: + 2e: c222 sw s0,4(sp) + 30: c402 sw zero,8(sp) + 32: c602 sw zero,12(sp) + 34: c802 sw zero,16(sp) + +00000036 <.LBB7>: + 36: 8bfd and a5,a5,31 + 38: 4682 lw a3,0(sp) + +0000003a <.LBB8>: + 3a: 8d89 sub a1,a1,a0 + +0000003c <.LBB9>: + 3c: c795 beqz a5,68 <.L3> + +0000003e <.LVL5>: + 3e: 4609 li a2,2 + 40: 08c71363 bne a4,a2,c6 <.L8> + 44: 02000613 li a2,32 + 48: 8e1d sub a2,a2,a5 + +0000004a <.LVL6>: + 4a: 00c45633 srl a2,s0,a2 + +0000004e <.LVL7>: + 4e: c832 sw a2,16(sp) + +00000050 <.L4>: + 50: fff70613 add a2,a4,-1 + +00000054 <.LVL9>: + 54: 070a sll a4,a4,0x2 + 56: 02c70713 add a4,a4,44 + 5a: 0048 add a0,sp,4 + +0000005c <.LVL10>: + 5c: 972a add a4,a4,a0 + 5e: 00f41433 sll s0,s0,a5 + +00000062 <.LVL11>: + 62: fc872a23 sw s0,-44(a4) + 66: a00d j 88 <.L5> + +00000068 <.L3>: + 68: 478d li a5,3 + +0000006a <.LVL13>: + 6a: 8f99 sub a5,a5,a4 + 6c: 078a sll a5,a5,0x2 + 6e: 0050 add a2,sp,4 + 70: 02c78793 add a5,a5,44 + 74: 97b2 add a5,a5,a2 + 76: fd47a783 lw a5,-44(a5) + 7a: 4609 li a2,2 + 7c: c83e sw a5,16(sp) + +0000007e <.LVL14>: + 7e: 4789 li a5,2 + 80: 00f71463 bne a4,a5,88 <.L5> + 84: c622 sw s0,12(sp) + +00000086 <.LVL15>: + 86: 4605 li a2,1 + +00000088 <.L5>: + 88: 060a sll a2,a2,0x2 + 8a: c202 sw zero,4(sp) + +0000008c <.LVL17>: + 8c: c402 sw zero,8(sp) + 8e: 1671 add a2,a2,-4 + 90: 4791 li a5,4 + 92: 00f66363 bltu a2,a5,98 <.L7> + 96: c602 sw zero,12(sp) + +00000098 <.L7>: + 98: 4542 lw a0,16(sp) + 9a: 00b49723 sh a1,14(s1) + 9e: 4612 lw a2,4(sp) + a0: 00a49623 sh a0,12(s1) + a4: 4722 lw a4,8(sp) + a6: 47b2 lw a5,12(sp) + a8: 44cc lw a1,12(s1) + +000000aa <.LBE13>: + aa: 50e2 lw ra,56(sp) + ac: 5452 lw s0,52(sp) + +000000ae <.LBB14>: + ae: c090 sw a2,0(s1) + b0: c0d8 sw a4,4(s1) + b2: c49c sw a5,8(s1) + +000000b4 <.LBE14>: + b4: c290 sw a2,0(a3) + b6: c2d8 sw a4,4(a3) + b8: c69c sw a5,8(a3) + ba: c6cc sw a1,12(a3) + bc: 54c2 lw s1,48(sp) + be: 8536 mv a0,a3 + c0: 03c10113 add sp,sp,60 + c4: 8082 ret + +000000c6 <.L8>: + c6: 470d li a4,3 + +000000c8 <.LVL22>: + c8: b761 j 50 <.L4> + +000000ca <.L2>: + ca: c802 sw zero,16(sp) + cc: c602 sw zero,12(sp) + ce: c402 sw zero,8(sp) + d0: c202 sw zero,4(sp) + d2: 4581 li a1,0 + +000000d4 <.LVL24>: + d4: b7d1 j 98 <.L7> + +fixtfdi.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__fixtfdi>: + 0: fcc10113 add sp,sp,-52 + 4: 4154 lw a3,4(a0) + 6: 4518 lw a4,8(a0) + 8: 4110 lw a2,0(a0) + a: 454c lw a1,12(a0) + c: 01f10793 add a5,sp,31 + 10: 9bc1 and a5,a5,-16 + 12: d822 sw s0,48(sp) + 14: d626 sw s1,44(sp) + +00000016 <.LBB3>: + 16: c3d4 sw a3,4(a5) + 18: c798 sw a4,8(a5) + 1a: c390 sw a2,0(a5) + 1c: c7cc sw a1,12(a5) + 1e: c43a sw a4,8(sp) + +00000020 <.LBE3>: + 20: 6791 lui a5,0x4 + +00000022 <.LBB4>: + 22: 00159713 sll a4,a1,0x1 + 26: c236 sw a3,4(sp) + 28: c032 sw a2,0(sp) + 2a: 8345 srl a4,a4,0x11 + +0000002c <.LBE4>: + 2c: ffe78693 add a3,a5,-2 # 3ffe <.LLST11+0x3d85> + 30: 0ee6db63 bge a3,a4,126 <.L11> + 34: 03d78693 add a3,a5,61 + 38: 01f5d613 srl a2,a1,0x1f + 3c: 02e6d363 bge a3,a4,62 <.L3> + +00000040 <.LVL2>: + 40: 4505 li a0,1 + 42: 8d11 sub a0,a0,a2 + 44: 41f55713 sra a4,a0,0x1f + +00000048 <.LVL3>: + 48: 800005b7 lui a1,0x80000 + +0000004c <.LVL4>: + 4c: 00a037b3 snez a5,a0 + 50: 8d99 sub a1,a1,a4 + 52: 40a00533 neg a0,a0 + 56: 8d9d sub a1,a1,a5 + +00000058 <.L2>: + 58: 5442 lw s0,48(sp) + 5a: 54b2 lw s1,44(sp) + 5c: 03410113 add sp,sp,52 + +00000060 <.LVL6>: + 60: 8082 ret + +00000062 <.L3>: + 62: 05c2 sll a1,a1,0x10 + +00000064 <.LBB11>: + 64: 66c1 lui a3,0x10 + +00000066 <.LBB12>: + 66: 81c1 srl a1,a1,0x10 + +00000068 <.LBB13>: + 68: 06f78793 add a5,a5,111 + +0000006c <.LBE6>: + 6c: 8dd5 or a1,a1,a3 + +0000006e <.LBB7>: + 6e: 8f99 sub a5,a5,a4 + 70: 4057d713 sra a4,a5,0x5 + +00000074 <.LVL9>: + 74: 468d li a3,3 + +00000076 <.LBE7>: + 76: c62e sw a1,12(sp) + +00000078 <.LBB8>: + 78: 8bfd and a5,a5,31 + +0000007a <.LVL11>: + 7a: 8e99 sub a3,a3,a4 + 7c: 00271513 sll a0,a4,0x2 + 80: c795 beqz a5,ac <.L4> + 82: 02000393 li t2,32 + 86: 40f383b3 sub t2,t2,a5 + +0000008a <.LVL12>: + 8a: 950a add a0,a0,sp + 8c: 840a mv s0,sp + 8e: 4281 li t0,0 + +00000090 <.L5>: + 90: 06d2cc63 blt t0,a3,108 <.L8> + 94: 068a sll a3,a3,0x2 + 96: 02c68693 add a3,a3,44 # 1002c <.LLST11+0xfdb3> + 9a: 4511 li a0,4 + 9c: 968a add a3,a3,sp + 9e: 00f5d5b3 srl a1,a1,a5 + a2: 40e50733 sub a4,a0,a4 + +000000a6 <.LVL14>: + a6: fcb6aa23 sw a1,-44(a3) + aa: a839 j c8 <.L7> + +000000ac <.L4>: + ac: 858a mv a1,sp + +000000ae <.L6>: + ae: 00a58333 add t1,a1,a0 + b2: 00032303 lw t1,0(t1) + b6: 0785 add a5,a5,1 + +000000b8 <.LVL17>: + b8: 0065a023 sw t1,0(a1) # 80000000 <.LLST11+0x7ffffd87> + +000000bc <.LVL18>: + bc: 0591 add a1,a1,4 + be: fef6d8e3 bge a3,a5,ae <.L6> + c2: 4791 li a5,4 + +000000c4 <.LVL19>: + c4: 40e78733 sub a4,a5,a4 + +000000c8 <.L7>: + c8: 4691 li a3,4 + ca: 8e99 sub a3,a3,a4 + cc: 070a sll a4,a4,0x2 + ce: 00e107b3 add a5,sp,a4 + d2: 00269713 sll a4,a3,0x2 + d6: 46a1 li a3,8 + d8: 00d76863 bltu a4,a3,e8 <.L9> + dc: 0007a023 sw zero,0(a5) + e0: 0007a223 sw zero,4(a5) + e4: 1761 add a4,a4,-8 + e6: 07a1 add a5,a5,8 + +000000e8 <.L9>: + e8: 4691 li a3,4 + ea: 00d76463 bltu a4,a3,f2 <.L10> + ee: 0007a023 sw zero,0(a5) + +000000f2 <.L10>: + f2: 4502 lw a0,0(sp) + f4: 4592 lw a1,4(sp) + +000000f6 <.LVL22>: + f6: d22d beqz a2,58 <.L2> + f8: 00a037b3 snez a5,a0 + fc: 40b005b3 neg a1,a1 + 100: 8d9d sub a1,a1,a5 + 102: 40a00533 neg a0,a0 + +00000106 <.LVL23>: + 106: bf89 j 58 <.L2> + +00000108 <.L8>: + 108: 00052303 lw t1,0(a0) + 10c: 4144 lw s1,4(a0) + 10e: 0285 add t0,t0,1 + +00000110 <.LVL25>: + 110: 00f35333 srl t1,t1,a5 + 114: 007494b3 sll s1,s1,t2 + 118: 00936333 or t1,t1,s1 + 11c: 00642023 sw t1,0(s0) + +00000120 <.LVL26>: + 120: 0511 add a0,a0,4 + 122: 0411 add s0,s0,4 + 124: b7b5 j 90 <.L5> + +00000126 <.L11>: + 126: 4501 li a0,0 + 128: 4581 li a1,0 + +0000012a <.LVL28>: + 12a: b73d j 58 <.L2> + +fixunstfdi.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__fixunstfdi>: + 0: 7179 add sp,sp,-48 + 2: 410c lw a1,0(a0) + 4: 4514 lw a3,8(a0) + 6: 4150 lw a2,4(a0) + 8: 4558 lw a4,12(a0) + a: 01f10793 add a5,sp,31 + e: 9bc1 and a5,a5,-16 + 10: d622 sw s0,44(sp) + +00000012 <.LBB3>: + 12: c38c sw a1,0(a5) + 14: c794 sw a3,8(a5) + 16: c3d0 sw a2,4(a5) + 18: c7d8 sw a4,12(a5) + 1a: c436 sw a3,8(sp) + +0000001c <.LBE3>: + 1c: 6791 lui a5,0x4 + +0000001e <.LBB4>: + 1e: 00171693 sll a3,a4,0x1 + 22: c02e sw a1,0(sp) + 24: c232 sw a2,4(sp) + 26: 82c5 srl a3,a3,0x11 + +00000028 <.LBE4>: + 28: ffe78593 add a1,a5,-2 # 3ffe <.LASF19+0x3dea> + 2c: 0cd5d263 bge a1,a3,f0 <.L11> + 30: 01f75613 srl a2,a4,0x1f + 34: ee55 bnez a2,f0 <.L11> + 36: 03e78613 add a2,a5,62 + 3a: 0ad64e63 blt a2,a3,f6 <.L12> + +0000003e <.LBB10>: + 3e: 0742 sll a4,a4,0x10 + +00000040 <.LVL3>: + 40: 8341 srl a4,a4,0x10 + +00000042 <.LBB11>: + 42: 6641 lui a2,0x10 + +00000044 <.LBB6>: + 44: 06f78793 add a5,a5,111 + +00000048 <.LBE6>: + 48: 00c765b3 or a1,a4,a2 + +0000004c <.LBB7>: + 4c: 8f95 sub a5,a5,a3 + 4e: 4057d713 sra a4,a5,0x5 + 52: 468d li a3,3 + +00000054 <.LBE7>: + 54: c62e sw a1,12(sp) + +00000056 <.LBB8>: + 56: 8bfd and a5,a5,31 + +00000058 <.LVL6>: + 58: 8e99 sub a3,a3,a4 + 5a: 00271613 sll a2,a4,0x2 + 5e: c795 beqz a5,8a <.L3> + 60: 02000293 li t0,32 + 64: 40f282b3 sub t0,t0,a5 + +00000068 <.LVL7>: + 68: 960a add a2,a2,sp + 6a: 838a mv t2,sp + 6c: 4301 li t1,0 + +0000006e <.L4>: + 6e: 06d34463 blt t1,a3,d6 <.L7> + 72: 068a sll a3,a3,0x2 + 74: 02c68693 add a3,a3,44 + 78: 4611 li a2,4 + 7a: 968a add a3,a3,sp + 7c: 00f5d5b3 srl a1,a1,a5 + 80: 40e60733 sub a4,a2,a4 + +00000084 <.LVL9>: + 84: fcb6aa23 sw a1,-44(a3) + 88: a829 j a2 <.L6> + +0000008a <.L3>: + 8a: 858a mv a1,sp + +0000008c <.L5>: + 8c: 00c58533 add a0,a1,a2 + 90: 4108 lw a0,0(a0) + 92: 0785 add a5,a5,1 + +00000094 <.LVL12>: + 94: c188 sw a0,0(a1) + +00000096 <.LVL13>: + 96: 0591 add a1,a1,4 + 98: fef6dae3 bge a3,a5,8c <.L5> + 9c: 4791 li a5,4 + +0000009e <.LVL14>: + 9e: 40e78733 sub a4,a5,a4 + +000000a2 <.L6>: + a2: 4691 li a3,4 + a4: 8e99 sub a3,a3,a4 + a6: 070a sll a4,a4,0x2 + a8: 00e107b3 add a5,sp,a4 + ac: 00269713 sll a4,a3,0x2 + b0: 46a1 li a3,8 + b2: 00d76863 bltu a4,a3,c2 <.L8> + b6: 0007a023 sw zero,0(a5) + ba: 0007a223 sw zero,4(a5) + be: 1761 add a4,a4,-8 + c0: 07a1 add a5,a5,8 + +000000c2 <.L8>: + c2: 4691 li a3,4 + c4: 00d76463 bltu a4,a3,cc <.L9> + c8: 0007a023 sw zero,0(a5) + +000000cc <.L9>: + cc: 4502 lw a0,0(sp) + ce: 4592 lw a1,4(sp) + +000000d0 <.L1>: + d0: 5432 lw s0,44(sp) + d2: 6145 add sp,sp,48 + +000000d4 <.LVL18>: + d4: 8082 ret + +000000d6 <.L7>: + d6: 4208 lw a0,0(a2) + d8: 4240 lw s0,4(a2) + da: 0305 add t1,t1,1 + +000000dc <.LVL20>: + dc: 00f55533 srl a0,a0,a5 + e0: 00541433 sll s0,s0,t0 + e4: 8d41 or a0,a0,s0 + e6: 00a3a023 sw a0,0(t2) + +000000ea <.LVL21>: + ea: 0611 add a2,a2,4 # 10004 <.LASF19+0xfdf0> + ec: 0391 add t2,t2,4 + ee: b741 j 6e <.L4> + +000000f0 <.L11>: + f0: 4501 li a0,0 + f2: 4581 li a1,0 + f4: bff1 j d0 <.L1> + +000000f6 <.L12>: + f6: 557d li a0,-1 + f8: 55fd li a1,-1 + +000000fa <.LVL23>: + fa: bfd9 j d0 <.L1> + +floatditf.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__floatditf>: + 0: fbc10113 add sp,sp,-68 + 4: 02b10693 add a3,sp,43 + 8: c086 sw ra,64(sp) + a: de22 sw s0,60(sp) + c: dc26 sw s1,56(sp) + e: c02a sw a0,0(sp) + +00000010 <.LBB11>: + 10: 00c5e7b3 or a5,a1,a2 + +00000014 <.LBE11>: + 14: 9ac1 and a3,a3,-16 + +00000016 <.LBB12>: + 16: 12078d63 beqz a5,150 <.L2> + 1a: 84ae mv s1,a1 + +0000001c <.LBB3>: + 1c: 01f65413 srl s0,a2,0x1f + +00000020 <.LVL2>: + 20: 00065963 bgez a2,32 <.L4> + 24: 00b037b3 snez a5,a1 + 28: 40c00633 neg a2,a2 + +0000002c <.LVL3>: + 2c: 8e1d sub a2,a2,a5 + 2e: 40b004b3 neg s1,a1 + +00000032 <.L4>: + 32: c635 beqz a2,9e <.L6> + 34: 8532 mv a0,a2 + 36: c436 sw a3,8(sp) + 38: c232 sw a2,4(sp) + 3a: 00000097 auipc ra,0x0 + 3e: 000080e7 jalr ra # 3a <.L4+0x8> + +00000042 <.LVL7>: + 42: 4612 lw a2,4(sp) + 44: 46a2 lw a3,8(sp) + +00000046 <.L7>: + 46: 6591 lui a1,0x4 + 48: 03e58593 add a1,a1,62 # 403e <.LASF30+0x3d66> + 4c: 8d89 sub a1,a1,a0 + +0000004e <.LBE4>: + 4e: 03150513 add a0,a0,49 + +00000052 <.LVL10>: + 52: c832 sw a2,16(sp) + +00000054 <.LBB5>: + 54: 40555713 sra a4,a0,0x5 + +00000058 <.LBE5>: + 58: c626 sw s1,12(sp) + 5a: ca02 sw zero,20(sp) + 5c: cc02 sw zero,24(sp) + +0000005e <.LBB6>: + 5e: 01f57793 and a5,a0,31 + +00000062 <.LVL12>: + 62: 40e00633 neg a2,a4 + +00000066 <.LVL13>: + 66: cba1 beqz a5,b6 <.L8> + 68: 02000513 li a0,32 + +0000006c <.LVL14>: + 6c: 8d1d sub a0,a0,a5 + +0000006e <.LVL15>: + 6e: c22a sw a0,4(sp) + 70: 00261513 sll a0,a2,0x2 + +00000074 <.LVL16>: + 74: 00c10393 add t2,sp,12 + 78: 00c50613 add a2,a0,12 + 7c: 961e add a2,a2,t2 + 7e: 40a00333 neg t1,a0 + +00000082 <.L9>: + 82: 0ac39563 bne t2,a2,12c <.L12> + 86: fff70613 add a2,a4,-1 + +0000008a <.LVL18>: + 8a: 070a sll a4,a4,0x2 + +0000008c <.LVL19>: + 8c: 02c70713 add a4,a4,44 + 90: 0068 add a0,sp,12 + 92: 972a add a4,a4,a0 + 94: 00f494b3 sll s1,s1,a5 + 98: fc972a23 sw s1,-44(a4) + 9c: a825 j d4 <.L11> + +0000009e <.L6>: + 9e: 8526 mv a0,s1 + a0: c432 sw a2,8(sp) + a2: c236 sw a3,4(sp) + a4: 00000097 auipc ra,0x0 + a8: 000080e7 jalr ra # a4 <.L6+0x6> + +000000ac <.LVL22>: + ac: 4622 lw a2,8(sp) + ae: 4692 lw a3,4(sp) + b0: 02050513 add a0,a0,32 + b4: bf49 j 46 <.L7> + +000000b6 <.L8>: + b6: 083c add a5,sp,24 + +000000b8 <.LVL25>: + b8: 060a sll a2,a2,0x2 + +000000ba <.LBB8>: + ba: 450d li a0,3 + +000000bc <.L10>: + bc: 00c782b3 add t0,a5,a2 + c0: 0002a283 lw t0,0(t0) + c4: 157d add a0,a0,-1 + +000000c6 <.LVL27>: + c6: 17f1 add a5,a5,-4 + c8: 0057a223 sw t0,4(a5) + +000000cc <.LVL28>: + cc: fee558e3 bge a0,a4,bc <.L10> + d0: fff70613 add a2,a4,-1 + +000000d4 <.L11>: + d4: 00160793 add a5,a2,1 + d8: 078a sll a5,a5,0x2 + da: 4621 li a2,8 + dc: 0078 add a4,sp,12 + de: 00c7e863 bltu a5,a2,ee <.L13> + e2: 00072023 sw zero,0(a4) + e6: 00072223 sw zero,4(a4) + ea: 17e1 add a5,a5,-8 + ec: 0858 add a4,sp,20 + +000000ee <.L13>: + ee: 4611 li a2,4 + f0: 00c7e463 bltu a5,a2,f8 <.L15> + f4: 00072023 sw zero,0(a4) + +000000f8 <.L15>: + f8: 4562 lw a0,24(sp) + fa: 4632 lw a2,12(sp) + fc: 4742 lw a4,16(sp) + fe: 47d2 lw a5,20(sp) + 100: 043e sll s0,s0,0xf + +00000102 <.LVL31>: + 102: 8c4d or s0,s0,a1 + 104: 00a69623 sh a0,12(a3) + 108: 00869723 sh s0,14(a3) + +0000010c <.LBE13>: + 10c: 4582 lw a1,0(sp) + +0000010e <.LBB14>: + 10e: c290 sw a2,0(a3) + 110: c2d8 sw a4,4(a3) + 112: c69c sw a5,8(a3) + 114: 46d4 lw a3,12(a3) + +00000116 <.LBE14>: + 116: 4086 lw ra,64(sp) + 118: 5472 lw s0,60(sp) + 11a: c190 sw a2,0(a1) + 11c: c1d8 sw a4,4(a1) + 11e: c59c sw a5,8(a1) + 120: c5d4 sw a3,12(a1) + 122: 54e2 lw s1,56(sp) + 124: 852e mv a0,a1 + 126: 04410113 add sp,sp,68 + 12a: 8082 ret + +0000012c <.L12>: + 12c: 4208 lw a0,0(a2) + 12e: ffc62283 lw t0,-4(a2) + 132: 00f51533 sll a0,a0,a5 + 136: c42a sw a0,8(sp) + 138: 4512 lw a0,4(sp) + 13a: 00a2d2b3 srl t0,t0,a0 + 13e: 4522 lw a0,8(sp) + 140: 00556533 or a0,a0,t0 + 144: 006602b3 add t0,a2,t1 + 148: 00a2a023 sw a0,0(t0) + 14c: 1671 add a2,a2,-4 + 14e: bf15 j 82 <.L9> + +00000150 <.L2>: + 150: cc02 sw zero,24(sp) + 152: ca02 sw zero,20(sp) + 154: c802 sw zero,16(sp) + 156: c602 sw zero,12(sp) + 158: 4581 li a1,0 + +0000015a <.LVL37>: + 15a: 4401 li s0,0 + 15c: bf71 j f8 <.L15> + +floatunditf.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__floatunditf>: + 0: fbc10113 add sp,sp,-68 + 4: de22 sw s0,60(sp) + 6: c086 sw ra,64(sp) + 8: 02b10413 add s0,sp,43 + c: dc26 sw s1,56(sp) + e: c02a sw a0,0(sp) + +00000010 <.LBB11>: + 10: 00c5e7b3 or a5,a1,a2 + +00000014 <.LBE11>: + 14: 9841 and s0,s0,-16 + +00000016 <.LBB12>: + 16: 10078863 beqz a5,126 <.L2> + 1a: 84ae mv s1,a1 + +0000001c <.LBB3>: + 1c: c625 beqz a2,84 <.L4> + 1e: 8532 mv a0,a2 + 20: c232 sw a2,4(sp) + 22: 00000097 auipc ra,0x0 + 26: 000080e7 jalr ra # 22 <.LBB3+0x6> + +0000002a <.L16>: + 2a: 4612 lw a2,4(sp) + +0000002c <.LVL4>: + 2c: 6591 lui a1,0x4 + 2e: 03e58593 add a1,a1,62 # 403e <.LASF29+0x3d6b> + 32: 8d89 sub a1,a1,a0 + +00000034 <.LBE4>: + 34: 03150513 add a0,a0,49 + +00000038 <.LBB5>: + 38: 40555713 sra a4,a0,0x5 + +0000003c <.LBE5>: + 3c: c626 sw s1,12(sp) + 3e: c832 sw a2,16(sp) + 40: ca02 sw zero,20(sp) + 42: cc02 sw zero,24(sp) + +00000044 <.LBB6>: + 44: 01f57793 and a5,a0,31 + +00000048 <.LVL8>: + 48: 40e006b3 neg a3,a4 + 4c: c7a9 beqz a5,96 <.L6> + 4e: 02000613 li a2,32 + 52: 8e1d sub a2,a2,a5 + +00000054 <.LVL9>: + 54: c232 sw a2,4(sp) + +00000056 <.LVL10>: + 56: 00269613 sll a2,a3,0x2 + +0000005a <.LVL11>: + 5a: 00c10293 add t0,sp,12 + 5e: 00c60693 add a3,a2,12 + 62: 9696 add a3,a3,t0 + 64: 40c00333 neg t1,a2 + +00000068 <.L7>: + 68: 08d29e63 bne t0,a3,104 <.L10> + 6c: fff70693 add a3,a4,-1 + +00000070 <.LVL13>: + 70: 070a sll a4,a4,0x2 + +00000072 <.LVL14>: + 72: 02c70713 add a4,a4,44 + 76: 0070 add a2,sp,12 + 78: 9732 add a4,a4,a2 + 7a: 00f494b3 sll s1,s1,a5 + 7e: fc972a23 sw s1,-44(a4) + 82: a03d j b0 <.L9> + +00000084 <.L4>: + 84: 852e mv a0,a1 + 86: c232 sw a2,4(sp) + 88: 00000097 auipc ra,0x0 + 8c: 000080e7 jalr ra # 88 <.L4+0x4> + +00000090 <.LVL17>: + 90: 02050513 add a0,a0,32 + +00000094 <.LVL18>: + 94: bf59 j 2a <.L16> + +00000096 <.L6>: + 96: 083c add a5,sp,24 + +00000098 <.LVL20>: + 98: 068a sll a3,a3,0x2 + +0000009a <.LBB8>: + 9a: 460d li a2,3 + +0000009c <.L8>: + 9c: 00d78533 add a0,a5,a3 + a0: 4108 lw a0,0(a0) + a2: 167d add a2,a2,-1 + +000000a4 <.LVL22>: + a4: 17f1 add a5,a5,-4 + a6: c3c8 sw a0,4(a5) + +000000a8 <.LVL23>: + a8: fee65ae3 bge a2,a4,9c <.L8> + ac: fff70693 add a3,a4,-1 + +000000b0 <.L9>: + b0: 00168793 add a5,a3,1 + b4: 078a sll a5,a5,0x2 + b6: 46a1 li a3,8 + b8: 0078 add a4,sp,12 + ba: 00d7e863 bltu a5,a3,ca <.L11> + be: 00072023 sw zero,0(a4) + c2: 00072223 sw zero,4(a4) + c6: 17e1 add a5,a5,-8 + c8: 0858 add a4,sp,20 + +000000ca <.L11>: + ca: 4691 li a3,4 + cc: 00d7e463 bltu a5,a3,d4 <.L13> + d0: 00072023 sw zero,0(a4) + +000000d4 <.L13>: + d4: 4662 lw a2,24(sp) + d6: 46b2 lw a3,12(sp) + d8: 4742 lw a4,16(sp) + da: 47d2 lw a5,20(sp) + dc: 00b41723 sh a1,14(s0) + e0: 00c41623 sh a2,12(s0) + +000000e4 <.LBE13>: + e4: 4582 lw a1,0(sp) + +000000e6 <.LBB14>: + e6: 4450 lw a2,12(s0) + +000000e8 <.LBE14>: + e8: 4086 lw ra,64(sp) + +000000ea <.LBB15>: + ea: c014 sw a3,0(s0) + ec: c058 sw a4,4(s0) + ee: c41c sw a5,8(s0) + +000000f0 <.LBE15>: + f0: 5472 lw s0,60(sp) + f2: c194 sw a3,0(a1) + f4: c1d8 sw a4,4(a1) + f6: c59c sw a5,8(a1) + f8: c5d0 sw a2,12(a1) + fa: 54e2 lw s1,56(sp) + fc: 852e mv a0,a1 + fe: 04410113 add sp,sp,68 + 102: 8082 ret + +00000104 <.L10>: + 104: 4290 lw a2,0(a3) + 106: ffc6a503 lw a0,-4(a3) + 10a: 006683b3 add t2,a3,t1 + 10e: 00f61633 sll a2,a2,a5 + 112: c432 sw a2,8(sp) + 114: 4612 lw a2,4(sp) + 116: 16f1 add a3,a3,-4 + 118: 00c55533 srl a0,a0,a2 + 11c: 4622 lw a2,8(sp) + 11e: 8e49 or a2,a2,a0 + 120: 00c3a023 sw a2,0(t2) + 124: b791 j 68 <.L7> + +00000126 <.L2>: + 126: cc02 sw zero,24(sp) + 128: ca02 sw zero,20(sp) + 12a: c802 sw zero,16(sp) + 12c: c602 sw zero,12(sp) + 12e: 4581 li a1,0 + +00000130 <.LVL31>: + 130: b755 j d4 <.L13> + +addsf3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__addsf3>: + 0: 00800737 lui a4,0x800 + +00000004 <.LBE2>: + 4: 1141 add sp,sp,-16 + +00000006 <.LBB3>: + 6: 177d add a4,a4,-1 # 7fffff <.LLST20+0x7ff6b8> + 8: 00a777b3 and a5,a4,a0 + +0000000c <.LBE3>: + c: c422 sw s0,8(sp) + +0000000e <.LBB4>: + e: 01f55693 srl a3,a0,0x1f + 12: 01755413 srl s0,a0,0x17 + +00000016 <.LBB5>: + 16: 0175d513 srl a0,a1,0x17 + +0000001a <.LVL2>: + 1a: 8f6d and a4,a4,a1 + +0000001c <.LBB6>: + 1c: 0ff47413 zext.b s0,s0 + +00000020 <.LBB7>: + 20: 0ff57513 zext.b a0,a0 + +00000024 <.LBE7>: + 24: c606 sw ra,12(sp) + 26: c226 sw s1,4(sp) + +00000028 <.LBB8>: + 28: 81fd srl a1,a1,0x1f + +0000002a <.LBE8>: + 2a: 078e sll a5,a5,0x3 + +0000002c <.LBB9>: + 2c: 070e sll a4,a4,0x3 + +0000002e <.LBB10>: + 2e: 40a40633 sub a2,s0,a0 + +00000032 <.LBE10>: + 32: 16b69c63 bne a3,a1,1aa <.L2> + +00000036 <.LBB11>: + 36: 0cc05a63 blez a2,10a <.L3> + +0000003a <.LVL8>: + 3a: e50d bnez a0,64 <.L4> + 3c: 16070563 beqz a4,1a6 <.L53> + 40: fff60593 add a1,a2,-1 + +00000044 <.LVL9>: + 44: e989 bnez a1,56 <.L6> + +00000046 <.L94>: + 46: 97ba add a5,a5,a4 + +00000048 <.LVL11>: + 48: 04000737 lui a4,0x4000 + +0000004c <.LVL12>: + 4c: 8f7d and a4,a4,a5 + 4e: 4409 li s0,2 + +00000050 <.LVL13>: + 50: e745 bnez a4,f8 <.L7> + +00000052 <.L91>: + 52: 4405 li s0,1 + 54: a025 j 7c <.L38> + +00000056 <.L6>: + 56: 0ff00513 li a0,255 + +0000005a <.LVL16>: + 5a: 00a61d63 bne a2,a0,74 <.L8> + +0000005e <.L63>: + 5e: 0ff00413 li s0,255 + +00000062 <.LVL18>: + 62: a829 j 7c <.L38> + +00000064 <.L4>: + 64: 0ff00593 li a1,255 + +00000068 <.LVL20>: + 68: 00b40a63 beq s0,a1,7c <.L38> + 6c: 040005b7 lui a1,0x4000 + 70: 8f4d or a4,a4,a1 + 72: 85b2 mv a1,a2 + +00000074 <.L8>: + 74: 466d li a2,27 + 76: 04b65c63 bge a2,a1,ce <.L9> + +0000007a <.LVL23>: + 7a: 0785 add a5,a5,1 + +0000007c <.L38>: + 7c: 0077f713 and a4,a5,7 + 80: c719 beqz a4,8e <.L39> + 82: 00f7f713 and a4,a5,15 + 86: 4611 li a2,4 + 88: 00c70363 beq a4,a2,8e <.L39> + 8c: 0791 add a5,a5,4 + +0000008e <.L39>: + 8e: 04000737 lui a4,0x4000 + 92: 8f7d and a4,a4,a5 + 94: 28070063 beqz a4,314 <.L40> + +00000098 <.LVL26>: + 98: 0405 add s0,s0,1 + +0000009a <.LVL27>: + 9a: 0ff00713 li a4,255 + 9e: 4481 li s1,0 + a0: 00e40863 beq s0,a4,b0 <.L18> + a4: 0037d493 srl s1,a5,0x3 + a8: 1f8007b7 lui a5,0x1f800 + +000000ac <.LVL28>: + ac: 17fd add a5,a5,-1 # 1f7fffff <.LLST20+0x1f7ff6b8> + ae: 8cfd and s1,s1,a5 + +000000b0 <.L18>: + b0: 045e sll s0,s0,0x17 + b2: 7f8007b7 lui a5,0x7f800 + b6: 04a6 sll s1,s1,0x9 + +000000b8 <.LVL30>: + b8: 80a5 srl s1,s1,0x9 + ba: 8c7d and s0,s0,a5 + bc: 8c45 or s0,s0,s1 + be: 01f69513 sll a0,a3,0x1f + +000000c2 <.LBE19>: + c2: 40b2 lw ra,12(sp) + c4: 8d41 or a0,a0,s0 + +000000c6 <.LVL32>: + c6: 4422 lw s0,8(sp) + c8: 4492 lw s1,4(sp) + ca: 0141 add sp,sp,16 + cc: 8082 ret + +000000ce <.L9>: + ce: 02000613 li a2,32 + d2: 8e0d sub a2,a2,a1 + d4: 00b75533 srl a0,a4,a1 + d8: 00c71733 sll a4,a4,a2 + +000000dc <.LVL34>: + dc: 00e03733 snez a4,a4 + +000000e0 <.LVL35>: + e0: 8f49 or a4,a4,a0 + +000000e2 <.LVL36>: + e2: 97ba add a5,a5,a4 + +000000e4 <.L10>: + e4: 04000737 lui a4,0x4000 + +000000e8 <.LVL38>: + e8: 8f7d and a4,a4,a5 + ea: db49 beqz a4,7c <.L38> + +000000ec <.LVL39>: + ec: 0405 add s0,s0,1 + +000000ee <.LVL40>: + ee: 0ff00713 li a4,255 + +000000f2 <.LBB21>: + f2: 4481 li s1,0 + +000000f4 <.LBB22>: + f4: fae40ee3 beq s0,a4,b0 <.L18> + +000000f8 <.L7>: + f8: 7e000737 lui a4,0x7e000 + fc: 0017f613 and a2,a5,1 + 100: 177d add a4,a4,-1 # 7dffffff <.LLST20+0x7dfff6b8> + 102: 8385 srl a5,a5,0x1 + 104: 8ff9 and a5,a5,a4 + 106: 8fd1 or a5,a5,a2 + 108: bf95 j 7c <.L38> + +0000010a <.L3>: + 10a: ce21 beqz a2,162 <.L11> + 10c: 40850633 sub a2,a0,s0 + +00000110 <.LVL43>: + 110: ec01 bnez s0,128 <.L12> + 112: 1e078963 beqz a5,304 <.L44> + 116: fff60593 add a1,a2,-1 + +0000011a <.LVL44>: + 11a: d595 beqz a1,46 <.L94> + 11c: 0ff00313 li t1,255 + 120: 00661c63 bne a2,t1,138 <.L14> + +00000124 <.L49>: + 124: 87ba mv a5,a4 + +00000126 <.LVL46>: + 126: bf25 j 5e <.L63> + +00000128 <.L12>: + 128: 0ff00593 li a1,255 + +0000012c <.LVL48>: + 12c: feb50ce3 beq a0,a1,124 <.L49> + 130: 040005b7 lui a1,0x4000 + 134: 8fcd or a5,a5,a1 + 136: 85b2 mv a1,a2 + +00000138 <.L14>: + 138: 466d li a2,27 + 13a: 00b65663 bge a2,a1,146 <.L15> + +0000013e <.LVL51>: + 13e: 00170793 add a5,a4,1 + +00000142 <.LBB24>: + 142: 842a mv s0,a0 + +00000144 <.LVL53>: + 144: bf25 j 7c <.L38> + +00000146 <.L15>: + 146: 02000613 li a2,32 + 14a: 8e0d sub a2,a2,a1 + 14c: 00b7d333 srl t1,a5,a1 + 150: 00c797b3 sll a5,a5,a2 + +00000154 <.LVL55>: + 154: 00f037b3 snez a5,a5 + +00000158 <.LVL56>: + 158: 00f367b3 or a5,t1,a5 + +0000015c <.LVL57>: + 15c: 97ba add a5,a5,a4 + +0000015e <.LBB26>: + 15e: 842a mv s0,a0 + +00000160 <.LBB27>: + 160: b751 j e4 <.L10> + +00000162 <.L11>: + 162: 00140613 add a2,s0,1 + +00000166 <.LVL61>: + 166: 0fe67593 and a1,a2,254 + +0000016a <.LVL62>: + 16a: e985 bnez a1,19a <.L16> + 16c: ec11 bnez s0,188 <.L17> + +0000016e <.LVL63>: + 16e: 18078d63 beqz a5,308 <.L48> + 172: d709 beqz a4,7c <.L38> + 174: 97ba add a5,a5,a4 + +00000176 <.LVL64>: + 176: 04000737 lui a4,0x4000 + +0000017a <.LVL65>: + 17a: 8f7d and a4,a4,a5 + 17c: d301 beqz a4,7c <.L38> + 17e: fc000737 lui a4,0xfc000 + 182: 177d add a4,a4,-1 # fbffffff <.LLST20+0xfbfff6b8> + 184: 8ff9 and a5,a5,a4 + +00000186 <.LVL66>: + 186: b5f1 j 52 <.L91> + +00000188 <.L17>: + 188: dfd1 beqz a5,124 <.L49> + +0000018a <.L34>: + 18a: ec070ae3 beqz a4,5e <.L63> + +0000018e <.L62>: + 18e: 4681 li a3,0 + +00000190 <.LBB30>: + 190: 0ff00413 li s0,255 + +00000194 <.LBB31>: + 194: 004004b7 lui s1,0x400 + 198: bf21 j b0 <.L18> + +0000019a <.L16>: + 19a: 0ff00593 li a1,255 + 19e: 18b60663 beq a2,a1,32a <.L51> + 1a2: 97ba add a5,a5,a4 + +000001a4 <.LVL72>: + 1a4: 8385 srl a5,a5,0x1 + +000001a6 <.L53>: + 1a6: 8432 mv s0,a2 + +000001a8 <.LVL74>: + 1a8: bdd1 j 7c <.L38> + +000001aa <.L2>: + 1aa: 06c05063 blez a2,20a <.L19> + +000001ae <.LVL76>: + 1ae: e529 bnez a0,1f8 <.L20> + 1b0: db7d beqz a4,1a6 <.L53> + 1b2: fff60593 add a1,a2,-1 + +000001b6 <.LVL77>: + 1b6: e581 bnez a1,1be <.L21> + 1b8: 8f99 sub a5,a5,a4 + +000001ba <.L88>: + 1ba: 4405 li s0,1 + +000001bc <.LBB36>: + 1bc: a02d j 1e6 <.L22> + +000001be <.L21>: + 1be: 0ff00513 li a0,255 + +000001c2 <.LVL81>: + 1c2: e8a60ee3 beq a2,a0,5e <.L63> + +000001c6 <.L23>: + 1c6: 456d li a0,27 + 1c8: 4605 li a2,1 + 1ca: 00b54d63 blt a0,a1,1e4 <.L24> + 1ce: 02000613 li a2,32 + 1d2: 8e0d sub a2,a2,a1 + 1d4: 00b75533 srl a0,a4,a1 + 1d8: 00c71733 sll a4,a4,a2 + +000001dc <.LVL83>: + 1dc: 00e03733 snez a4,a4 + 1e0: 00e56633 or a2,a0,a4 + +000001e4 <.L24>: + 1e4: 8f91 sub a5,a5,a2 + +000001e6 <.L22>: + 1e6: 040004b7 lui s1,0x4000 + 1ea: 0097f733 and a4,a5,s1 + 1ee: e80707e3 beqz a4,7c <.L38> + +000001f2 <.LBB13>: + 1f2: 14fd add s1,s1,-1 # 3ffffff <.LLST20+0x3fff6b8> + 1f4: 8cfd and s1,s1,a5 + +000001f6 <.LVL86>: + 1f6: a0e1 j 2be <.L36> + +000001f8 <.L20>: + 1f8: 0ff00593 li a1,255 + +000001fc <.LVL88>: + 1fc: e8b400e3 beq s0,a1,7c <.L38> + 200: 040005b7 lui a1,0x4000 + 204: 8f4d or a4,a4,a1 + 206: 85b2 mv a1,a2 + 208: bf7d j 1c6 <.L23> + +0000020a <.L19>: + 20a: c225 beqz a2,26a <.L25> + 20c: 408506b3 sub a3,a0,s0 + +00000210 <.LVL91>: + 210: e00d bnez s0,232 <.L26> + 212: cfed beqz a5,30c <.L56> + 214: fff68613 add a2,a3,-1 + +00000218 <.LVL92>: + 218: e609 bnez a2,222 <.L27> + 21a: 40f707b3 sub a5,a4,a5 + +0000021e <.LVL93>: + 21e: 86ae mv a3,a1 + 220: bf69 j 1ba <.L88> + +00000222 <.L27>: + 222: 0ff00313 li t1,255 + 226: 00669e63 bne a3,t1,242 <.L28> + +0000022a <.L58>: + 22a: 87ba mv a5,a4 + +0000022c <.LBB37>: + 22c: 0ff00413 li s0,255 + +00000230 <.LVL97>: + 230: a0c5 j 310 <.L90> + +00000232 <.L26>: + 232: 0ff00613 li a2,255 + 236: fec50ae3 beq a0,a2,22a <.L58> + 23a: 04000637 lui a2,0x4000 + 23e: 8fd1 or a5,a5,a2 + 240: 8636 mv a2,a3 + +00000242 <.L28>: + 242: 436d li t1,27 + 244: 4685 li a3,1 + 246: 00c34d63 blt t1,a2,260 <.L29> + 24a: 02000693 li a3,32 + 24e: 8e91 sub a3,a3,a2 + 250: 00c7d333 srl t1,a5,a2 + 254: 00d797b3 sll a5,a5,a3 + +00000258 <.LVL101>: + 258: 00f037b3 snez a5,a5 + 25c: 00f366b3 or a3,t1,a5 + +00000260 <.L29>: + 260: 40d707b3 sub a5,a4,a3 + +00000264 <.LBB38>: + 264: 842a mv s0,a0 + +00000266 <.LBB39>: + 266: 86ae mv a3,a1 + +00000268 <.LVL105>: + 268: bfbd j 1e6 <.L22> + +0000026a <.L25>: + 26a: 00140613 add a2,s0,1 + 26e: 0fe67613 and a2,a2,254 + 272: ee0d bnez a2,2ac <.L30> + 274: e40d bnez s0,29e <.L31> + +00000276 <.LVL107>: + 276: e789 bnez a5,280 <.L32> + +00000278 <.LVL108>: + 278: 87ba mv a5,a4 + +0000027a <.LVL109>: + 27a: eb59 bnez a4,310 <.L90> + +0000027c <.LBB40>: + 27c: 4481 li s1,0 + 27e: a831 j 29a <.L92> + +00000280 <.L32>: + 280: de070ee3 beqz a4,7c <.L38> + 284: 40e784b3 sub s1,a5,a4 + +00000288 <.LVL111>: + 288: 04000637 lui a2,0x4000 + 28c: 8e65 and a2,a2,s1 + 28e: 40f707b3 sub a5,a4,a5 + +00000292 <.LVL112>: + 292: ee3d bnez a2,310 <.L90> + 294: 87a6 mv a5,s1 + 296: de0493e3 bnez s1,7c <.L38> + +0000029a <.L92>: + 29a: 4681 li a3,0 + 29c: bd11 j b0 <.L18> + +0000029e <.L31>: + 29e: ee0796e3 bnez a5,18a <.L34> + 2a2: ee0706e3 beqz a4,18e <.L62> + 2a6: 87ba mv a5,a4 + +000002a8 <.LVL115>: + 2a8: 86ae mv a3,a1 + +000002aa <.LVL116>: + 2aa: bb55 j 5e <.L63> + +000002ac <.L30>: + 2ac: 40e784b3 sub s1,a5,a4 + +000002b0 <.LVL118>: + 2b0: 04000637 lui a2,0x4000 + 2b4: 8e65 and a2,a2,s1 + 2b6: ce15 beqz a2,2f2 <.L35> + 2b8: 40f704b3 sub s1,a4,a5 + +000002bc <.LVL119>: + 2bc: 86ae mv a3,a1 + +000002be <.L36>: + 2be: 8526 mv a0,s1 + 2c0: c036 sw a3,0(sp) + +000002c2 <.LVL121>: + 2c2: 00000097 auipc ra,0x0 + 2c6: 000080e7 jalr ra # 2c2 <.LVL121> + +000002ca <.LVL122>: + 2ca: 156d add a0,a0,-5 + 2cc: 4682 lw a3,0(sp) + 2ce: 00a494b3 sll s1,s1,a0 + 2d2: 02854363 blt a0,s0,2f8 <.L37> + 2d6: 8d01 sub a0,a0,s0 + +000002d8 <.LVL125>: + 2d8: 0505 add a0,a0,1 + +000002da <.LVL126>: + 2da: 02000713 li a4,32 + 2de: 8f09 sub a4,a4,a0 + 2e0: 00a4d7b3 srl a5,s1,a0 + 2e4: 00e494b3 sll s1,s1,a4 + +000002e8 <.LVL127>: + 2e8: 009034b3 snez s1,s1 + 2ec: 8fc5 or a5,a5,s1 + +000002ee <.LVL128>: + 2ee: 4401 li s0,0 + 2f0: b371 j 7c <.L38> + +000002f2 <.L35>: + 2f2: f4f1 bnez s1,2be <.L36> + 2f4: 4401 li s0,0 + +000002f6 <.LVL130>: + 2f6: b755 j 29a <.L92> + +000002f8 <.L37>: + 2f8: fc0007b7 lui a5,0xfc000 + 2fc: 17fd add a5,a5,-1 # fbffffff <.LLST20+0xfbfff6b8> + 2fe: 8c09 sub s0,s0,a0 + 300: 8fe5 and a5,a5,s1 + +00000302 <.LVL133>: + 302: bbad j 7c <.L38> + +00000304 <.L44>: + 304: 87ba mv a5,a4 + +00000306 <.LVL135>: + 306: b545 j 1a6 <.L53> + +00000308 <.L48>: + 308: 87ba mv a5,a4 + +0000030a <.LVL137>: + 30a: bb8d j 7c <.L38> + +0000030c <.L56>: + 30c: 87ba mv a5,a4 + +0000030e <.LBB42>: + 30e: 8436 mv s0,a3 + +00000310 <.L90>: + 310: 86ae mv a3,a1 + 312: b3ad j 7c <.L38> + +00000314 <.L40>: + 314: 0037d493 srl s1,a5,0x3 + +00000318 <.LVL142>: + 318: 0ff00793 li a5,255 + 31c: d8f41ae3 bne s0,a5,b0 <.L18> + 320: d80488e3 beqz s1,b0 <.L18> + 324: 004004b7 lui s1,0x400 + +00000328 <.LVL143>: + 328: bf8d j 29a <.L92> + +0000032a <.L51>: + 32a: 0ff00413 li s0,255 + +0000032e <.LBB46>: + 32e: 4481 li s1,0 + 330: b341 j b0 <.L18> + +divsf3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__divsf3>: + 0: fd810113 add sp,sp,-40 + 4: 01755693 srl a3,a0,0x17 + 8: ce26 sw s1,28(sp) + +0000000a <.LBB3>: + a: 00951793 sll a5,a0,0x9 + +0000000e <.LBE3>: + e: d206 sw ra,36(sp) + 10: d022 sw s0,32(sp) + 12: 0ff6f693 zext.b a3,a3 + +00000016 <.LBB4>: + 16: 83a5 srl a5,a5,0x9 + +00000018 <.LVL1>: + 18: 01f55493 srl s1,a0,0x1f + +0000001c <.LBE4>: + 1c: c2b5 beqz a3,80 <.L2> + 1e: 0ff00713 li a4,255 + 22: 08e68263 beq a3,a4,a6 <.L3> + +00000026 <.LVL3>: + 26: 078e sll a5,a5,0x3 + +00000028 <.LVL4>: + 28: 04000737 lui a4,0x4000 + 2c: 8fd9 or a5,a5,a4 + +0000002e <.LVL5>: + 2e: f8168693 add a3,a3,-127 + +00000032 <.LVL6>: + 32: 4301 li t1,0 + +00000034 <.L4>: + 34: 0175d613 srl a2,a1,0x17 + 38: 00959413 sll s0,a1,0x9 + 3c: 0ff67613 zext.b a2,a2 + 40: 8025 srl s0,s0,0x9 + +00000042 <.LVL8>: + 42: 81fd srl a1,a1,0x1f + +00000044 <.LBE5>: + 44: ca35 beqz a2,b8 <.L5> + 46: 0ff00713 li a4,255 + 4a: 08e60e63 beq a2,a4,e6 <.L6> + +0000004e <.LVL10>: + 4e: 040e sll s0,s0,0x3 + +00000050 <.LVL11>: + 50: 04000737 lui a4,0x4000 + 54: 8c59 or s0,s0,a4 + +00000056 <.LVL12>: + 56: f8160613 add a2,a2,-127 + +0000005a <.LVL13>: + 5a: 4501 li a0,0 + +0000005c <.L7>: + 5c: 8e91 sub a3,a3,a2 + +0000005e <.LVL15>: + 5e: 00231613 sll a2,t1,0x2 + +00000062 <.LVL16>: + 62: 8e49 or a2,a2,a0 + 64: 167d add a2,a2,-1 + 66: 42b9 li t0,14 + 68: 00b4c733 xor a4,s1,a1 + +0000006c <.LVL17>: + 6c: 0ac2e563 bltu t0,a2,116 <.L8> + 70: 000002b7 lui t0,0x0 + 74: 060a sll a2,a2,0x2 + 76: 00028293 mv t0,t0 + 7a: 9616 add a2,a2,t0 + 7c: 4210 lw a2,0(a2) + 7e: 8602 jr a2 + +00000080 <.L2>: + 80: cb8d beqz a5,b2 <.L30> + +00000082 <.LBB6>: + 82: 853e mv a0,a5 + +00000084 <.LVL19>: + 84: c22e sw a1,4(sp) + +00000086 <.LBB7>: + 86: c03e sw a5,0(sp) + 88: 00000097 auipc ra,0x0 + 8c: 000080e7 jalr ra # 88 <.LBB7+0x2> + +00000090 <.LVL20>: + 90: 4782 lw a5,0(sp) + 92: ffb50713 add a4,a0,-5 + 96: f8a00693 li a3,-118 + 9a: 4592 lw a1,4(sp) + 9c: 00e797b3 sll a5,a5,a4 + +000000a0 <.LVL21>: + a0: 8e89 sub a3,a3,a0 + +000000a2 <.LVL22>: + a2: 4301 li t1,0 + a4: bf41 j 34 <.L4> + +000000a6 <.L3>: + a6: 0ff00693 li a3,255 + +000000aa <.LBE8>: + aa: 430d li t1,3 + ac: f7c1 bnez a5,34 <.L4> + ae: 4309 li t1,2 + b0: b751 j 34 <.L4> + +000000b2 <.L30>: + b2: 4681 li a3,0 + +000000b4 <.LBE9>: + b4: 4305 li t1,1 + b6: bfbd j 34 <.L4> + +000000b8 <.L5>: + b8: cc0d beqz s0,f2 <.L32> + +000000ba <.LBB10>: + ba: 8522 mv a0,s0 + bc: c63e sw a5,12(sp) + be: c436 sw a3,8(sp) + c0: c21a sw t1,4(sp) + c2: c02e sw a1,0(sp) + +000000c4 <.LBB11>: + c4: 00000097 auipc ra,0x0 + c8: 000080e7 jalr ra # c4 <.LBB11> + +000000cc <.LVL28>: + cc: ffb50713 add a4,a0,-5 + d0: f8a00613 li a2,-118 + d4: 8e09 sub a2,a2,a0 + d6: 4582 lw a1,0(sp) + d8: 4312 lw t1,4(sp) + da: 46a2 lw a3,8(sp) + dc: 47b2 lw a5,12(sp) + de: 00e41433 sll s0,s0,a4 + +000000e2 <.LVL29>: + e2: 4501 li a0,0 + +000000e4 <.LVL30>: + e4: bfa5 j 5c <.L7> + +000000e6 <.L6>: + e6: 0ff00613 li a2,255 + +000000ea <.LBE12>: + ea: 450d li a0,3 + ec: f825 bnez s0,5c <.L7> + ee: 4509 li a0,2 + f0: b7b5 j 5c <.L7> + +000000f2 <.L32>: + f2: 4601 li a2,0 + +000000f4 <.LBE13>: + f4: 4505 li a0,1 + f6: b79d j 5c <.L7> + +000000f8 <.L11>: + f8: 8726 mv a4,s1 + +000000fa <.LVL36>: + fa: 843e mv s0,a5 + +000000fc <.LBE14>: + fc: 851a mv a0,t1 + +000000fe <.L15>: + fe: 4789 li a5,2 + +00000100 <.LVL39>: + 100: 1af50d63 beq a0,a5,2ba <.L40> + 104: 478d li a5,3 + 106: 1af50463 beq a0,a5,2ae <.L38> + 10a: 4785 li a5,1 + 10c: 0ef51e63 bne a0,a5,208 <.L24> + +00000110 <.L39>: + 110: 4781 li a5,0 + +00000112 <.L54>: + 112: 4501 li a0,0 + 114: a23d j 242 <.L9> + +00000116 <.L8>: + 116: 00541613 sll a2,s0,0x5 + +0000011a <.LVL43>: + 11a: 1487f063 bgeu a5,s0,25a <.L16> + 11e: 16fd add a3,a3,-1 + +00000120 <.LVL44>: + 120: 4381 li t2,0 + +00000122 <.L17>: + 122: c83a sw a4,16(sp) + +00000124 <.LBB16>: + 124: 01065713 srl a4,a2,0x10 + +00000128 <.LVL47>: + 128: c03a sw a4,0(sp) + +0000012a <.LVL48>: + 12a: 4582 lw a1,0(sp) + +0000012c <.LVL49>: + 12c: 6441 lui s0,0x10 + +0000012e <.LVL50>: + 12e: 147d add s0,s0,-1 # ffff <.LLST37+0xf84a> + 130: 00867733 and a4,a2,s0 + +00000134 <.LVL51>: + 134: 853e mv a0,a5 + +00000136 <.LVL52>: + 136: cc36 sw a3,24(sp) + +00000138 <.LVL53>: + 138: ca1e sw t2,20(sp) + +0000013a <.LVL54>: + 13a: c632 sw a2,12(sp) + 13c: c23a sw a4,4(sp) + +0000013e <.LVL55>: + 13e: c43e sw a5,8(sp) + 140: 00000097 auipc ra,0x0 + 144: 000080e7 jalr ra # 140 <.LVL55+0x2> + +00000148 <.LVL56>: + 148: 85aa mv a1,a0 + 14a: 842a mv s0,a0 + +0000014c <.LVL57>: + 14c: 4512 lw a0,4(sp) + 14e: 00000097 auipc ra,0x0 + 152: 000080e7 jalr ra # 14e <.LVL57+0x2> + +00000156 <.LVL58>: + 156: 47a2 lw a5,8(sp) + 158: 4582 lw a1,0(sp) + 15a: 84aa mv s1,a0 + +0000015c <.LVL59>: + 15c: 853e mv a0,a5 + 15e: 00000097 auipc ra,0x0 + 162: 000080e7 jalr ra # 15e <.LVL59+0x2> + +00000166 <.LVL60>: + 166: 43d2 lw t2,20(sp) + 168: 0542 sll a0,a0,0x10 + 16a: 4632 lw a2,12(sp) + 16c: 0103d593 srl a1,t2,0x10 + 170: 8dc9 or a1,a1,a0 + +00000172 <.LVL61>: + 172: 4742 lw a4,16(sp) + 174: 46e2 lw a3,24(sp) + 176: 87a2 mv a5,s0 + 178: 0095fc63 bgeu a1,s1,190 <.L18> + +0000017c <.LVL62>: + 17c: 95b2 add a1,a1,a2 + +0000017e <.LVL63>: + 17e: fff40793 add a5,s0,-1 + +00000182 <.LVL64>: + 182: 00c5e763 bltu a1,a2,190 <.L18> + 186: 0095f563 bgeu a1,s1,190 <.L18> + 18a: ffe40793 add a5,s0,-2 + 18e: 95b2 add a1,a1,a2 + +00000190 <.L18>: + 190: c83e sw a5,16(sp) + 192: 409587b3 sub a5,a1,s1 + +00000196 <.LVL67>: + 196: 4582 lw a1,0(sp) + +00000198 <.LVL68>: + 198: 853e mv a0,a5 + 19a: 843e mv s0,a5 + 19c: ca36 sw a3,20(sp) + 19e: c63a sw a4,12(sp) + +000001a0 <.LVL69>: + 1a0: cc32 sw a2,24(sp) + 1a2: 00000097 auipc ra,0x0 + 1a6: 000080e7 jalr ra # 1a2 <.LVL69+0x2> + +000001aa <.LVL70>: + 1aa: 85aa mv a1,a0 + 1ac: c42a sw a0,8(sp) + +000001ae <.LVL71>: + 1ae: 4512 lw a0,4(sp) + +000001b0 <.LVL72>: + 1b0: 00000097 auipc ra,0x0 + 1b4: 000080e7 jalr ra # 1b0 <.LVL72> + +000001b8 <.LVL73>: + 1b8: 4582 lw a1,0(sp) + 1ba: 84aa mv s1,a0 + 1bc: 8522 mv a0,s0 + 1be: 00000097 auipc ra,0x0 + 1c2: 000080e7 jalr ra # 1be <.LVL73+0x6> + +000001c6 <.LVL75>: + 1c6: 43a2 lw t2,8(sp) + 1c8: 01051313 sll t1,a0,0x10 + +000001cc <.LVL76>: + 1cc: 4732 lw a4,12(sp) + 1ce: 47c2 lw a5,16(sp) + 1d0: 46d2 lw a3,20(sp) + 1d2: 859e mv a1,t2 + 1d4: 02937163 bgeu t1,s1,1f6 <.L21> + +000001d8 <.LVL77>: + 1d8: 4662 lw a2,24(sp) + 1da: fff38593 add a1,t2,-1 + +000001de <.LVL78>: + 1de: 00c30533 add a0,t1,a2 + 1e2: 00653433 sltu s0,a0,t1 + +000001e6 <.LVL79>: + 1e6: 832a mv t1,a0 + 1e8: e419 bnez s0,1f6 <.L21> + +000001ea <.LVL81>: + 1ea: 00957663 bgeu a0,s1,1f6 <.L21> + 1ee: ffe38593 add a1,t2,-2 + 1f2: 00c50333 add t1,a0,a2 + +000001f6 <.L21>: + 1f6: 01079413 sll s0,a5,0x10 + +000001fa <.LBE17>: + 1fa: 40930333 sub t1,t1,s1 + +000001fe <.LBB18>: + 1fe: 8c4d or s0,s0,a1 + +00000200 <.LBE18>: + 200: 00603333 snez t1,t1 + +00000204 <.LVL86>: + 204: 00646433 or s0,s0,t1 + +00000208 <.L24>: + 208: 07f68513 add a0,a3,127 + +0000020c <.LVL88>: + 20c: 04a05d63 blez a0,266 <.L25> + 210: 00747793 and a5,s0,7 + 214: c799 beqz a5,222 <.L26> + 216: 00f47793 and a5,s0,15 + 21a: 4611 li a2,4 + 21c: 00c78363 beq a5,a2,222 <.L26> + 220: 0411 add s0,s0,4 + +00000222 <.L26>: + 222: 080007b7 lui a5,0x8000 + 226: 8fe1 and a5,a5,s0 + 228: c799 beqz a5,236 <.L27> + 22a: f80007b7 lui a5,0xf8000 + 22e: 17fd add a5,a5,-1 # f7ffffff <.LLST37+0xf7fff84a> + 230: 8c7d and s0,s0,a5 + 232: 08068513 add a0,a3,128 + +00000236 <.L27>: + 236: 0fe00793 li a5,254 + 23a: 08a7c063 blt a5,a0,2ba <.L40> + 23e: 00345793 srl a5,s0,0x3 + +00000242 <.L9>: + 242: 5092 lw ra,36(sp) + 244: 5402 lw s0,32(sp) + +00000246 <.LBB20>: + 246: 07a6 sll a5,a5,0x9 + +00000248 <.LVL93>: + 248: 055e sll a0,a0,0x17 + +0000024a <.LVL94>: + 24a: 83a5 srl a5,a5,0x9 + 24c: 8d5d or a0,a0,a5 + 24e: 077e sll a4,a4,0x1f + +00000250 <.LBE20>: + 250: 44f2 lw s1,28(sp) + 252: 8d59 or a0,a0,a4 + +00000254 <.LVL96>: + 254: 02810113 add sp,sp,40 + 258: 8082 ret + +0000025a <.L16>: + 25a: 01f79393 sll t2,a5,0x1f + +0000025e <.LVL98>: + 25e: 8385 srl a5,a5,0x1 + +00000260 <.LVL99>: + 260: b5c9 j 122 <.L17> + +00000262 <.L12>: + 262: 872e mv a4,a1 + +00000264 <.LBE22>: + 264: bd69 j fe <.L15> + +00000266 <.L25>: + 266: 4605 li a2,1 + 268: c519 beqz a0,276 <.L28> + 26a: 8e09 sub a2,a2,a0 + +0000026c <.LVL103>: + 26c: 45ed li a1,27 + 26e: 4781 li a5,0 + 270: 4501 li a0,0 + 272: fcc5c8e3 blt a1,a2,242 <.L9> + +00000276 <.L28>: + 276: 09e68693 add a3,a3,158 + 27a: 00c45633 srl a2,s0,a2 + 27e: 00d41433 sll s0,s0,a3 + +00000282 <.LVL105>: + 282: 00803433 snez s0,s0 + 286: 008667b3 or a5,a2,s0 + +0000028a <.LVL106>: + 28a: 0077f693 and a3,a5,7 + 28e: c699 beqz a3,29c <.L29> + 290: 00f7f693 and a3,a5,15 + 294: 4611 li a2,4 + 296: 00c68363 beq a3,a2,29c <.L29> + 29a: 0791 add a5,a5,4 + +0000029c <.L29>: + 29c: 040006b7 lui a3,0x4000 + 2a0: 8efd and a3,a3,a5 + 2a2: 838d srl a5,a5,0x3 + +000002a4 <.LVL108>: + 2a4: e60687e3 beqz a3,112 <.L54> + 2a8: 4781 li a5,0 + 2aa: 4505 li a0,1 + 2ac: bf59 j 242 <.L9> + +000002ae <.L38>: + 2ae: 004007b7 lui a5,0x400 + 2b2: 0ff00513 li a0,255 + 2b6: 4701 li a4,0 + +000002b8 <.LVL110>: + 2b8: b769 j 242 <.L9> + +000002ba <.L40>: + 2ba: 4781 li a5,0 + 2bc: 0ff00513 li a0,255 + 2c0: b749 j 242 <.L9> + +eqsf2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__eqsf2>: + 0: 01755613 srl a2,a0,0x17 + 4: 008007b7 lui a5,0x800 + 8: 17fd add a5,a5,-1 # 7fffff <.LASF9+0x7ffe6f> + +0000000a <.LBB3>: + a: 0175d713 srl a4,a1,0x17 + +0000000e <.LBB4>: + e: 0ff67613 zext.b a2,a2 + +00000012 <.LBE4>: + 12: 0ff00293 li t0,255 + +00000016 <.LBB5>: + 16: 00a7f333 and t1,a5,a0 + 1a: 01f55693 srl a3,a0,0x1f + +0000001e <.LBB6>: + 1e: 8fed and a5,a5,a1 + +00000020 <.LVL3>: + 20: 0ff77713 zext.b a4,a4 + 24: 81fd srl a1,a1,0x1f + +00000026 <.LBE6>: + 26: 4505 li a0,1 + +00000028 <.LVL6>: + 28: 00560563 beq a2,t0,32 <.L2> + 2c: 00571b63 bne a4,t0,42 <.L12> + 30: 8082 ret + +00000032 <.L2>: + 32: 02c71463 bne a4,a2,5a <.L1> + 36: 00f367b3 or a5,t1,a5 + +0000003a <.LVL7>: + 3a: e385 bnez a5,5a <.L1> + 3c: 00b6c533 xor a0,a3,a1 + 40: 8082 ret + +00000042 <.L12>: + 42: 4505 li a0,1 + 44: 00e61b63 bne a2,a4,5a <.L1> + 48: 00f31963 bne t1,a5,5a <.L1> + 4c: 00b68663 beq a3,a1,58 <.L10> + 50: e609 bnez a2,5a <.L1> + 52: 00603533 snez a0,t1 + 56: 8082 ret + +00000058 <.L10>: + 58: 4501 li a0,0 + +0000005a <.L1>: + 5a: 8082 ret + +gesf2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__gesf2>: + 0: 00800737 lui a4,0x800 + 4: 177d add a4,a4,-1 # 7fffff <.LASF19+0x7ffe4f> + 6: 01755693 srl a3,a0,0x17 + a: 00a77633 and a2,a4,a0 + e: 01f55793 srl a5,a0,0x1f + 12: 0ff6f693 zext.b a3,a3 + +00000016 <.LBB3>: + 16: 0175d513 srl a0,a1,0x17 + +0000001a <.LBE3>: + 1a: 0ff00313 li t1,255 + +0000001e <.LBB4>: + 1e: 8f6d and a4,a4,a1 + 20: 0ff57513 zext.b a0,a0 + +00000024 <.LVL5>: + 24: 81fd srl a1,a1,0x1f + +00000026 <.LBE4>: + 26: 00669f63 bne a3,t1,44 <.L2> + 2a: e225 bnez a2,8a <.L22> + 2c: 00d50663 beq a0,a3,38 <.L4> + +00000030 <.L62>: + 30: 4505 li a0,1 + 32: c7b1 beqz a5,7e <.L1> + 34: 557d li a0,-1 + 36: 8082 ret + +00000038 <.L4>: + 38: 5579 li a0,-2 + +0000003a <.LVL9>: + 3a: e331 bnez a4,7e <.L1> + +0000003c <.LBB6>: + 3c: feb79ae3 bne a5,a1,30 <.L62> + 40: 4501 li a0,0 + 42: 8082 ret + +00000044 <.L2>: + 44: 00651c63 bne a0,t1,5c <.L8> + 48: 5579 li a0,-2 + +0000004a <.LVL11>: + 4a: eb15 bnez a4,7e <.L1> + +0000004c <.LBB7>: + 4c: e291 bnez a3,50 <.L9> + +0000004e <.L60>: + 4e: ca15 beqz a2,82 <.L10> + +00000050 <.L9>: + 50: feb790e3 bne a5,a1,30 <.L62> + +00000054 <.L66>: + 54: 557d li a0,-1 + 56: c785 beqz a5,7e <.L1> + 58: 853e mv a0,a5 + 5a: 8082 ret + +0000005c <.L8>: + 5c: ce91 beqz a3,78 <.L12> + +0000005e <.LVL16>: + 5e: d969 beqz a0,30 <.L62> + +00000060 <.LVL17>: + 60: fcb798e3 bne a5,a1,30 <.L62> + 64: fcd546e3 blt a0,a3,30 <.L62> + 68: fea6c6e3 blt a3,a0,54 <.L66> + +0000006c <.L19>: + 6c: fcc762e3 bltu a4,a2,30 <.L62> + 70: 4501 li a0,0 + +00000072 <.LVL18>: + 72: 00e67663 bgeu a2,a4,7e <.L1> + 76: bff9 j 54 <.L66> + +00000078 <.L12>: + 78: f979 bnez a0,4e <.L60> + 7a: e319 bnez a4,80 <.L15> + +0000007c <.LVL20>: + 7c: fa55 bnez a2,30 <.L62> + +0000007e <.L1>: + 7e: 8082 ret + +00000080 <.L15>: + 80: e619 bnez a2,8e <.L16> + +00000082 <.L10>: + 82: 557d li a0,-1 + 84: dded beqz a1,7e <.L1> + 86: 852e mv a0,a1 + 88: 8082 ret + +0000008a <.L22>: + 8a: 5579 li a0,-2 + +0000008c <.LVL25>: + 8c: 8082 ret + +0000008e <.L16>: + 8e: fcb78fe3 beq a5,a1,6c <.L19> + 92: bf79 j 30 <.L62> + +lesf2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__lesf2>: + 0: 00800737 lui a4,0x800 + 4: 177d add a4,a4,-1 # 7fffff <.LASF19+0x7ffe4f> + 6: 01755693 srl a3,a0,0x17 + a: 00a77633 and a2,a4,a0 + e: 01f55793 srl a5,a0,0x1f + 12: 0ff6f693 zext.b a3,a3 + +00000016 <.LBB3>: + 16: 0175d513 srl a0,a1,0x17 + +0000001a <.LBE3>: + 1a: 0ff00313 li t1,255 + +0000001e <.LBB4>: + 1e: 8f6d and a4,a4,a1 + 20: 0ff57513 zext.b a0,a0 + +00000024 <.LVL5>: + 24: 81fd srl a1,a1,0x1f + +00000026 <.LBE4>: + 26: 00669f63 bne a3,t1,44 <.L2> + 2a: e225 bnez a2,8a <.L22> + 2c: 00d50663 beq a0,a3,38 <.L4> + +00000030 <.L62>: + 30: 4505 li a0,1 + 32: c7b1 beqz a5,7e <.L1> + 34: 557d li a0,-1 + 36: 8082 ret + +00000038 <.L4>: + 38: 4509 li a0,2 + +0000003a <.LVL9>: + 3a: e331 bnez a4,7e <.L1> + +0000003c <.LBB6>: + 3c: feb79ae3 bne a5,a1,30 <.L62> + 40: 4501 li a0,0 + 42: 8082 ret + +00000044 <.L2>: + 44: 00651c63 bne a0,t1,5c <.L8> + 48: 4509 li a0,2 + +0000004a <.LVL11>: + 4a: eb15 bnez a4,7e <.L1> + +0000004c <.LBB7>: + 4c: e291 bnez a3,50 <.L9> + +0000004e <.L60>: + 4e: ca15 beqz a2,82 <.L10> + +00000050 <.L9>: + 50: feb790e3 bne a5,a1,30 <.L62> + +00000054 <.L66>: + 54: 557d li a0,-1 + 56: c785 beqz a5,7e <.L1> + 58: 853e mv a0,a5 + 5a: 8082 ret + +0000005c <.L8>: + 5c: ce91 beqz a3,78 <.L12> + +0000005e <.LVL16>: + 5e: d969 beqz a0,30 <.L62> + +00000060 <.LVL17>: + 60: fcb798e3 bne a5,a1,30 <.L62> + 64: fcd546e3 blt a0,a3,30 <.L62> + 68: fea6c6e3 blt a3,a0,54 <.L66> + +0000006c <.L19>: + 6c: fcc762e3 bltu a4,a2,30 <.L62> + 70: 4501 li a0,0 + +00000072 <.LVL18>: + 72: 00e67663 bgeu a2,a4,7e <.L1> + 76: bff9 j 54 <.L66> + +00000078 <.L12>: + 78: f979 bnez a0,4e <.L60> + 7a: e319 bnez a4,80 <.L15> + +0000007c <.LVL20>: + 7c: fa55 bnez a2,30 <.L62> + +0000007e <.L1>: + 7e: 8082 ret + +00000080 <.L15>: + 80: e619 bnez a2,8e <.L16> + +00000082 <.L10>: + 82: 557d li a0,-1 + 84: dded beqz a1,7e <.L1> + 86: 852e mv a0,a1 + 88: 8082 ret + +0000008a <.L22>: + 8a: 4509 li a0,2 + +0000008c <.LVL25>: + 8c: 8082 ret + +0000008e <.L16>: + 8e: fcb78fe3 beq a5,a1,6c <.L19> + 92: bf79 j 30 <.L62> + +mulsf3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__mulsf3>: + 0: 1111 add sp,sp,-28 + 2: 01755293 srl t0,a0,0x17 + 6: ca22 sw s0,20(sp) + 8: c826 sw s1,16(sp) + +0000000a <.LBB3>: + a: 00951713 sll a4,a0,0x9 + +0000000e <.LBE3>: + e: cc06 sw ra,24(sp) + 10: 0ff2f293 zext.b t0,t0 + 14: 84ae mv s1,a1 + +00000016 <.LBB4>: + 16: 8325 srl a4,a4,0x9 + +00000018 <.LVL1>: + 18: 01f55413 srl s0,a0,0x1f + +0000001c <.LBE4>: + 1c: 14028763 beqz t0,16a <.L2> + 20: 0ff00793 li a5,255 + 24: 16f28463 beq t0,a5,18c <.L3> + +00000028 <.LVL3>: + 28: 070e sll a4,a4,0x3 + +0000002a <.LVL4>: + 2a: 040007b7 lui a5,0x4000 + 2e: 8f5d or a4,a4,a5 + +00000030 <.LVL5>: + 30: f8128293 add t0,t0,-127 + +00000034 <.L47>: + 34: 4601 li a2,0 + +00000036 <.L4>: + 36: 0174d693 srl a3,s1,0x17 + 3a: 00949793 sll a5,s1,0x9 + 3e: 0ff6f693 zext.b a3,a3 + 42: 83a5 srl a5,a5,0x9 + +00000044 <.LVL8>: + 44: 80fd srl s1,s1,0x1f + +00000046 <.LBE6>: + 46: 14068d63 beqz a3,1a0 <.L5> + 4a: 0ff00593 li a1,255 + 4e: 18b68063 beq a3,a1,1ce <.L6> + +00000052 <.LVL10>: + 52: 040005b7 lui a1,0x4000 + 56: 078e sll a5,a5,0x3 + +00000058 <.LVL11>: + 58: 8fcd or a5,a5,a1 + +0000005a <.LVL12>: + 5a: f8168693 add a3,a3,-127 + +0000005e <.LVL13>: + 5e: 4581 li a1,0 + +00000060 <.L7>: + 60: 9696 add a3,a3,t0 + +00000062 <.LVL15>: + 62: c036 sw a3,0(sp) + 64: 00168293 add t0,a3,1 + +00000068 <.LVL16>: + 68: 00261693 sll a3,a2,0x2 + 6c: 8ecd or a3,a3,a1 + 6e: 4529 li a0,10 + 70: 00944333 xor t1,s0,s1 + +00000074 <.LVL17>: + 74: 1ad54163 blt a0,a3,216 <.L8> + 78: 4509 li a0,2 + 7a: 16d54463 blt a0,a3,1e2 <.L9> + 7e: 16fd add a3,a3,-1 + 80: 4605 li a2,1 + +00000082 <.LVL18>: + 82: 16d67e63 bgeu a2,a3,1fe <.L11> + +00000086 <.L10>: + 86: 64c1 lui s1,0x10 + +00000088 <.LVL20>: + 88: 01075693 srl a3,a4,0x10 + 8c: fff48393 add t2,s1,-1 # ffff <.LLST34+0xf9c9> + 90: c236 sw a3,4(sp) + +00000092 <.LVL21>: + 92: 00777733 and a4,a4,t2 + +00000096 <.LVL22>: + 96: 0107d693 srl a3,a5,0x10 + 9a: 0077f7b3 and a5,a5,t2 + +0000009e <.LVL23>: + 9e: c436 sw a3,8(sp) + +000000a0 <.LBB9>: + a0: 853a mv a0,a4 + a2: 85be mv a1,a5 + +000000a4 <.LVL25>: + a4: 00000097 auipc ra,0x0 + a8: 000080e7 jalr ra # a4 <.LVL25> + ac: 842a mv s0,a0 + +000000ae <.LBB10>: + ae: 45a2 lw a1,8(sp) + b0: 853a mv a0,a4 + b2: 00000097 auipc ra,0x0 + b6: 000080e7 jalr ra # b2 <.LBB10+0x4> + ba: 872a mv a4,a0 + +000000bc <.LBB11>: + bc: 85be mv a1,a5 + be: 4512 lw a0,4(sp) + +000000c0 <.LVL28>: + c0: 00000097 auipc ra,0x0 + c4: 000080e7 jalr ra # c0 <.LVL28> + c8: 87aa mv a5,a0 + +000000ca <.LBB12>: + ca: 45a2 lw a1,8(sp) + cc: 4512 lw a0,4(sp) + +000000ce <.LVL30>: + ce: 00000097 auipc ra,0x0 + d2: 000080e7 jalr ra # ce <.LVL30> + +000000d6 <.LBE12>: + d6: 01045693 srl a3,s0,0x10 + da: 973e add a4,a4,a5 + +000000dc <.LVL32>: + dc: 9736 add a4,a4,a3 + +000000de <.LVL33>: + de: 00f77363 bgeu a4,a5,e4 <.L15> + e2: 9526 add a0,a0,s1 + +000000e4 <.L15>: + e4: 007777b3 and a5,a4,t2 + +000000e8 <.LVL35>: + e8: 007476b3 and a3,s0,t2 + ec: 07c2 sll a5,a5,0x10 + ee: 97b6 add a5,a5,a3 + +000000f0 <.LBE8>: + f0: 00679693 sll a3,a5,0x6 + f4: 00d036b3 snez a3,a3 + f8: 83e9 srl a5,a5,0x1a + +000000fa <.LVL37>: + fa: 8edd or a3,a3,a5 + +000000fc <.LBB14>: + fc: 01075793 srl a5,a4,0x10 + 100: 97aa add a5,a5,a0 + +00000102 <.LBE14>: + 102: 079a sll a5,a5,0x6 + +00000104 <.LVL39>: + 104: 8fd5 or a5,a5,a3 + +00000106 <.LBE7>: + 106: 08000737 lui a4,0x8000 + +0000010a <.LVL41>: + 10a: 8f7d and a4,a4,a5 + 10c: 10070f63 beqz a4,22a <.L29> + 110: 0017d713 srl a4,a5,0x1 + 114: 8b85 and a5,a5,1 + +00000116 <.LVL42>: + 116: 8fd9 or a5,a5,a4 + +00000118 <.L16>: + 118: 07f28513 add a0,t0,127 + +0000011c <.LVL44>: + 11c: 10a05963 blez a0,22e <.L17> + 120: 0077f713 and a4,a5,7 + 124: c719 beqz a4,132 <.L18> + 126: 00f7f713 and a4,a5,15 + 12a: 4691 li a3,4 + 12c: 00d70363 beq a4,a3,132 <.L18> + 130: 0791 add a5,a5,4 # 4000004 <.LLST34+0x3fff9ce> + +00000132 <.L18>: + 132: 08000737 lui a4,0x8000 + 136: 8f7d and a4,a4,a5 + 138: c719 beqz a4,146 <.L19> + 13a: f8000737 lui a4,0xf8000 + 13e: 177d add a4,a4,-1 # f7ffffff <.LLST34+0xf7fff9c9> + 140: 8ff9 and a5,a5,a4 + 142: 08028513 add a0,t0,128 + +00000146 <.L19>: + 146: 0fe00713 li a4,254 + 14a: 12a74b63 blt a4,a0,280 <.L33> + 14e: 0037d713 srl a4,a5,0x3 + +00000152 <.L12>: + 152: 40e2 lw ra,24(sp) + 154: 4452 lw s0,20(sp) + +00000156 <.LBB17>: + 156: 0726 sll a4,a4,0x9 + +00000158 <.LVL49>: + 158: 055e sll a0,a0,0x17 + +0000015a <.LVL50>: + 15a: 8325 srl a4,a4,0x9 + 15c: 8d59 or a0,a0,a4 + 15e: 037e sll t1,t1,0x1f + +00000160 <.LBE17>: + 160: 44c2 lw s1,16(sp) + 162: 00656533 or a0,a0,t1 + +00000166 <.LVL52>: + 166: 0171 add sp,sp,28 + 168: 8082 ret + +0000016a <.L2>: + 16a: cb05 beqz a4,19a <.L22> + +0000016c <.LBB18>: + 16c: 853a mv a0,a4 + +0000016e <.LVL54>: + 16e: c03a sw a4,0(sp) + 170: 00000097 auipc ra,0x0 + 174: 000080e7 jalr ra # 170 <.LVL54+0x2> + +00000178 <.LVL55>: + 178: 4702 lw a4,0(sp) + 17a: ffb50793 add a5,a0,-5 + 17e: f8a00293 li t0,-118 + 182: 00f71733 sll a4,a4,a5 + +00000186 <.LVL56>: + 186: 40a282b3 sub t0,t0,a0 + 18a: b56d j 34 <.L47> + +0000018c <.L3>: + 18c: 0ff00293 li t0,255 + +00000190 <.LBE19>: + 190: 460d li a2,3 + 192: ea0712e3 bnez a4,36 <.L4> + 196: 4609 li a2,2 + 198: bd79 j 36 <.L4> + +0000019a <.L22>: + 19a: 4281 li t0,0 + +0000019c <.LBE20>: + 19c: 4605 li a2,1 + 19e: bd61 j 36 <.L4> + +000001a0 <.L5>: + 1a0: cf95 beqz a5,1dc <.L24> + +000001a2 <.LBB21>: + 1a2: 853e mv a0,a5 + 1a4: c63a sw a4,12(sp) + 1a6: c416 sw t0,8(sp) + 1a8: c232 sw a2,4(sp) + +000001aa <.LBB22>: + 1aa: c03e sw a5,0(sp) + 1ac: 00000097 auipc ra,0x0 + 1b0: 000080e7 jalr ra # 1ac <.LBB22+0x2> + +000001b4 <.LVL62>: + 1b4: 4782 lw a5,0(sp) + 1b6: ffb50693 add a3,a0,-5 + 1ba: 4612 lw a2,4(sp) + 1bc: 00d797b3 sll a5,a5,a3 + +000001c0 <.LVL63>: + 1c0: f8a00693 li a3,-118 + 1c4: 42a2 lw t0,8(sp) + 1c6: 4732 lw a4,12(sp) + 1c8: 8e89 sub a3,a3,a0 + +000001ca <.LVL64>: + 1ca: 4581 li a1,0 + 1cc: bd51 j 60 <.L7> + +000001ce <.L6>: + 1ce: 0ff00693 li a3,255 + +000001d2 <.LBE23>: + 1d2: 458d li a1,3 + 1d4: e80796e3 bnez a5,60 <.L7> + 1d8: 4589 li a1,2 + 1da: b559 j 60 <.L7> + +000001dc <.L24>: + 1dc: 4681 li a3,0 + +000001de <.LBE24>: + 1de: 4585 li a1,1 + 1e0: b541 j 60 <.L7> + +000001e2 <.L9>: + 1e2: 4505 li a0,1 + 1e4: 00d516b3 sll a3,a0,a3 + 1e8: 5306f513 and a0,a3,1328 + 1ec: ed05 bnez a0,224 <.L26> + 1ee: 2406f613 and a2,a3,576 + +000001f2 <.LVL70>: + 1f2: e249 bnez a2,274 <.L31> + 1f4: 0886f693 and a3,a3,136 + 1f8: e80687e3 beqz a3,86 <.L10> + +000001fc <.L13>: + 1fc: 8326 mv t1,s1 + +000001fe <.L11>: + 1fe: 4709 li a4,2 + +00000200 <.LVL73>: + 200: 08e58063 beq a1,a4,280 <.L33> + 204: 470d li a4,3 + 206: 06e58763 beq a1,a4,274 <.L31> + 20a: 4705 li a4,1 + 20c: f0e596e3 bne a1,a4,118 <.L16> + 210: 4701 li a4,0 + +00000212 <.L48>: + 212: 4501 li a0,0 + 214: bf3d j 152 <.L12> + +00000216 <.L8>: + 216: 453d li a0,15 + 218: 04a68e63 beq a3,a0,274 <.L31> + 21c: 452d li a0,11 + +0000021e <.LBB26>: + 21e: 8322 mv t1,s0 + +00000220 <.LBE26>: + 220: fca68ee3 beq a3,a0,1fc <.L13> + +00000224 <.L26>: + 224: 87ba mv a5,a4 + +00000226 <.LVL77>: + 226: 85b2 mv a1,a2 + +00000228 <.LVL78>: + 228: bfd9 j 1fe <.L11> + +0000022a <.L29>: + 22a: 4282 lw t0,0(sp) + +0000022c <.LVL80>: + 22c: b5f5 j 118 <.L16> + +0000022e <.L17>: + 22e: 4685 li a3,1 + 230: c519 beqz a0,23e <.L20> + 232: 8e89 sub a3,a3,a0 + +00000234 <.LVL82>: + 234: 466d li a2,27 + 236: 4701 li a4,0 + 238: 4501 li a0,0 + 23a: f0d64ce3 blt a2,a3,152 <.L12> + +0000023e <.L20>: + 23e: 09e28293 add t0,t0,158 + 242: 00d7d6b3 srl a3,a5,a3 + 246: 005797b3 sll a5,a5,t0 + 24a: 00f037b3 snez a5,a5 + 24e: 00f6e733 or a4,a3,a5 + +00000252 <.LVL84>: + 252: 00777793 and a5,a4,7 + 256: c799 beqz a5,264 <.L21> + 258: 00f77793 and a5,a4,15 + 25c: 4691 li a3,4 + 25e: 00d78363 beq a5,a3,264 <.L21> + 262: 0711 add a4,a4,4 + +00000264 <.L21>: + 264: 040007b7 lui a5,0x4000 + 268: 8ff9 and a5,a5,a4 + 26a: 830d srl a4,a4,0x3 + +0000026c <.LVL86>: + 26c: d3dd beqz a5,212 <.L48> + 26e: 4701 li a4,0 + 270: 4505 li a0,1 + 272: b5c5 j 152 <.L12> + +00000274 <.L31>: + 274: 00400737 lui a4,0x400 + 278: 0ff00513 li a0,255 + 27c: 4301 li t1,0 + +0000027e <.LVL88>: + 27e: bdd1 j 152 <.L12> + +00000280 <.L33>: + 280: 4701 li a4,0 + 282: 0ff00513 li a0,255 + 286: b5f1 j 152 <.L12> + +negsf2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__negsf2>: + 0: 00951713 sll a4,a0,0x9 + 4: 01f55793 srl a5,a0,0x1f + +00000008 <.LBB3>: + 8: 7f8006b7 lui a3,0x7f800 + +0000000c <.LBB4>: + c: 8325 srl a4,a4,0x9 + +0000000e <.LBB5>: + e: 8d75 and a0,a0,a3 + +00000010 <.LVL2>: + 10: 0017c793 xor a5,a5,1 + +00000014 <.LVL3>: + 14: 07fe sll a5,a5,0x1f + +00000016 <.LVL4>: + 16: 8d59 or a0,a0,a4 + +00000018 <.LBE5>: + 18: 8d5d or a0,a0,a5 + +0000001a <.LVL6>: + 1a: 8082 ret + +subsf3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__subsf3>: + 0: 008007b7 lui a5,0x800 + +00000004 <.LBE2>: + 4: 1141 add sp,sp,-16 + +00000006 <.LBB3>: + 6: 17fd add a5,a5,-1 # 7fffff <.LLST21+0x7ff59a> + 8: 00a7f633 and a2,a5,a0 + +0000000c <.LBE3>: + c: c422 sw s0,8(sp) + +0000000e <.LBB4>: + e: 01f55713 srl a4,a0,0x1f + 12: 01755413 srl s0,a0,0x17 + +00000016 <.LBB5>: + 16: 0175d513 srl a0,a1,0x17 + +0000001a <.LVL2>: + 1a: 8fed and a5,a5,a1 + +0000001c <.LBE5>: + 1c: c606 sw ra,12(sp) + 1e: c226 sw s1,4(sp) + +00000020 <.LBB6>: + 20: 0ff57513 zext.b a0,a0 + +00000024 <.LBE6>: + 24: 0ff00313 li t1,255 + +00000028 <.LBB7>: + 28: 0ff47413 zext.b s0,s0 + +0000002c <.LBE7>: + 2c: 060e sll a2,a2,0x3 + +0000002e <.LBB8>: + 2e: 81fd srl a1,a1,0x1f + +00000030 <.LBE8>: + 30: 078e sll a5,a5,0x3 + 32: 06651763 bne a0,t1,a0 <.L2> + +00000036 <.LBB9>: + 36: f0140693 add a3,s0,-255 + +0000003a <.LBE9>: + 3a: cb91 beqz a5,4e <.L3> + +0000003c <.LBB10>: + 3c: 82ae mv t0,a1 + +0000003e <.LBE10>: + 3e: 1eb71363 bne a4,a1,224 <.L118> + +00000042 <.LBB11>: + 42: 14068363 beqz a3,188 <.L17> + +00000046 <.LVL7>: + 46: e451 bnez s0,d2 <.L125> + +00000048 <.L54>: + 48: 0ff00413 li s0,255 + +0000004c <.LVL9>: + 4c: a211 j 150 <.L18> + +0000004e <.L3>: + 4e: 0015c293 xor t0,a1,1 + +00000052 <.LVL11>: + 52: 1c571f63 bne a4,t0,230 <.L119> + +00000056 <.LBB12>: + 56: 12068963 beqz a3,188 <.L17> + +0000005a <.LVL12>: + 5a: d47d beqz s0,48 <.L54> + 5c: 0ff00413 li s0,255 + +00000060 <.L47>: + 60: 040006b7 lui a3,0x4000 + 64: 8efd and a3,a3,a5 + 66: 2c068c63 beqz a3,33e <.L48> + +0000006a <.LVL14>: + 6a: 0405 add s0,s0,1 + +0000006c <.LVL15>: + 6c: 0ff00693 li a3,255 + 70: 4481 li s1,0 + 72: 00d40863 beq s0,a3,82 <.L25> + 76: 0037d493 srl s1,a5,0x3 + 7a: 1f8007b7 lui a5,0x1f800 + +0000007e <.LVL16>: + 7e: 17fd add a5,a5,-1 # 1f7fffff <.LLST21+0x1f7ff59a> + 80: 8cfd and s1,s1,a5 + +00000082 <.L25>: + 82: 045e sll s0,s0,0x17 + 84: 7f8007b7 lui a5,0x7f800 + 88: 04a6 sll s1,s1,0x9 + +0000008a <.LVL18>: + 8a: 80a5 srl s1,s1,0x9 + 8c: 8c7d and s0,s0,a5 + 8e: 8c45 or s0,s0,s1 + 90: 01f71513 sll a0,a4,0x1f + +00000094 <.LBE14>: + 94: 40b2 lw ra,12(sp) + 96: 8d41 or a0,a0,s0 + +00000098 <.LVL20>: + 98: 4422 lw s0,8(sp) + 9a: 4492 lw s1,4(sp) + 9c: 0141 add sp,sp,16 + 9e: 8082 ret + +000000a0 <.L2>: + a0: 0015c293 xor t0,a1,1 + +000000a4 <.LBB15>: + a4: 40a406b3 sub a3,s0,a0 + +000000a8 <.LBE15>: + a8: 10571f63 bne a4,t0,1c6 <.L8> + +000000ac <.LBB16>: + ac: 08d05963 blez a3,13e <.L9> + +000000b0 <.LVL24>: + b0: e505 bnez a0,d8 <.L10> + b2: 28078263 beqz a5,336 <.L62> + b6: fff68593 add a1,a3,-1 # 3ffffff <.LLST21+0x3fff59a> + +000000ba <.LVL25>: + ba: e989 bnez a1,cc <.L12> + +000000bc <.L131>: + bc: 97b2 add a5,a5,a2 + +000000be <.LVL27>: + be: 040006b7 lui a3,0x4000 + c2: 8efd and a3,a3,a5 + c4: 4409 li s0,2 + c6: e2bd bnez a3,12c <.L13> + +000000c8 <.L126>: + c8: 4405 li s0,1 + ca: a015 j ee <.L11> + +000000cc <.L12>: + cc: 00669c63 bne a3,t1,e4 <.L14> + +000000d0 <.L73>: + d0: 87b2 mv a5,a2 + +000000d2 <.L125>: + d2: 0ff00413 li s0,255 + +000000d6 <.LVL32>: + d6: a821 j ee <.L11> + +000000d8 <.L10>: + d8: 26640163 beq s0,t1,33a <.L70> + dc: 040005b7 lui a1,0x4000 + e0: 8fcd or a5,a5,a1 + e2: 85b6 mv a1,a3 + +000000e4 <.L14>: + e4: 46ed li a3,27 + e6: 00b6de63 bge a3,a1,102 <.L15> + +000000ea <.LVL36>: + ea: 00160793 add a5,a2,1 + +000000ee <.L11>: + ee: 0077f693 and a3,a5,7 + f2: d6bd beqz a3,60 <.L47> + f4: 00f7f693 and a3,a5,15 + f8: 4611 li a2,4 + fa: f6c683e3 beq a3,a2,60 <.L47> + fe: 0791 add a5,a5,4 # 7f800004 <.LLST21+0x7f7ff59f> + 100: b785 j 60 <.L47> + +00000102 <.L15>: + 102: 02000693 li a3,32 + 106: 8e8d sub a3,a3,a1 + 108: 00b7d533 srl a0,a5,a1 + +0000010c <.LVL40>: + 10c: 00d797b3 sll a5,a5,a3 + +00000110 <.LVL41>: + 110: 00f037b3 snez a5,a5 + +00000114 <.LVL42>: + 114: 8fc9 or a5,a5,a0 + +00000116 <.LVL43>: + 116: 97b2 add a5,a5,a2 + +00000118 <.L16>: + 118: 040006b7 lui a3,0x4000 + 11c: 8efd and a3,a3,a5 + 11e: dae1 beqz a3,ee <.L11> + +00000120 <.LVL45>: + 120: 0405 add s0,s0,1 + +00000122 <.LVL46>: + 122: 0ff00693 li a3,255 + +00000126 <.LBB25>: + 126: 4481 li s1,0 + +00000128 <.LBB26>: + 128: f4d40de3 beq s0,a3,82 <.L25> + +0000012c <.L13>: + 12c: 7e0006b7 lui a3,0x7e000 + 130: 0017f613 and a2,a5,1 + 134: 16fd add a3,a3,-1 # 7dffffff <.LLST21+0x7dfff59a> + 136: 8385 srl a5,a5,0x1 + 138: 8ff5 and a5,a5,a3 + 13a: 8fd1 or a5,a5,a2 + 13c: bf4d j ee <.L11> + +0000013e <.L9>: + 13e: c6a9 beqz a3,188 <.L17> + 140: 408505b3 sub a1,a0,s0 + +00000144 <.LVL49>: + 144: c409 beqz s0,14e <.L53> + 146: 040006b7 lui a3,0x4000 + 14a: 8e55 or a2,a2,a3 + 14c: a811 j 160 <.L21> + +0000014e <.L53>: + 14e: 842e mv s0,a1 + +00000150 <.L18>: + 150: de59 beqz a2,ee <.L11> + 152: fff40593 add a1,s0,-1 + +00000156 <.LVL52>: + 156: d1bd beqz a1,bc <.L131> + 158: 0ff00693 li a3,255 + 15c: f8d409e3 beq s0,a3,ee <.L11> + +00000160 <.L21>: + 160: 46ed li a3,27 + 162: 00b6d563 bge a3,a1,16c <.L22> + +00000166 <.LVL53>: + 166: 0785 add a5,a5,1 + +00000168 <.LBB27>: + 168: 842a mv s0,a0 + 16a: b751 j ee <.L11> + +0000016c <.L22>: + 16c: 02000693 li a3,32 + 170: 8e8d sub a3,a3,a1 + 172: 00d616b3 sll a3,a2,a3 + 176: 00b65333 srl t1,a2,a1 + 17a: 00d036b3 snez a3,a3 + +0000017e <.LVL56>: + 17e: 00d366b3 or a3,t1,a3 + +00000182 <.LVL57>: + 182: 97b6 add a5,a5,a3 + +00000184 <.LBB29>: + 184: 842a mv s0,a0 + +00000186 <.LBB30>: + 186: bf49 j 118 <.L16> + +00000188 <.L17>: + 188: 00140693 add a3,s0,1 + 18c: 0fe6f593 and a1,a3,254 + 190: e195 bnez a1,1b4 <.L23> + 192: ec11 bnez s0,1ae <.L24> + +00000194 <.LVL60>: + 194: de29 beqz a2,ee <.L11> + 196: 1a078263 beqz a5,33a <.L70> + 19a: 97b2 add a5,a5,a2 + +0000019c <.LVL61>: + 19c: 040006b7 lui a3,0x4000 + 1a0: 8efd and a3,a3,a5 + 1a2: d6b1 beqz a3,ee <.L11> + 1a4: fc0006b7 lui a3,0xfc000 + 1a8: 16fd add a3,a3,-1 # fbffffff <.LLST21+0xfbfff59a> + 1aa: 8ff5 and a5,a5,a3 + +000001ac <.LVL62>: + 1ac: bf31 j c8 <.L126> + +000001ae <.L24>: + 1ae: d215 beqz a2,d2 <.L125> + +000001b0 <.L42>: + 1b0: d385 beqz a5,d0 <.L73> + 1b2: a205 j 2d2 <.L72> + +000001b4 <.L23>: + 1b4: 0ff00593 li a1,255 + 1b8: 18b68e63 beq a3,a1,354 <.L60> + 1bc: 963e add a2,a2,a5 + +000001be <.LVL65>: + 1be: 00165793 srl a5,a2,0x1 + +000001c2 <.L127>: + 1c2: 8436 mv s0,a3 + +000001c4 <.LVL67>: + 1c4: b72d j ee <.L11> + +000001c6 <.L8>: + 1c6: 06d05b63 blez a3,23c <.L26> + +000001ca <.LVL69>: + 1ca: e531 bnez a0,216 <.L27> + 1cc: 16078563 beqz a5,336 <.L62> + 1d0: fff68593 add a1,a3,-1 + +000001d4 <.LVL70>: + 1d4: e589 bnez a1,1de <.L28> + 1d6: 40f607b3 sub a5,a2,a5 + +000001da <.L123>: + 1da: 4405 li s0,1 + +000001dc <.LBB36>: + 1dc: a025 j 204 <.L29> + +000001de <.L28>: + 1de: ee6689e3 beq a3,t1,d0 <.L73> + +000001e2 <.L30>: + 1e2: 456d li a0,27 + +000001e4 <.LVL74>: + 1e4: 4685 li a3,1 + 1e6: 00b54d63 blt a0,a1,200 <.L31> + 1ea: 02000693 li a3,32 + 1ee: 8e8d sub a3,a3,a1 + 1f0: 00b7d533 srl a0,a5,a1 + 1f4: 00d797b3 sll a5,a5,a3 + +000001f8 <.LVL75>: + 1f8: 00f037b3 snez a5,a5 + 1fc: 00f566b3 or a3,a0,a5 + +00000200 <.L31>: + 200: 40d607b3 sub a5,a2,a3 + +00000204 <.L29>: + 204: 040004b7 lui s1,0x4000 + 208: 0097f6b3 and a3,a5,s1 + 20c: ee0681e3 beqz a3,ee <.L11> + +00000210 <.LBB18>: + 210: 14fd add s1,s1,-1 # 3ffffff <.LLST21+0x3fff59a> + 212: 8cfd and s1,s1,a5 + +00000214 <.LVL78>: + 214: a8f1 j 2f0 <.L44> + +00000216 <.L27>: + 216: 12640263 beq s0,t1,33a <.L70> + 21a: 040005b7 lui a1,0x4000 + 21e: 8fcd or a5,a5,a1 + 220: 85b6 mv a1,a3 + 222: b7c1 j 1e2 <.L30> + +00000224 <.L118>: + 224: cab5 beqz a3,298 <.L32> + +00000226 <.LVL82>: + 226: c805 beqz s0,256 <.L66> + 228: 0ff00413 li s0,255 + +0000022c <.LVL83>: + 22c: 872e mv a4,a1 + +0000022e <.LVL84>: + 22e: b5c1 j ee <.L11> + +00000230 <.L119>: + 230: c6a5 beqz a3,298 <.L32> + +00000232 <.LVL86>: + 232: c415 beqz s0,25e <.L67> + 234: 0ff00413 li s0,255 + +00000238 <.LVL87>: + 238: 8716 mv a4,t0 + +0000023a <.LVL88>: + 23a: b51d j 60 <.L47> + +0000023c <.L26>: + 23c: ceb1 beqz a3,298 <.L32> + 23e: 408505b3 sub a1,a0,s0 + +00000242 <.LVL90>: + 242: e431 bnez s0,28e <.L34> + 244: 8716 mv a4,t0 + +00000246 <.LVL91>: + 246: 842e mv s0,a1 + +00000248 <.L33>: + 248: ea0603e3 beqz a2,ee <.L11> + 24c: fff40593 add a1,s0,-1 + +00000250 <.LVL93>: + 250: e989 bnez a1,262 <.L35> + 252: 8f91 sub a5,a5,a2 + +00000254 <.LVL94>: + 254: b759 j 1da <.L123> + +00000256 <.L66>: + 256: 872e mv a4,a1 + +00000258 <.L122>: + 258: 0ff00413 li s0,255 + +0000025c <.LVL97>: + 25c: b7f5 j 248 <.L33> + +0000025e <.L67>: + 25e: 8716 mv a4,t0 + +00000260 <.LVL99>: + 260: bfe5 j 258 <.L122> + +00000262 <.L35>: + 262: 0ff00693 li a3,255 + 266: e8d404e3 beq s0,a3,ee <.L11> + +0000026a <.L36>: + 26a: 436d li t1,27 + 26c: 4685 li a3,1 + 26e: 00b34d63 blt t1,a1,288 <.L37> + 272: 02000693 li a3,32 + 276: 8e8d sub a3,a3,a1 + 278: 00d616b3 sll a3,a2,a3 + 27c: 00b65333 srl t1,a2,a1 + 280: 00d036b3 snez a3,a3 + 284: 00d366b3 or a3,t1,a3 + +00000288 <.L37>: + 288: 8f95 sub a5,a5,a3 + +0000028a <.LBB37>: + 28a: 842a mv s0,a0 + +0000028c <.LBB38>: + 28c: bfa5 j 204 <.L29> + +0000028e <.L34>: + 28e: 04000737 lui a4,0x4000 + +00000292 <.LVL104>: + 292: 8e59 or a2,a2,a4 + 294: 8716 mv a4,t0 + 296: bfd1 j 26a <.L36> + +00000298 <.L32>: + 298: 00140693 add a3,s0,1 + 29c: 0fe6f693 and a3,a3,254 + 2a0: ee9d bnez a3,2de <.L38> + 2a2: e01d bnez s0,2c8 <.L39> + +000002a4 <.LVL107>: + 2a4: e601 bnez a2,2ac <.L40> + +000002a6 <.LVL108>: + 2a6: cbdd beqz a5,35c <.L69> + +000002a8 <.L128>: + 2a8: 8716 mv a4,t0 + +000002aa <.LVL110>: + 2aa: b591 j ee <.L11> + +000002ac <.L40>: + 2ac: c7d9 beqz a5,33a <.L70> + 2ae: 40f604b3 sub s1,a2,a5 + +000002b2 <.LVL112>: + 2b2: 040006b7 lui a3,0x4000 + 2b6: 8ee5 and a3,a3,s1 + 2b8: c299 beqz a3,2be <.L41> + 2ba: 8f91 sub a5,a5,a2 + +000002bc <.LVL113>: + 2bc: b7f5 j 2a8 <.L128> + +000002be <.L41>: + 2be: 87a6 mv a5,s1 + +000002c0 <.LVL115>: + 2c0: e20497e3 bnez s1,ee <.L11> + +000002c4 <.L129>: + 2c4: 4701 li a4,0 + 2c6: bb75 j 82 <.L25> + +000002c8 <.L39>: + 2c8: ee0614e3 bnez a2,1b0 <.L42> + 2cc: 8716 mv a4,t0 + +000002ce <.LVL118>: + 2ce: e00792e3 bnez a5,d2 <.L125> + +000002d2 <.L72>: + 2d2: 4701 li a4,0 + +000002d4 <.LBB40>: + 2d4: 0ff00413 li s0,255 + +000002d8 <.LBB41>: + 2d8: 004004b7 lui s1,0x400 + 2dc: b35d j 82 <.L25> + +000002de <.L38>: + 2de: 40f604b3 sub s1,a2,a5 + +000002e2 <.LVL121>: + 2e2: 040006b7 lui a3,0x4000 + 2e6: 8ee5 and a3,a3,s1 + 2e8: ce95 beqz a3,324 <.L43> + 2ea: 40c784b3 sub s1,a5,a2 + +000002ee <.LVL122>: + 2ee: 8716 mv a4,t0 + +000002f0 <.L44>: + 2f0: 8526 mv a0,s1 + 2f2: c03a sw a4,0(sp) + +000002f4 <.LVL124>: + 2f4: 00000097 auipc ra,0x0 + 2f8: 000080e7 jalr ra # 2f4 <.LVL124> + +000002fc <.LVL125>: + 2fc: 156d add a0,a0,-5 + 2fe: 4702 lw a4,0(sp) + 300: 00a494b3 sll s1,s1,a0 + 304: 02854363 blt a0,s0,32a <.L45> + 308: 8d01 sub a0,a0,s0 + +0000030a <.LVL128>: + 30a: 0505 add a0,a0,1 + +0000030c <.LVL129>: + 30c: 02000693 li a3,32 + 310: 8e89 sub a3,a3,a0 + 312: 00a4d7b3 srl a5,s1,a0 + 316: 00d494b3 sll s1,s1,a3 + +0000031a <.LVL130>: + 31a: 009034b3 snez s1,s1 + 31e: 8fc5 or a5,a5,s1 + +00000320 <.LVL131>: + 320: 4401 li s0,0 + 322: b3f1 j ee <.L11> + +00000324 <.L43>: + 324: f4f1 bnez s1,2f0 <.L44> + 326: 4401 li s0,0 + +00000328 <.LVL133>: + 328: bf71 j 2c4 <.L129> + +0000032a <.L45>: + 32a: fc0007b7 lui a5,0xfc000 + 32e: 17fd add a5,a5,-1 # fbffffff <.LLST21+0xfbfff59a> + 330: 8c09 sub s0,s0,a0 + 332: 8fe5 and a5,a5,s1 + +00000334 <.LVL136>: + 334: bb6d j ee <.L11> + +00000336 <.L62>: + 336: 87b2 mv a5,a2 + +00000338 <.LVL138>: + 338: b569 j 1c2 <.L127> + +0000033a <.L70>: + 33a: 87b2 mv a5,a2 + +0000033c <.LVL140>: + 33c: bb4d j ee <.L11> + +0000033e <.L48>: + 33e: 0037d493 srl s1,a5,0x3 + +00000342 <.LVL142>: + 342: 0ff00793 li a5,255 + 346: d2f41ee3 bne s0,a5,82 <.L25> + 34a: d2048ce3 beqz s1,82 <.L25> + 34e: 004004b7 lui s1,0x400 + +00000352 <.LVL143>: + 352: bf8d j 2c4 <.L129> + +00000354 <.L60>: + 354: 0ff00413 li s0,255 + +00000358 <.LBB46>: + 358: 4481 li s1,0 + 35a: b325 j 82 <.L25> + +0000035c <.L69>: + 35c: 4481 li s1,0 + 35e: b79d j 2c4 <.L129> + +unordsf2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__unordsf2>: + 0: 008007b7 lui a5,0x800 + 4: 17fd add a5,a5,-1 # 7fffff <.LASF9+0x7ffe6c> + 6: 00a7f733 and a4,a5,a0 + +0000000a <.LBB3>: + a: 815d srl a0,a0,0x17 + +0000000c <.LBB4>: + c: 8fed and a5,a5,a1 + +0000000e <.LBE4>: + e: 0ff57513 zext.b a0,a0 + 12: 81dd srl a1,a1,0x17 + +00000014 <.LVL4>: + 14: 0ff00693 li a3,255 + 18: 0ff5f593 zext.b a1,a1 + +0000001c <.LBB5>: + 1c: 00d51463 bne a0,a3,24 <.L2> + 20: 4505 li a0,1 + 22: eb01 bnez a4,32 <.L1> + +00000024 <.L2>: + 24: 0ff00713 li a4,255 + +00000028 <.LVL6>: + 28: 4501 li a0,0 + 2a: 00e59463 bne a1,a4,32 <.L1> + 2e: 00f03533 snez a0,a5 + +00000032 <.L1>: + 32: 8082 ret + +fixsfsi.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__fixsfsi>: + 0: 00800637 lui a2,0x800 + 4: 01755713 srl a4,a0,0x17 + 8: fff60793 add a5,a2,-1 # 7fffff <.LASF18+0x7ffe6f> + c: 0ff77713 zext.b a4,a4 + +00000010 <.LBE2>: + 10: 07e00593 li a1,126 + +00000014 <.LBB3>: + 14: 8fe9 and a5,a5,a0 + +00000016 <.LVL1>: + 16: 01f55693 srl a3,a0,0x1f + +0000001a <.LBE3>: + 1a: 04e5d063 bge a1,a4,5a <.L6> + 1e: 09d00593 li a1,157 + 22: 00e5d863 bge a1,a4,32 <.L3> + +00000026 <.LVL3>: + 26: 80000537 lui a0,0x80000 + +0000002a <.LVL4>: + 2a: fff54513 not a0,a0 + 2e: 9536 add a0,a0,a3 + +00000030 <.LVL5>: + 30: 8082 ret + +00000032 <.L3>: + 32: 00c7e533 or a0,a5,a2 + +00000036 <.LVL7>: + 36: 09500793 li a5,149 + 3a: 00e7da63 bge a5,a4,4e <.L4> + +0000003e <.LVL8>: + 3e: f6a70713 add a4,a4,-150 + +00000042 <.LVL9>: + 42: 00e51533 sll a0,a0,a4 + +00000046 <.L5>: + 46: ca99 beqz a3,5c <.L2> + 48: 40a00533 neg a0,a0 + 4c: 8082 ret + +0000004e <.L4>: + 4e: 09600793 li a5,150 + 52: 8f99 sub a5,a5,a4 + 54: 00f55533 srl a0,a0,a5 + +00000058 <.LVL13>: + 58: b7fd j 46 <.L5> + +0000005a <.L6>: + 5a: 4501 li a0,0 + +0000005c <.L2>: + 5c: 8082 ret + +fixunssfsi.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__fixunssfsi>: + 0: 01755793 srl a5,a0,0x17 + 4: 00800637 lui a2,0x800 + 8: fff60693 add a3,a2,-1 # 7fffff <.LASF17+0x7ffe73> + c: 0ff7f793 zext.b a5,a5 + +00000010 <.LBE2>: + 10: 07e00593 li a1,126 + +00000014 <.LBB3>: + 14: 8ee9 and a3,a3,a0 + +00000016 <.LVL1>: + 16: 01f55713 srl a4,a0,0x1f + +0000001a <.LBE3>: + 1a: 4501 li a0,0 + +0000001c <.LVL3>: + 1c: 02f5da63 bge a1,a5,50 <.L1> + 20: eb05 bnez a4,50 <.L1> + 22: 09e00713 li a4,158 + +00000026 <.LVL4>: + 26: 557d li a0,-1 + 28: 02f74463 blt a4,a5,50 <.L1> + +0000002c <.LBB4>: + 2c: 09500713 li a4,149 + 30: 00c6e533 or a0,a3,a2 + +00000034 <.LVL6>: + 34: 00f75763 bge a4,a5,42 <.L3> + +00000038 <.LVL7>: + 38: f6a78793 add a5,a5,-150 + +0000003c <.LVL8>: + 3c: 00f51533 sll a0,a0,a5 + +00000040 <.LVL9>: + 40: 8082 ret + +00000042 <.L3>: + 42: 09600713 li a4,150 + 46: 40f707b3 sub a5,a4,a5 + +0000004a <.LVL11>: + 4a: 00f55533 srl a0,a0,a5 + +0000004e <.LVL12>: + 4e: 8082 ret + +00000050 <.L1>: + 50: 8082 ret + +floatsisf.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__floatsisf>: + 0: 1151 add sp,sp,-12 + 2: c406 sw ra,8(sp) + 4: c222 sw s0,4(sp) + 6: c026 sw s1,0(sp) + +00000008 <.LBB10>: + 8: c945 beqz a0,b8 <.L9> + +0000000a <.LBB3>: + a: 41f55793 sra a5,a0,0x1f + e: 00a7c433 xor s0,a5,a0 + 12: 8c1d sub s0,s0,a5 + 14: 01f55493 srl s1,a0,0x1f + +00000018 <.LBB4>: + 18: 8522 mv a0,s0 + +0000001a <.LVL3>: + 1a: 00000097 auipc ra,0x0 + 1e: 000080e7 jalr ra # 1a <.LVL3> + +00000022 <.LVL4>: + 22: 87aa mv a5,a0 + +00000024 <.LVL5>: + 24: 09e00513 li a0,158 + +00000028 <.LVL6>: + 28: 8d1d sub a0,a0,a5 + +0000002a <.LBE4>: + 2a: 09600713 li a4,150 + 2e: 02a74363 blt a4,a0,54 <.L4> + +00000032 <.LVL8>: + 32: 4721 li a4,8 + 34: 08e78563 beq a5,a4,be <.L10> + 38: 17e1 add a5,a5,-8 + +0000003a <.LVL9>: + 3a: 00f41433 sll s0,s0,a5 + +0000003e <.L2>: + 3e: 0426 sll s0,s0,0x9 + +00000040 <.LVL11>: + 40: 8025 srl s0,s0,0x9 + 42: 055e sll a0,a0,0x17 + +00000044 <.LBE11>: + 44: 40a2 lw ra,8(sp) + +00000046 <.LBB12>: + 46: 8d41 or a0,a0,s0 + +00000048 <.LBE12>: + 48: 4412 lw s0,4(sp) + +0000004a <.LBB13>: + 4a: 04fe sll s1,s1,0x1f + +0000004c <.LBE13>: + 4c: 8d45 or a0,a0,s1 + +0000004e <.LVL14>: + 4e: 4482 lw s1,0(sp) + 50: 0131 add sp,sp,12 + 52: 8082 ret + +00000054 <.L4>: + 54: 09900713 li a4,153 + 58: 04a75863 bge a4,a0,a8 <.L5> + 5c: 4695 li a3,5 + 5e: 01b78713 add a4,a5,27 + 62: 00e41733 sll a4,s0,a4 + 66: 8e9d sub a3,a3,a5 + 68: 00d456b3 srl a3,s0,a3 + 6c: 00e03733 snez a4,a4 + 70: 00e6e433 or s0,a3,a4 + +00000074 <.L6>: + 74: fc000737 lui a4,0xfc000 + 78: 177d add a4,a4,-1 # fbffffff <.LASF14+0xfbfffdd1> + +0000007a <.LBB5>: + 7a: 00747693 and a3,s0,7 + +0000007e <.LBE5>: + 7e: 8f61 and a4,a4,s0 + +00000080 <.LBB6>: + 80: c691 beqz a3,8c <.L7> + +00000082 <.LVL18>: + 82: 883d and s0,s0,15 + 84: 4691 li a3,4 + 86: 00d40363 beq s0,a3,8c <.L7> + 8a: 0711 add a4,a4,4 + +0000008c <.L7>: + 8c: 040006b7 lui a3,0x4000 + 90: 8ef9 and a3,a3,a4 + 92: ca81 beqz a3,a2 <.L8> + 94: fc0006b7 lui a3,0xfc000 + 98: 16fd add a3,a3,-1 # fbffffff <.LASF14+0xfbfffdd1> + 9a: 09f00513 li a0,159 + +0000009e <.LVL20>: + 9e: 8f75 and a4,a4,a3 + a0: 8d1d sub a0,a0,a5 + +000000a2 <.L8>: + a2: 00375413 srl s0,a4,0x3 + +000000a6 <.LVL23>: + a6: bf61 j 3e <.L2> + +000000a8 <.L5>: + a8: 4695 li a3,5 + aa: ffb78713 add a4,a5,-5 + ae: fcd783e3 beq a5,a3,74 <.L6> + b2: 00e41433 sll s0,s0,a4 + +000000b6 <.LVL25>: + b6: bf7d j 74 <.L6> + +000000b8 <.L9>: + b8: 4481 li s1,0 + ba: 4401 li s0,0 + bc: b749 j 3e <.L2> + +000000be <.L10>: + be: 09600513 li a0,150 + +000000c2 <.LVL28>: + c2: bfb5 j 3e <.L2> + +floatunsisf.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__floatunsisf>: + 0: 1151 add sp,sp,-12 + 2: c222 sw s0,4(sp) + 4: c406 sw ra,8(sp) + 6: 842a mv s0,a0 + +00000008 <.LBB9>: + 8: 4781 li a5,0 + a: c115 beqz a0,2e <.L2> + +0000000c <.LBB3>: + c: 00000097 auipc ra,0x0 + 10: 000080e7 jalr ra # c <.LBB3> + +00000014 <.LVL2>: + 14: 09e00793 li a5,158 + 18: 8f89 sub a5,a5,a0 + +0000001a <.LBE4>: + 1a: 09600713 li a4,150 + 1e: 02f74163 blt a4,a5,40 <.L3> + +00000022 <.LVL4>: + 22: 4721 li a4,8 + 24: 08e50063 beq a0,a4,a4 <.L9> + 28: 1561 add a0,a0,-8 + +0000002a <.LVL5>: + 2a: 00a41433 sll s0,s0,a0 + +0000002e <.L2>: + 2e: 0426 sll s0,s0,0x9 + +00000030 <.LVL7>: + 30: 8025 srl s0,s0,0x9 + 32: 01779513 sll a0,a5,0x17 + +00000036 <.LBE10>: + 36: 40a2 lw ra,8(sp) + 38: 8d41 or a0,a0,s0 + +0000003a <.LVL9>: + 3a: 4412 lw s0,4(sp) + 3c: 0131 add sp,sp,12 + 3e: 8082 ret + +00000040 <.L3>: + 40: 09900713 li a4,153 + 44: 04f75863 bge a4,a5,94 <.L4> + 48: 01b50693 add a3,a0,27 + 4c: 4715 li a4,5 + 4e: 00d416b3 sll a3,s0,a3 + 52: 8f09 sub a4,a4,a0 + 54: 00d036b3 snez a3,a3 + 58: 00e45733 srl a4,s0,a4 + 5c: 00e6e433 or s0,a3,a4 + +00000060 <.L5>: + 60: fc000737 lui a4,0xfc000 + 64: 177d add a4,a4,-1 # fbffffff <.LASF2+0xfbfffdd7> + +00000066 <.LBB5>: + 66: 00747693 and a3,s0,7 + +0000006a <.LBE5>: + 6a: 8f61 and a4,a4,s0 + +0000006c <.LBB6>: + 6c: c691 beqz a3,78 <.L6> + +0000006e <.LVL13>: + 6e: 883d and s0,s0,15 + 70: 4691 li a3,4 + 72: 00d40363 beq s0,a3,78 <.L6> + 76: 0711 add a4,a4,4 + +00000078 <.L6>: + 78: 040006b7 lui a3,0x4000 + 7c: 8ef9 and a3,a3,a4 + 7e: ca81 beqz a3,8e <.L7> + 80: fc0007b7 lui a5,0xfc000 + +00000084 <.LVL15>: + 84: 17fd add a5,a5,-1 # fbffffff <.LASF2+0xfbfffdd7> + 86: 8f7d and a4,a4,a5 + 88: 09f00793 li a5,159 + 8c: 8f89 sub a5,a5,a0 + +0000008e <.L7>: + 8e: 00375413 srl s0,a4,0x3 + +00000092 <.LVL18>: + 92: bf71 j 2e <.L2> + +00000094 <.L4>: + 94: 4695 li a3,5 + 96: ffb50713 add a4,a0,-5 + 9a: fcd503e3 beq a0,a3,60 <.L5> + 9e: 00e41433 sll s0,s0,a4 + +000000a2 <.LVL20>: + a2: bf7d j 60 <.L5> + +000000a4 <.L9>: + a4: 09600793 li a5,150 + +000000a8 <.LVL22>: + a8: b759 j 2e <.L2> + +fixsfdi.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__fixsfdi>: + 0: 00800737 lui a4,0x800 + 4: 01755613 srl a2,a0,0x17 + 8: fff70793 add a5,a4,-1 # 7fffff <.LASF18+0x7ffe65> + c: 0ff67613 zext.b a2,a2 + +00000010 <.LBE2>: + 10: 07e00693 li a3,126 + +00000014 <.LBB3>: + 14: 8fe9 and a5,a5,a0 + +00000016 <.LBE3>: + 16: 06c6d863 bge a3,a2,86 <.L6> + 1a: 1151 add sp,sp,-12 + 1c: c222 sw s0,4(sp) + 1e: c406 sw ra,8(sp) + 20: 0bd00693 li a3,189 + 24: 01f55413 srl s0,a0,0x1f + 28: 02c6d263 bge a3,a2,4c <.L3> + +0000002c <.LVL2>: + 2c: 4505 li a0,1 + +0000002e <.LVL3>: + 2e: 8d01 sub a0,a0,s0 + 30: 41f55713 sra a4,a0,0x1f + 34: 800005b7 lui a1,0x80000 + 38: 00a037b3 snez a5,a0 + +0000003c <.LVL4>: + 3c: 8d99 sub a1,a1,a4 + 3e: 40a00533 neg a0,a0 + 42: 8d9d sub a1,a1,a5 + +00000044 <.L2>: + 44: 40a2 lw ra,8(sp) + 46: 4412 lw s0,4(sp) + 48: 0131 add sp,sp,12 + 4a: 8082 ret + +0000004c <.L3>: + 4c: 00e7e533 or a0,a5,a4 + +00000050 <.LVL7>: + 50: 09500793 li a5,149 + 54: 02c7d263 bge a5,a2,78 <.L4> + 58: f6a60613 add a2,a2,-150 + +0000005c <.LVL9>: + 5c: 4581 li a1,0 + 5e: 00000097 auipc ra,0x0 + 62: 000080e7 jalr ra # 5e <.LVL9+0x2> + +00000066 <.L5>: + 66: dc79 beqz s0,44 <.L2> + 68: 00a037b3 snez a5,a0 + 6c: 40b005b3 neg a1,a1 + +00000070 <.LVL11>: + 70: 8d9d sub a1,a1,a5 + 72: 40a00533 neg a0,a0 + 76: b7f9 j 44 <.L2> + +00000078 <.L4>: + 78: 09600793 li a5,150 + 7c: 8f91 sub a5,a5,a2 + 7e: 00f55533 srl a0,a0,a5 + +00000082 <.LVL14>: + 82: 4581 li a1,0 + 84: b7cd j 66 <.L5> + +00000086 <.L6>: + 86: 4501 li a0,0 + +00000088 <.LVL17>: + 88: 4581 li a1,0 + +0000008a <.LVL18>: + 8a: 8082 ret + +fixunssfdi.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__fixunssfdi>: + 0: 00800737 lui a4,0x800 + 4: 01755613 srl a2,a0,0x17 + 8: fff70793 add a5,a4,-1 # 7fffff <.LASF17+0x7ffe69> + c: 0ff67613 zext.b a2,a2 + +00000010 <.LBE2>: + 10: 07e00693 li a3,126 + +00000014 <.LBB3>: + 14: 8fe9 and a5,a5,a0 + +00000016 <.LBE3>: + 16: 04c6d163 bge a3,a2,58 <.L4> + 1a: 817d srl a0,a0,0x1f + +0000001c <.LVL2>: + 1c: ed15 bnez a0,58 <.L4> + 1e: 0be00693 li a3,190 + 22: 02c6cd63 blt a3,a2,5c <.L6> + +00000026 <.LBB4>: + 26: 00e7e533 or a0,a5,a4 + +0000002a <.LVL4>: + 2a: 09500793 li a5,149 + 2e: 00c7de63 bge a5,a2,4a <.L3> + +00000032 <.LBE4>: + 32: 1151 add sp,sp,-12 + +00000034 <.LBB5>: + 34: f6a60613 add a2,a2,-150 + +00000038 <.LVL6>: + 38: 4581 li a1,0 + +0000003a <.LBE5>: + 3a: c406 sw ra,8(sp) + +0000003c <.LBB6>: + 3c: 00000097 auipc ra,0x0 + 40: 000080e7 jalr ra # 3c <.LBB6> + +00000044 <.LBE6>: + 44: 40a2 lw ra,8(sp) + 46: 0131 add sp,sp,12 + 48: 8082 ret + +0000004a <.L3>: + 4a: 09600793 li a5,150 + 4e: 8f91 sub a5,a5,a2 + 50: 00f55533 srl a0,a0,a5 + +00000054 <.L11>: + 54: 4581 li a1,0 + 56: 8082 ret + +00000058 <.L4>: + 58: 4501 li a0,0 + 5a: bfed j 54 <.L11> + +0000005c <.L6>: + 5c: 557d li a0,-1 + +0000005e <.LVL12>: + 5e: 55fd li a1,-1 + +00000060 <.LVL13>: + 60: 8082 ret + +floatdisf.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__floatdisf>: + 0: 1111 add sp,sp,-28 + 2: cc06 sw ra,24(sp) + 4: ca22 sw s0,20(sp) + 6: c826 sw s1,16(sp) + +00000008 <.LBB11>: + 8: 00b567b3 or a5,a0,a1 + c: 10078863 beqz a5,11c <.L13> + +00000010 <.LBB3>: + 10: 01f5d793 srl a5,a1,0x1f + 14: c03e sw a5,0(sp) + 16: 842a mv s0,a0 + 18: 86ae mv a3,a1 + +0000001a <.LVL1>: + 1a: 0005d963 bgez a1,2c <.L4> + +0000001e <.LVL2>: + 1e: 00a037b3 snez a5,a0 + +00000022 <.LVL3>: + 22: 40b006b3 neg a3,a1 + 26: 8e9d sub a3,a3,a5 + 28: 40a00433 neg s0,a0 + +0000002c <.L4>: + 2c: c2d9 beqz a3,b2 <.L6> + 2e: 8536 mv a0,a3 + +00000030 <.LVL4>: + 30: c236 sw a3,4(sp) + 32: 00000097 auipc ra,0x0 + 36: 000080e7 jalr ra # 32 <.LVL4+0x2> + +0000003a <.LVL5>: + 3a: 4692 lw a3,4(sp) + 3c: 0be00713 li a4,190 + 40: 84aa mv s1,a0 + +00000042 <.LVL6>: + 42: 8f09 sub a4,a4,a0 + +00000044 <.L7>: + 44: 02500613 li a2,37 + 48: 8e05 sub a2,a2,s1 + 4a: 85b6 mv a1,a3 + 4c: 8522 mv a0,s0 + 4e: c63a sw a4,12(sp) + 50: c436 sw a3,8(sp) + 52: 00000097 auipc ra,0x0 + 56: 000080e7 jalr ra # 52 <.L7+0xe> + +0000005a <.LVL8>: + 5a: 46a2 lw a3,8(sp) + 5c: c22a sw a0,4(sp) + 5e: 01b48613 add a2,s1,27 + 62: 8522 mv a0,s0 + 64: 85b6 mv a1,a3 + 66: 00000097 auipc ra,0x0 + 6a: 000080e7 jalr ra # 66 <.LVL8+0xc> + +0000006e <.LVL9>: + 6e: 4292 lw t0,4(sp) + 70: 00b567b3 or a5,a0,a1 + 74: 4732 lw a4,12(sp) + 76: 00f037b3 snez a5,a5 + 7a: 0057e7b3 or a5,a5,t0 + +0000007e <.L10>: + 7e: fc0006b7 lui a3,0xfc000 + 82: 16fd add a3,a3,-1 # fbffffff <.LASF25+0xfbfffdc1> + +00000084 <.LBB5>: + 84: 0077f613 and a2,a5,7 + +00000088 <.LBE5>: + 88: 8efd and a3,a3,a5 + +0000008a <.LBB6>: + 8a: c611 beqz a2,96 <.L11> + +0000008c <.LVL12>: + 8c: 8bbd and a5,a5,15 + 8e: 4611 li a2,4 + 90: 00c78363 beq a5,a2,96 <.L11> + 94: 0691 add a3,a3,4 + +00000096 <.L11>: + 96: 040007b7 lui a5,0x4000 + 9a: 8ff5 and a5,a5,a3 + 9c: cb81 beqz a5,ac <.L12> + 9e: fc0007b7 lui a5,0xfc000 + a2: 17fd add a5,a5,-1 # fbffffff <.LASF25+0xfbfffdc1> + a4: 0bf00713 li a4,191 + a8: 8efd and a3,a3,a5 + aa: 8f05 sub a4,a4,s1 + +000000ac <.L12>: + ac: 0036d793 srl a5,a3,0x3 + +000000b0 <.LVL16>: + b0: a815 j e4 <.L2> + +000000b2 <.L6>: + b2: 8522 mv a0,s0 + +000000b4 <.LVL18>: + b4: c436 sw a3,8(sp) + b6: c222 sw s0,4(sp) + b8: 00000097 auipc ra,0x0 + bc: 000080e7 jalr ra # b8 <.LVL18+0x4> + +000000c0 <.LVL19>: + c0: 02050493 add s1,a0,32 + +000000c4 <.LVL20>: + c4: 0be00713 li a4,190 + c8: 8f05 sub a4,a4,s1 + +000000ca <.LBE7>: + ca: 09600613 li a2,150 + ce: 46a2 lw a3,8(sp) + d0: 87a2 mv a5,s0 + d2: 02e64663 blt a2,a4,fe <.L8> + +000000d6 <.LVL22>: + d6: 02800693 li a3,40 + da: 04d48563 beq s1,a3,124 <.L14> + de: 1561 add a0,a0,-8 + e0: 00a417b3 sll a5,s0,a0 + +000000e4 <.L2>: + e4: 07a6 sll a5,a5,0x9 + +000000e6 <.LVL24>: + e6: 83a5 srl a5,a5,0x9 + e8: 075e sll a4,a4,0x17 + +000000ea <.LVL25>: + ea: 8f5d or a4,a4,a5 + ec: 4782 lw a5,0(sp) + +000000ee <.LBE12>: + ee: 40e2 lw ra,24(sp) + f0: 4452 lw s0,20(sp) + +000000f2 <.LBB13>: + f2: 01f79513 sll a0,a5,0x1f + +000000f6 <.LBE13>: + f6: 44c2 lw s1,16(sp) + f8: 8d59 or a0,a0,a4 + +000000fa <.LVL27>: + fa: 0171 add sp,sp,28 + +000000fc <.LVL28>: + fc: 8082 ret + +000000fe <.L8>: + fe: 09900613 li a2,153 + 102: f4e641e3 blt a2,a4,44 <.L7> + +00000106 <.LVL30>: + 106: 02500693 li a3,37 + 10a: 156d add a0,a0,-5 + 10c: 00d48563 beq s1,a3,116 <.L15> + 110: 00a417b3 sll a5,s0,a0 + +00000114 <.LVL31>: + 114: b7ad j 7e <.L10> + +00000116 <.L15>: + 116: 09900713 li a4,153 + +0000011a <.LVL33>: + 11a: b795 j 7e <.L10> + +0000011c <.L13>: + 11c: 4781 li a5,0 + 11e: 4701 li a4,0 + 120: c002 sw zero,0(sp) + 122: b7c9 j e4 <.L2> + +00000124 <.L14>: + 124: 09600713 li a4,150 + +00000128 <.LVL36>: + 128: bf75 j e4 <.L2> + +floatundisf.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__floatundisf>: + 0: 1121 add sp,sp,-24 + 2: ca06 sw ra,20(sp) + 4: c822 sw s0,16(sp) + 6: c626 sw s1,12(sp) + 8: c02e sw a1,0(sp) + +0000000a <.LBB11>: + a: 00b567b3 or a5,a0,a1 + e: cff9 beqz a5,ec <.L11> + 10: 84aa mv s1,a0 + +00000012 <.LBB3>: + 12: cdb5 beqz a1,8e <.L4> + 14: 852e mv a0,a1 + +00000016 <.LVL2>: + 16: 00000097 auipc ra,0x0 + 1a: 000080e7 jalr ra # 16 <.LVL2> + +0000001e <.LVL3>: + 1e: 0be00713 li a4,190 + 22: 842a mv s0,a0 + +00000024 <.LVL4>: + 24: 8f09 sub a4,a4,a0 + +00000026 <.L5>: + 26: 4582 lw a1,0(sp) + 28: 01b40613 add a2,s0,27 + 2c: 8526 mv a0,s1 + 2e: c43a sw a4,8(sp) + +00000030 <.LVL6>: + 30: 00000097 auipc ra,0x0 + 34: 000080e7 jalr ra # 30 <.LVL6> + +00000038 <.LVL7>: + 38: 00b567b3 or a5,a0,a1 + 3c: 4582 lw a1,0(sp) + 3e: 02500613 li a2,37 + 42: 00f037b3 snez a5,a5 + 46: 8e01 sub a2,a2,s0 + 48: 8526 mv a0,s1 + 4a: c23e sw a5,4(sp) + 4c: 00000097 auipc ra,0x0 + 50: 000080e7 jalr ra # 4c <.LVL7+0x14> + +00000054 <.LVL8>: + 54: 4792 lw a5,4(sp) + 56: 4722 lw a4,8(sp) + 58: 8fc9 or a5,a5,a0 + +0000005a <.L8>: + 5a: fc0006b7 lui a3,0xfc000 + 5e: 16fd add a3,a3,-1 # fbffffff <.LASF3+0xfbfffdc3> + +00000060 <.LBB5>: + 60: 0077f613 and a2,a5,7 + +00000064 <.LBE5>: + 64: 8efd and a3,a3,a5 + +00000066 <.LBB6>: + 66: c611 beqz a2,72 <.L9> + +00000068 <.LVL11>: + 68: 8bbd and a5,a5,15 + 6a: 4611 li a2,4 + 6c: 00c78363 beq a5,a2,72 <.L9> + 70: 0691 add a3,a3,4 + +00000072 <.L9>: + 72: 040007b7 lui a5,0x4000 + 76: 8ff5 and a5,a5,a3 + 78: cb81 beqz a5,88 <.L10> + 7a: fc0007b7 lui a5,0xfc000 + 7e: 17fd add a5,a5,-1 # fbffffff <.LASF3+0xfbfffdc3> + 80: 0bf00713 li a4,191 + 84: 8efd and a3,a3,a5 + 86: 8f01 sub a4,a4,s0 + +00000088 <.L10>: + 88: 0036d793 srl a5,a3,0x3 + +0000008c <.LVL15>: + 8c: a03d j ba <.L2> + +0000008e <.L4>: + 8e: c22a sw a0,4(sp) + 90: 00000097 auipc ra,0x0 + 94: 000080e7 jalr ra # 90 <.L4+0x2> + +00000098 <.LVL17>: + 98: 02050413 add s0,a0,32 + +0000009c <.LVL18>: + 9c: 0be00713 li a4,190 + a0: 8f01 sub a4,a4,s0 + +000000a2 <.LBE7>: + a2: 09600693 li a3,150 + a6: 87a6 mv a5,s1 + a8: 02e6c363 blt a3,a4,ce <.L6> + +000000ac <.LVL20>: + ac: 02800693 li a3,40 + b0: 04d40163 beq s0,a3,f2 <.L12> + b4: 1561 add a0,a0,-8 + b6: 00a497b3 sll a5,s1,a0 + +000000ba <.L2>: + ba: 40d2 lw ra,20(sp) + bc: 4442 lw s0,16(sp) + +000000be <.LBB13>: + be: 07a6 sll a5,a5,0x9 + +000000c0 <.LVL22>: + c0: 01771513 sll a0,a4,0x17 + c4: 83a5 srl a5,a5,0x9 + +000000c6 <.LBE13>: + c6: 44b2 lw s1,12(sp) + c8: 8d5d or a0,a0,a5 + +000000ca <.LVL24>: + ca: 0161 add sp,sp,24 + cc: 8082 ret + +000000ce <.L6>: + ce: 09900693 li a3,153 + d2: f4e6cae3 blt a3,a4,26 <.L5> + +000000d6 <.LVL26>: + d6: 02500693 li a3,37 + da: 156d add a0,a0,-5 + dc: 00d40563 beq s0,a3,e6 <.L13> + e0: 00a497b3 sll a5,s1,a0 + +000000e4 <.LVL27>: + e4: bf9d j 5a <.L8> + +000000e6 <.L13>: + e6: 09900713 li a4,153 + +000000ea <.LVL29>: + ea: bf85 j 5a <.L8> + +000000ec <.L11>: + ec: 4781 li a5,0 + ee: 4701 li a4,0 + f0: b7e9 j ba <.L2> + +000000f2 <.L12>: + f2: 09600713 li a4,150 + +000000f6 <.LVL32>: + f6: b7d1 j ba <.L2> + +extendsfdf2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__extendsfdf2>: + 0: 01755713 srl a4,a0,0x17 + 4: 0ff77713 zext.b a4,a4 + +00000008 <.LBE2>: + 8: 1151 add sp,sp,-12 + a: 00170793 add a5,a4,1 + e: c222 sw s0,4(sp) + 10: c026 sw s1,0(sp) + +00000012 <.LBB3>: + 12: 00951413 sll s0,a0,0x9 + +00000016 <.LBE3>: + 16: c406 sw ra,8(sp) + 18: 0fe7f793 and a5,a5,254 + +0000001c <.LBB4>: + 1c: 8025 srl s0,s0,0x9 + +0000001e <.LVL1>: + 1e: 01f55493 srl s1,a0,0x1f + +00000022 <.LBE4>: + 22: c785 beqz a5,4a <.L2> + 24: 00345793 srl a5,s0,0x3 + 28: 38070713 add a4,a4,896 + +0000002c <.LVL3>: + 2c: 0476 sll s0,s0,0x1d + +0000002e <.L3>: + 2e: 07b2 sll a5,a5,0xc + +00000030 <.LBE7>: + 30: 40a2 lw ra,8(sp) + +00000032 <.LBB8>: + 32: 83b1 srl a5,a5,0xc + +00000034 <.LBE8>: + 34: 8522 mv a0,s0 + +00000036 <.LBB9>: + 36: 0752 sll a4,a4,0x14 + +00000038 <.LBE9>: + 38: 4412 lw s0,4(sp) + +0000003a <.LBB10>: + 3a: 04fe sll s1,s1,0x1f + +0000003c <.LVL8>: + 3c: 8f5d or a4,a4,a5 + 3e: 009767b3 or a5,a4,s1 + +00000042 <.LBE10>: + 42: 85be mv a1,a5 + 44: 4482 lw s1,0(sp) + 46: 0131 add sp,sp,12 + 48: 8082 ret + +0000004a <.L2>: + 4a: ef0d bnez a4,84 <.L4> + 4c: 4781 li a5,0 + 4e: d065 beqz s0,2e <.L3> + +00000050 <.LBB11>: + 50: 8522 mv a0,s0 + +00000052 <.LVL10>: + 52: 00000097 auipc ra,0x0 + 56: 000080e7 jalr ra # 52 <.LVL10> + +0000005a <.LVL11>: + 5a: 47a9 li a5,10 + 5c: 00a7ce63 blt a5,a0,78 <.L5> + 60: 47ad li a5,11 + 62: 8f89 sub a5,a5,a0 + 64: 01550713 add a4,a0,21 + 68: 00f457b3 srl a5,s0,a5 + +0000006c <.LVL12>: + 6c: 00e41433 sll s0,s0,a4 + +00000070 <.L6>: + 70: 38900713 li a4,905 + 74: 8f09 sub a4,a4,a0 + +00000076 <.LVL14>: + 76: bf65 j 2e <.L3> + +00000078 <.L5>: + 78: ff550793 add a5,a0,-11 + 7c: 00f417b3 sll a5,s0,a5 + +00000080 <.LVL16>: + 80: 4401 li s0,0 + +00000082 <.LVL17>: + 82: b7fd j 70 <.L6> + +00000084 <.L4>: + 84: 4781 li a5,0 + 86: c419 beqz s0,94 <.L11> + +00000088 <.LVL19>: + 88: 00345793 srl a5,s0,0x3 + +0000008c <.LVL20>: + 8c: 00080737 lui a4,0x80 + +00000090 <.LVL21>: + 90: 0476 sll s0,s0,0x1d + +00000092 <.LVL22>: + 92: 8fd9 or a5,a5,a4 + +00000094 <.L11>: + 94: 7ff00713 li a4,2047 + 98: bf59 j 2e <.L3> + +extendsftf2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__extendsftf2>: + 0: 7139 add sp,sp,-64 + +00000002 <.LBB3>: + 2: 0175d793 srl a5,a1,0x17 + +00000006 <.LBE3>: + 6: dc22 sw s0,56(sp) + +00000008 <.LBB4>: + 8: 0ff7f793 zext.b a5,a5 + c: 00959413 sll s0,a1,0x9 + 10: 8025 srl s0,s0,0x9 + +00000012 <.LBE4>: + 12: 00178613 add a2,a5,1 + 16: da26 sw s1,52(sp) + 18: 02710693 add a3,sp,39 + 1c: de06 sw ra,60(sp) + 1e: c422 sw s0,8(sp) + 20: ca02 sw zero,20(sp) + 22: c802 sw zero,16(sp) + 24: c602 sw zero,12(sp) + 26: 0fe67613 and a2,a2,254 + 2a: 872a mv a4,a0 + 2c: 9ac1 and a3,a3,-16 + +0000002e <.LBB5>: + 2e: 01f5d493 srl s1,a1,0x1f + +00000032 <.LBE5>: + 32: c239 beqz a2,78 <.L2> + 34: 6611 lui a2,0x4 + 36: f8060613 add a2,a2,-128 # 3f80 <.LLST22+0x3c65> + 3a: 97b2 add a5,a5,a2 + +0000003c <.LBB6>: + 3c: 00745613 srl a2,s0,0x7 + 40: 0466 sll s0,s0,0x19 + +00000042 <.LVL4>: + 42: ca32 sw a2,20(sp) + +00000044 <.LVL5>: + 44: c822 sw s0,16(sp) + +00000046 <.LVL6>: + 46: c402 sw zero,8(sp) + +00000048 <.L3>: + 48: 4352 lw t1,20(sp) + 4a: 04be sll s1,s1,0xf + +0000004c <.LVL8>: + 4c: 8cdd or s1,s1,a5 + 4e: 00969723 sh s1,14(a3) + 52: 00669623 sh t1,12(a3) + 56: 4522 lw a0,8(sp) + 58: 45b2 lw a1,12(sp) + 5a: 4642 lw a2,16(sp) + 5c: 46dc lw a5,12(a3) + +0000005e <.LBE7>: + 5e: 50f2 lw ra,60(sp) + 60: 5462 lw s0,56(sp) + +00000062 <.LBB8>: + 62: c288 sw a0,0(a3) + +00000064 <.LBE8>: + 64: c308 sw a0,0(a4) + +00000066 <.LBB9>: + 66: c2cc sw a1,4(a3) + 68: c690 sw a2,8(a3) + +0000006a <.LBE9>: + 6a: c34c sw a1,4(a4) + 6c: c710 sw a2,8(a4) + 6e: c75c sw a5,12(a4) + 70: 54d2 lw s1,52(sp) + 72: 853a mv a0,a4 + +00000074 <.LVL11>: + 74: 6121 add sp,sp,64 + +00000076 <.LVL12>: + 76: 8082 ret + +00000078 <.L2>: + 78: e7d1 bnez a5,104 <.L4> + 7a: d479 beqz s0,48 <.L3> + 7c: c22a sw a0,4(sp) + +0000007e <.LBB10>: + 7e: 8522 mv a0,s0 + 80: c036 sw a3,0(sp) + +00000082 <.LBB13>: + 82: 00000097 auipc ra,0x0 + 86: 000080e7 jalr ra # 82 <.LBB13> + +0000008a <.LBB11>: + 8a: 05150613 add a2,a0,81 + 8e: 40565793 sra a5,a2,0x5 + +00000092 <.LVL16>: + 92: 8a7d and a2,a2,31 + +00000094 <.LVL17>: + 94: 4682 lw a3,0(sp) + 96: 4712 lw a4,4(sp) + 98: c61d beqz a2,c6 <.L5> + +0000009a <.LVL18>: + 9a: 4589 li a1,2 + 9c: 06b79263 bne a5,a1,100 <.L10> + a0: 02000593 li a1,32 + a4: 8d91 sub a1,a1,a2 + +000000a6 <.LVL19>: + a6: 00b455b3 srl a1,s0,a1 + +000000aa <.LVL20>: + aa: ca2e sw a1,20(sp) + +000000ac <.L6>: + ac: fff78593 add a1,a5,-1 + +000000b0 <.LVL22>: + b0: 078a sll a5,a5,0x2 + b2: 02c78793 add a5,a5,44 + b6: 00810313 add t1,sp,8 + ba: 979a add a5,a5,t1 + bc: 00c41633 sll a2,s0,a2 + +000000c0 <.LVL23>: + c0: fcc7aa23 sw a2,-44(a5) + c4: a00d j e6 <.L7> + +000000c6 <.L5>: + c6: 460d li a2,3 + +000000c8 <.LVL25>: + c8: 8e1d sub a2,a2,a5 + ca: 060a sll a2,a2,0x2 + cc: 002c add a1,sp,8 + ce: 02c60613 add a2,a2,44 + d2: 962e add a2,a2,a1 + d4: fd462603 lw a2,-44(a2) + d8: 4589 li a1,2 + da: ca32 sw a2,20(sp) + +000000dc <.LVL26>: + dc: 4609 li a2,2 + de: 00c79463 bne a5,a2,e6 <.L7> + e2: c822 sw s0,16(sp) + +000000e4 <.LVL27>: + e4: 4585 li a1,1 + +000000e6 <.L7>: + e6: 058a sll a1,a1,0x2 + e8: c402 sw zero,8(sp) + ea: c602 sw zero,12(sp) + ec: 15f1 add a1,a1,-4 + ee: 4791 li a5,4 + f0: 00f5e363 bltu a1,a5,f6 <.L8> + f4: c802 sw zero,16(sp) + +000000f6 <.L8>: + f6: 6791 lui a5,0x4 + f8: f8978793 add a5,a5,-119 # 3f89 <.LLST22+0x3c6e> + fc: 8f89 sub a5,a5,a0 + +000000fe <.LVL29>: + fe: b7a9 j 48 <.L3> + +00000100 <.L10>: + 100: 478d li a5,3 + +00000102 <.LVL31>: + 102: b76d j ac <.L6> + +00000104 <.L4>: + 104: c809 beqz s0,116 <.L9> + +00000106 <.LBB14>: + 106: 01941793 sll a5,s0,0x19 + +0000010a <.LVL34>: + 10a: c83e sw a5,16(sp) + +0000010c <.LVL35>: + 10c: 801d srl s0,s0,0x7 + +0000010e <.LBE14>: + 10e: 67a1 lui a5,0x8 + 110: 8c5d or s0,s0,a5 + +00000112 <.LBB15>: + 112: c402 sw zero,8(sp) + +00000114 <.LBE15>: + 114: ca22 sw s0,20(sp) + +00000116 <.L9>: + 116: 67a1 lui a5,0x8 + 118: 17fd add a5,a5,-1 # 7fff <.LLST22+0x7ce4> + 11a: b73d j 48 <.L3> + +extenddftf2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__extenddftf2>: + 0: fb810113 add sp,sp,-72 + +00000004 <.LBB3>: + 4: 01465793 srl a5,a2,0x14 + 8: 01f65713 srl a4,a2,0x1f + +0000000c <.LBE3>: + c: c02a sw a0,0(sp) + +0000000e <.LBB4>: + e: 7ff7f793 and a5,a5,2047 + 12: 00c61513 sll a0,a2,0xc + 16: 8131 srl a0,a0,0xc + +00000018 <.LVL2>: + 18: c23a sw a4,4(sp) + +0000001a <.LBE4>: + 1a: 00178713 add a4,a5,1 + 1e: c0a2 sw s0,64(sp) + 20: de26 sw s1,60(sp) + 22: c286 sw ra,68(sp) + 24: 02f10493 add s1,sp,47 + 28: c82e sw a1,16(sp) + 2a: ca2a sw a0,20(sp) + 2c: ce02 sw zero,28(sp) + 2e: cc02 sw zero,24(sp) + 30: 7fe77713 and a4,a4,2046 + 34: 842e mv s0,a1 + 36: 98c1 and s1,s1,-16 + 38: cf21 beqz a4,90 <.L2> + 3a: 6711 lui a4,0x4 + 3c: c0070713 add a4,a4,-1024 # 3c00 <.LLST22+0x38aa> + 40: 97ba add a5,a5,a4 + +00000042 <.LBB5>: + 42: 00455713 srl a4,a0,0x4 + 46: ce3a sw a4,28(sp) + +00000048 <.LVL5>: + 48: 0572 sll a0,a0,0x1c + +0000004a <.LVL6>: + 4a: 0045d713 srl a4,a1,0x4 + 4e: 8d59 or a0,a0,a4 + 50: 01c59413 sll s0,a1,0x1c + 54: cc2a sw a0,24(sp) + +00000056 <.LVL7>: + 56: ca22 sw s0,20(sp) + +00000058 <.LVL8>: + 58: c802 sw zero,16(sp) + +0000005a <.L3>: + 5a: 4772 lw a4,28(sp) + 5c: 45c2 lw a1,16(sp) + 5e: 4652 lw a2,20(sp) + 60: 00e49623 sh a4,12(s1) + 64: 4712 lw a4,4(sp) + 66: 46e2 lw a3,24(sp) + +00000068 <.LBE6>: + 68: 4096 lw ra,68(sp) + +0000006a <.LBB7>: + 6a: 073e sll a4,a4,0xf + 6c: 8fd9 or a5,a5,a4 + +0000006e <.LVL10>: + 6e: 00f49723 sh a5,14(s1) + +00000072 <.LBE7>: + 72: 4702 lw a4,0(sp) + +00000074 <.LBB8>: + 74: 44dc lw a5,12(s1) + +00000076 <.LBE8>: + 76: 4406 lw s0,64(sp) + +00000078 <.LBB9>: + 78: c08c sw a1,0(s1) + 7a: c0d0 sw a2,4(s1) + 7c: c494 sw a3,8(s1) + +0000007e <.LBE9>: + 7e: c30c sw a1,0(a4) + 80: c350 sw a2,4(a4) + 82: c714 sw a3,8(a4) + 84: c75c sw a5,12(a4) + 86: 54f2 lw s1,60(sp) + 88: 853a mv a0,a4 + 8a: 04810113 add sp,sp,72 + +0000008e <.LVL12>: + 8e: 8082 ret + +00000090 <.L2>: + 90: 00b56733 or a4,a0,a1 + 94: e7f9 bnez a5,162 <.L4> + 96: d371 beqz a4,5a <.L3> + +00000098 <.LBB10>: + 98: c921 beqz a0,e8 <.L5> + 9a: 00000097 auipc ra,0x0 + 9e: 000080e7 jalr ra # 9a <.LBB10+0x2> + +000000a2 <.L6>: + a2: 03150713 add a4,a0,49 + a6: 40575793 sra a5,a4,0x5 + +000000aa <.LVL15>: + aa: 8b7d and a4,a4,31 + +000000ac <.LVL16>: + ac: 40f006b3 neg a3,a5 + b0: c721 beqz a4,f8 <.L7> + b2: 02000613 li a2,32 + b6: 8e19 sub a2,a2,a4 + +000000b8 <.LVL17>: + b8: c432 sw a2,8(sp) + ba: 00269613 sll a2,a3,0x2 + +000000be <.LVL18>: + be: 01010293 add t0,sp,16 + c2: 00c60693 add a3,a2,12 + c6: 9696 add a3,a3,t0 + c8: 40c00333 neg t1,a2 + +000000cc <.L8>: + cc: 06d29a63 bne t0,a3,140 <.L11> + d0: fff78693 add a3,a5,-1 + +000000d4 <.LVL19>: + d4: 078a sll a5,a5,0x2 + +000000d6 <.LVL20>: + d6: 02c78793 add a5,a5,44 + da: 0810 add a2,sp,16 + dc: 97b2 add a5,a5,a2 + de: 00e41733 sll a4,s0,a4 + +000000e2 <.LVL21>: + e2: fce7aa23 sw a4,-44(a5) + e6: a035 j 112 <.L10> + +000000e8 <.L5>: + e8: 853a mv a0,a4 + +000000ea <.LVL23>: + ea: 00000097 auipc ra,0x0 + ee: 000080e7 jalr ra # ea <.LVL23> + +000000f2 <.LVL24>: + f2: 02050513 add a0,a0,32 + f6: b775 j a2 <.L6> + +000000f8 <.L7>: + f8: 0878 add a4,sp,28 + +000000fa <.LVL27>: + fa: 068a sll a3,a3,0x2 + +000000fc <.LBB12>: + fc: 460d li a2,3 + +000000fe <.L9>: + fe: 00d705b3 add a1,a4,a3 + 102: 418c lw a1,0(a1) + 104: 167d add a2,a2,-1 + +00000106 <.LVL29>: + 106: 1771 add a4,a4,-4 + 108: c34c sw a1,4(a4) + +0000010a <.LVL30>: + 10a: fef65ae3 bge a2,a5,fe <.L9> + 10e: fff78693 add a3,a5,-1 + +00000112 <.L10>: + 112: 00168793 add a5,a3,1 + 116: 078a sll a5,a5,0x2 + 118: 46a1 li a3,8 + 11a: 0818 add a4,sp,16 + 11c: 00d7e863 bltu a5,a3,12c <.L12> + 120: 00072023 sw zero,0(a4) + 124: 00072223 sw zero,4(a4) + 128: 17e1 add a5,a5,-8 + 12a: 0838 add a4,sp,24 + +0000012c <.L12>: + 12c: 4691 li a3,4 + 12e: 00d7e463 bltu a5,a3,136 <.L13> + 132: 00072023 sw zero,0(a4) + +00000136 <.L13>: + 136: 6791 lui a5,0x4 + 138: c0c78793 add a5,a5,-1012 # 3c0c <.LLST22+0x38b6> + 13c: 8f89 sub a5,a5,a0 + +0000013e <.LVL32>: + 13e: bf31 j 5a <.L3> + +00000140 <.L11>: + 140: 4290 lw a2,0(a3) + 142: ffc6a583 lw a1,-4(a3) + 146: 006683b3 add t2,a3,t1 + 14a: 00e61633 sll a2,a2,a4 + 14e: c632 sw a2,12(sp) + 150: 4622 lw a2,8(sp) + 152: 16f1 add a3,a3,-4 + 154: 00c5d5b3 srl a1,a1,a2 + 158: 4632 lw a2,12(sp) + 15a: 8e4d or a2,a2,a1 + 15c: 00c3a023 sw a2,0(t2) + 160: b7b5 j cc <.L8> + +00000162 <.L4>: + 162: cf19 beqz a4,180 <.L14> + +00000164 <.LBB14>: + 164: 01c51793 sll a5,a0,0x1c + +00000168 <.LVL36>: + 168: 0045d713 srl a4,a1,0x4 + 16c: 8fd9 or a5,a5,a4 + 16e: cc3e sw a5,24(sp) + +00000170 <.LVL37>: + 170: 8111 srl a0,a0,0x4 + +00000172 <.LBE14>: + 172: 67a1 lui a5,0x8 + +00000174 <.LBB15>: + 174: 01c59413 sll s0,a1,0x1c + +00000178 <.LBE15>: + 178: 8d5d or a0,a0,a5 + +0000017a <.LBB16>: + 17a: ca22 sw s0,20(sp) + +0000017c <.LVL40>: + 17c: c802 sw zero,16(sp) + +0000017e <.LBE16>: + 17e: ce2a sw a0,28(sp) + +00000180 <.L14>: + 180: 67a1 lui a5,0x8 + 182: 17fd add a5,a5,-1 # 7fff <.LLST22+0x7ca9> + 184: bdd9 j 5a <.L3> + +truncdfsf2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__truncdfsf2>: + 0: 00c59713 sll a4,a1,0xc + +00000004 <.LVL1>: + 4: 0145d313 srl t1,a1,0x14 + +00000008 <.LBE2>: + 8: 8325 srl a4,a4,0x9 + +0000000a <.LBB4>: + a: 7ff37313 and t1,t1,2047 + +0000000e <.LBE4>: + e: 01d55793 srl a5,a0,0x1d + 12: 8fd9 or a5,a5,a4 + 14: 00130713 add a4,t1,1 + 18: 7fe77713 and a4,a4,2046 + +0000001c <.LBB6>: + 1c: 81fd srl a1,a1,0x1f + +0000001e <.LBE6>: + 1e: 00351613 sll a2,a0,0x3 + +00000022 <.LVL5>: + 22: c74d beqz a4,cc <.L2> + 24: c8030693 add a3,t1,-896 + +00000028 <.LVL6>: + 28: 0fe00713 li a4,254 + 2c: 0ed74b63 blt a4,a3,122 <.L15> + 30: 08d04063 bgtz a3,b0 <.L4> + 34: 5725 li a4,-23 + 36: 0ee6c963 blt a3,a4,128 <.L18> + 3a: 008002b7 lui t0,0x800 + 3e: 4779 li a4,30 + 40: 0057e2b3 or t0,a5,t0 + +00000044 <.LVL7>: + 44: 8f15 sub a4,a4,a3 + 46: 47fd li a5,31 + 48: 02e7ce63 blt a5,a4,84 <.L5> + 4c: c8230313 add t1,t1,-894 + +00000050 <.LVL8>: + 50: 00e65733 srl a4,a2,a4 + 54: 00661633 sll a2,a2,t1 + +00000058 <.LVL9>: + 58: 00c03633 snez a2,a2 + 5c: 00629333 sll t1,t0,t1 + +00000060 <.LVL10>: + 60: 00666633 or a2,a2,t1 + 64: 8f51 or a4,a4,a2 + +00000066 <.LBB9>: + 66: 00777793 and a5,a4,7 + 6a: efad bnez a5,e4 <.L6> + +0000006c <.L24>: + 6c: 00375793 srl a5,a4,0x3 + +00000070 <.L22>: + 70: 4681 li a3,0 + +00000072 <.L3>: + 72: 07a6 sll a5,a5,0x9 + +00000074 <.LVL15>: + 74: 01769513 sll a0,a3,0x17 + 78: 83a5 srl a5,a5,0x9 + 7a: 8fc9 or a5,a5,a0 + 7c: 01f59513 sll a0,a1,0x1f + +00000080 <.LBE11>: + 80: 8d5d or a0,a0,a5 + +00000082 <.LVL17>: + 82: 8082 ret + +00000084 <.L5>: + 84: 57f9 li a5,-2 + 86: 8f95 sub a5,a5,a3 + 88: 02000513 li a0,32 + +0000008c <.LVL19>: + 8c: 00f2d7b3 srl a5,t0,a5 + 90: 4681 li a3,0 + +00000092 <.LVL20>: + 92: 00a70663 beq a4,a0,9e <.L7> + 96: ca230693 add a3,t1,-862 + 9a: 00d296b3 sll a3,t0,a3 + +0000009e <.L7>: + 9e: 8ed1 or a3,a3,a2 + a0: 00d036b3 snez a3,a3 + a4: 8fd5 or a5,a5,a3 + +000000a6 <.LBB13>: + a6: 0077f713 and a4,a5,7 + aa: e721 bnez a4,f2 <.L8> + +000000ac <.L12>: + ac: 838d srl a5,a5,0x3 + +000000ae <.LVL23>: + ae: b7c9 j 70 <.L22> + +000000b0 <.L4>: + b0: 00651713 sll a4,a0,0x6 + b4: 078e sll a5,a5,0x3 + +000000b6 <.LVL25>: + b6: 00e03733 snez a4,a4 + ba: 8f5d or a4,a4,a5 + bc: 8275 srl a2,a2,0x1d + +000000be <.LVL26>: + be: 8f51 or a4,a4,a2 + +000000c0 <.LBB15>: + c0: 00777793 and a5,a4,7 + c4: ef95 bnez a5,100 <.L9> + c6: 00375793 srl a5,a4,0x3 + +000000ca <.LVL28>: + ca: b765 j 72 <.L3> + +000000cc <.L2>: + cc: 04030e63 beqz t1,128 <.L18> + +000000d0 <.LVL30>: + d0: 8fd1 or a5,a5,a2 + +000000d2 <.LVL31>: + d2: 0ff00693 li a3,255 + d6: dfd1 beqz a5,72 <.L3> + +000000d8 <.LBB16>: + d8: 4581 li a1,0 + +000000da <.LBE16>: + da: 0ff00693 li a3,255 + +000000de <.LBB17>: + de: 004007b7 lui a5,0x400 + e2: bf41 j 72 <.L3> + +000000e4 <.L6>: + e4: 00f77793 and a5,a4,15 + e8: 4691 li a3,4 + +000000ea <.LVL34>: + ea: f8d781e3 beq a5,a3,6c <.L24> + +000000ee <.LBE17>: + ee: 4681 li a3,0 + f0: a839 j 10e <.L11> + +000000f2 <.L8>: + f2: 00f7f713 and a4,a5,15 + f6: 4691 li a3,4 + f8: fad70ae3 beq a4,a3,ac <.L12> + fc: 0791 add a5,a5,4 # 400004 <.LLST9+0x3ffd20> + +000000fe <.LVL36>: + fe: b77d j ac <.L12> + +00000100 <.L9>: + 100: 00f77313 and t1,a4,15 + +00000104 <.LVL38>: + 104: 4291 li t0,4 + 106: 00375793 srl a5,a4,0x3 + 10a: f65304e3 beq t1,t0,72 <.L3> + +0000010e <.L11>: + 10e: 00470793 add a5,a4,4 + +00000112 <.LVL40>: + 112: 04000737 lui a4,0x4000 + 116: 8f7d and a4,a4,a5 + 118: 838d srl a5,a5,0x3 + +0000011a <.LVL41>: + 11a: df21 beqz a4,72 <.L3> + 11c: 0685 add a3,a3,1 + +0000011e <.L23>: + 11e: 4781 li a5,0 + 120: bf89 j 72 <.L3> + +00000122 <.L15>: + 122: 0ff00693 li a3,255 + +00000126 <.LVL44>: + 126: bfe5 j 11e <.L23> + +00000128 <.L18>: + 128: 4681 li a3,0 + 12a: bfd5 j 11e <.L23> + +trunctfsf2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__trunctfsf2>: + 0: fd410113 add sp,sp,-44 + 4: 4558 lw a4,12(a0) + 6: 4514 lw a3,8(a0) + 8: 410c lw a1,0(a0) + a: 4150 lw a2,4(a0) + c: 01f10793 add a5,sp,31 + 10: 9bc1 and a5,a5,-16 + +00000012 <.LBB3>: + 12: c794 sw a3,8(a5) + 14: c7d8 sw a4,12(a5) + 16: c38c sw a1,0(a5) + 18: c3d0 sw a2,4(a5) + 1a: 01071793 sll a5,a4,0x10 + 1e: 83c1 srl a5,a5,0x10 + 20: c436 sw a3,8(sp) + 22: 850a mv a0,sp + 24: 00171693 sll a3,a4,0x1 + 28: c63e sw a5,12(sp) + 2a: c02e sw a1,0(sp) + 2c: c232 sw a2,4(sp) + 2e: 82c5 srl a3,a3,0x11 + +00000030 <.LVL1>: + 30: 837d srl a4,a4,0x1f + +00000032 <.LBB4>: + 32: ff410313 add t1,sp,-12 + +00000036 <.LBB5>: + 36: 87aa mv a5,a0 + +00000038 <.L2>: + 38: 47d0 lw a2,12(a5) + 3a: 478c lw a1,8(a5) + 3c: 17f1 add a5,a5,-4 + 3e: 060e sll a2,a2,0x3 + 40: 81f5 srl a1,a1,0x1d + 42: 8e4d or a2,a2,a1 + 44: cb90 sw a2,16(a5) + 46: fef319e3 bne t1,a5,38 <.L2> + +0000004a <.LVL4>: + 4a: 4582 lw a1,0(sp) + +0000004c <.LBE6>: + 4c: 6621 lui a2,0x8 + 4e: 00168793 add a5,a3,1 + +00000052 <.LBB7>: + 52: 058e sll a1,a1,0x3 + +00000054 <.LBE7>: + 54: 1679 add a2,a2,-2 # 7ffe <.LLST15+0x7ba3> + +00000056 <.LBB8>: + 56: c02e sw a1,0(sp) + +00000058 <.LBE8>: + 58: 8ff1 and a5,a5,a2 + 5a: 10078b63 beqz a5,170 <.L3> + 5e: 77f1 lui a5,0xffffc + 60: 08078793 add a5,a5,128 # ffffc080 <.LLST15+0xffffbc25> + 64: 96be add a3,a3,a5 + +00000066 <.LVL6>: + 66: 0fe00793 li a5,254 + 6a: 02d7d263 bge a5,a3,8e <.L4> + +0000006e <.L15>: + 6e: 0ff00693 li a3,255 + 72: 4601 li a2,0 + +00000074 <.L5>: + 74: 06de sll a3,a3,0x17 + 76: 7f8007b7 lui a5,0x7f800 + 7a: 0626 sll a2,a2,0x9 + +0000007c <.LVL9>: + 7c: 8efd and a3,a3,a5 + 7e: 8225 srl a2,a2,0x9 + 80: 8ed1 or a3,a3,a2 + 82: 01f71513 sll a0,a4,0x1f + +00000086 <.LBE10>: + 86: 8d55 or a0,a0,a3 + +00000088 <.LVL11>: + 88: 02c10113 add sp,sp,44 + +0000008c <.LVL12>: + 8c: 8082 ret + +0000008e <.L4>: + 8e: 04d05863 blez a3,de <.L6> + +00000092 <.LBB11>: + 92: 4522 lw a0,8(sp) + +00000094 <.LBB13>: + 94: 4612 lw a2,4(sp) + 96: 00751793 sll a5,a0,0x7 + +0000009a <.LVL16>: + 9a: 8fcd or a5,a5,a1 + +0000009c <.LVL17>: + 9c: 8fd1 or a5,a5,a2 + +0000009e <.LVL18>: + 9e: 4632 lw a2,12(sp) + a0: 8165 srl a0,a0,0x19 + +000000a2 <.LVL19>: + a2: 00f037b3 snez a5,a5 + +000000a6 <.LVL20>: + a6: 061e sll a2,a2,0x7 + a8: 8e49 or a2,a2,a0 + +000000aa <.LBE13>: + aa: 8fd1 or a5,a5,a2 + +000000ac <.L14>: + ac: 0077f613 and a2,a5,7 + b0: c619 beqz a2,be <.L16> + b2: 00f7f613 and a2,a5,15 + b6: 4591 li a1,4 + b8: 00b60363 beq a2,a1,be <.L16> + +000000bc <.LVL22>: + bc: 0791 add a5,a5,4 # 7f800004 <.LLST15+0x7f7ffba9> + +000000be <.L16>: + be: 04000637 lui a2,0x4000 + c2: 8e7d and a2,a2,a5 + c4: ce61 beqz a2,19c <.L8> + +000000c6 <.LVL24>: + c6: 0685 add a3,a3,1 + +000000c8 <.LVL25>: + c8: 0ff00593 li a1,255 + cc: 4601 li a2,0 + ce: fab683e3 beq a3,a1,74 <.L5> + d2: 1f800637 lui a2,0x1f800 + d6: 838d srl a5,a5,0x3 + +000000d8 <.LVL26>: + d8: 167d add a2,a2,-1 # 1f7fffff <.LLST15+0x1f7ffba4> + da: 8e7d and a2,a2,a5 + +000000dc <.LVL27>: + dc: bf61 j 74 <.L5> + +000000de <.L6>: + de: 57a5 li a5,-23 + e0: 0af6cc63 blt a3,a5,198 <.L17> + e4: 47b2 lw a5,12(sp) + e6: 00080637 lui a2,0x80 + +000000ea <.LBB17>: + ea: 4581 li a1,0 + +000000ec <.LBE17>: + ec: 8e5d or a2,a2,a5 + +000000ee <.LBB19>: + ee: 05a00793 li a5,90 + f2: 40d786b3 sub a3,a5,a3 + +000000f6 <.LVL29>: + f6: 4056d313 sra t1,a3,0x5 + +000000fa <.LBE19>: + fa: c632 sw a2,12(sp) + +000000fc <.LBB20>: + fc: 8afd and a3,a3,31 + +000000fe <.LVL31>: + fe: 4781 li a5,0 + +00000100 <.L9>: + 100: 00052283 lw t0,0(a0) + 104: 0585 add a1,a1,1 + +00000106 <.LVL33>: + 106: 0511 add a0,a0,4 + 108: 0057e7b3 or a5,a5,t0 + +0000010c <.LVL34>: + 10c: feb31ae3 bne t1,a1,100 <.L9> + 110: 00231593 sll a1,t1,0x2 + +00000114 <.LVL35>: + 114: ee91 bnez a3,130 <.L10> + +00000116 <.LVL36>: + 116: 02c58693 add a3,a1,44 + +0000011a <.LVL37>: + 11a: 002685b3 add a1,a3,sp + 11e: fd45a683 lw a3,-44(a1) + 122: c036 sw a3,0(sp) + +00000124 <.L12>: + 124: 4682 lw a3,0(sp) + +00000126 <.LBB21>: + 126: 00f037b3 snez a5,a5 + +0000012a <.LBE21>: + 12a: 8fd5 or a5,a5,a3 + +0000012c <.LBE24>: + 12c: 4681 li a3,0 + +0000012e <.LVL40>: + 12e: bfbd j ac <.L14> + +00000130 <.L10>: + 130: 02c58593 add a1,a1,44 + 134: 958a add a1,a1,sp + 136: fd45a583 lw a1,-44(a1) + 13a: 02000513 li a0,32 + 13e: 8d15 sub a0,a0,a3 + 140: 00a595b3 sll a1,a1,a0 + 144: 4289 li t0,2 + 146: 8fcd or a5,a5,a1 + +00000148 <.LVL42>: + 148: 4581 li a1,0 + 14a: 00531a63 bne t1,t0,15e <.L13> + 14e: 45a2 lw a1,8(sp) + 150: 00a61533 sll a0,a2,a0 + 154: 00d5d5b3 srl a1,a1,a3 + 158: 8d4d or a0,a0,a1 + 15a: c02a sw a0,0(sp) + +0000015c <.LVL43>: + 15c: 4585 li a1,1 + +0000015e <.L13>: + 15e: 058a sll a1,a1,0x2 + +00000160 <.LVL45>: + 160: 02c58593 add a1,a1,44 + 164: 958a add a1,a1,sp + 166: 00d65633 srl a2,a2,a3 + 16a: fcc5aa23 sw a2,-44(a1) + 16e: bf5d j 124 <.L12> + +00000170 <.L3>: + 170: 4601 li a2,0 + +00000172 <.LBE26>: + 172: d289 beqz a3,74 <.L5> + +00000174 <.LBB14>: + 174: 47a2 lw a5,8(sp) + +00000176 <.LBE14>: + 176: 4692 lw a3,4(sp) + +00000178 <.LBB15>: + 178: 4632 lw a2,12(sp) + +0000017a <.LBE15>: + 17a: 8edd or a3,a3,a5 + 17c: 8ed1 or a3,a3,a2 + 17e: 8ecd or a3,a3,a1 + 180: ee0687e3 beqz a3,6e <.L15> + +00000184 <.LBB29>: + 184: 83e5 srl a5,a5,0x19 + +00000186 <.LVL50>: + 186: 061e sll a2,a2,0x7 + +00000188 <.LVL51>: + 188: 8fd1 or a5,a5,a2 + +0000018a <.LBE30>: + 18a: 020006b7 lui a3,0x2000 + 18e: 9be1 and a5,a5,-8 + 190: 8fd5 or a5,a5,a3 + 192: 0ff00693 li a3,255 + 196: bf19 j ac <.L14> + +00000198 <.L17>: + 198: 4681 li a3,0 + +0000019a <.LBB31>: + 19a: 4795 li a5,5 + +0000019c <.L8>: + 19c: 0037d613 srl a2,a5,0x3 + +000001a0 <.LVL58>: + 1a0: 0ff00793 li a5,255 + 1a4: ecf698e3 bne a3,a5,74 <.L5> + 1a8: ec0603e3 beqz a2,6e <.L15> + 1ac: 00400637 lui a2,0x400 + +000001b0 <.LVL59>: + 1b0: 4701 li a4,0 + +000001b2 <.LVL60>: + 1b2: b5c9 j 74 <.L5> + +trunctfdf2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__trunctfdf2>: + 0: fc810113 add sp,sp,-56 + 4: 4554 lw a3,12(a0) + 6: 4518 lw a4,8(a0) + 8: 410c lw a1,0(a0) + a: 4150 lw a2,4(a0) + c: 02310793 add a5,sp,35 + 10: d826 sw s1,48(sp) + 12: 9bc1 and a5,a5,-16 + 14: da22 sw s0,52(sp) + +00000016 <.LBB3>: + 16: c798 sw a4,8(a5) + 18: c7d4 sw a3,12(a5) + 1a: c38c sw a1,0(a5) + 1c: c3d0 sw a2,4(a5) + 1e: 01069793 sll a5,a3,0x10 + 22: 83c1 srl a5,a5,0x10 + 24: c63a sw a4,12(sp) + 26: 01f6d493 srl s1,a3,0x1f + 2a: 00169713 sll a4,a3,0x1 + 2e: 0054 add a3,sp,4 + 30: c83e sw a5,16(sp) + 32: c22e sw a1,4(sp) + 34: c432 sw a2,8(sp) + 36: 8345 srl a4,a4,0x11 + +00000038 <.LBB4>: + 38: ff810513 add a0,sp,-8 + +0000003c <.LBB5>: + 3c: 87b6 mv a5,a3 + +0000003e <.L2>: + 3e: 47d0 lw a2,12(a5) + 40: 478c lw a1,8(a5) + 42: 17f1 add a5,a5,-4 + 44: 060e sll a2,a2,0x3 + 46: 81f5 srl a1,a1,0x1d + 48: 8e4d or a2,a2,a1 + 4a: cb90 sw a2,16(a5) + 4c: fea799e3 bne a5,a0,3e <.L2> + +00000050 <.LVL3>: + 50: 4592 lw a1,4(sp) + +00000052 <.LBE6>: + 52: 6621 lui a2,0x8 + 54: 00170793 add a5,a4,1 + +00000058 <.LBB7>: + 58: 058e sll a1,a1,0x3 + +0000005a <.LBE7>: + 5a: 1679 add a2,a2,-2 # 7ffe <.LLST14+0x7af8> + +0000005c <.LBB8>: + 5c: c22e sw a1,4(sp) + +0000005e <.LBE8>: + 5e: 8ff1 and a5,a5,a2 + 60: 18078c63 beqz a5,1f8 <.L3> + 64: 77f1 lui a5,0xffffc + 66: 40078793 add a5,a5,1024 # ffffc400 <.LLST14+0xffffbefa> + 6a: 973e add a4,a4,a5 + +0000006c <.LVL5>: + 6c: 7fe00793 li a5,2046 + 70: 1ee7c063 blt a5,a4,250 <.L21> + 74: 08e05a63 blez a4,108 <.L5> + +00000078 <.LBB10>: + 78: 4632 lw a2,12(sp) + 7a: 47c2 lw a5,16(sp) + 7c: 46a2 lw a3,8(sp) + +0000007e <.LVL7>: + 7e: 01c65513 srl a0,a2,0x1c + 82: 0792 sll a5,a5,0x4 + 84: 8fc9 or a5,a5,a0 + 86: c43e sw a5,8(sp) + +00000088 <.LBB11>: + 88: 00469793 sll a5,a3,0x4 + 8c: 8fcd or a5,a5,a1 + +0000008e <.LVL9>: + 8e: 82f1 srl a3,a3,0x1c + +00000090 <.LVL10>: + 90: 0612 sll a2,a2,0x4 + 92: 00f037b3 snez a5,a5 + +00000096 <.LVL11>: + 96: 8ed1 or a3,a3,a2 + +00000098 <.LBE11>: + 98: 8fd5 or a5,a5,a3 + +0000009a <.L6>: + 9a: 46a2 lw a3,8(sp) + +0000009c <.L17>: + 9c: 0077f613 and a2,a5,7 + a0: ce01 beqz a2,b8 <.L18> + +000000a2 <.LVL14>: + a2: 00f7f613 and a2,a5,15 + a6: 4591 li a1,4 + a8: 00b60863 beq a2,a1,b8 <.L18> + +000000ac <.LBB14>: + ac: 00478613 add a2,a5,4 + b0: 00f635b3 sltu a1,a2,a5 + b4: 96ae add a3,a3,a1 + b6: 87b2 mv a5,a2 + +000000b8 <.L18>: + b8: 00800637 lui a2,0x800 + bc: 8e75 and a2,a2,a3 + be: 16060763 beqz a2,22c <.L7> + c2: ff8005b7 lui a1,0xff800 + c6: 15fd add a1,a1,-1 # ff7fffff <.LLST14+0xff7ffaf9> + c8: 0705 add a4,a4,1 + ca: 7ff00513 li a0,2047 + ce: 8df5 and a1,a1,a3 + +000000d0 <.LVL16>: + d0: 4601 li a2,0 + d2: 4681 li a3,0 + d4: 00a70863 beq a4,a0,e4 <.L4> + d8: 838d srl a5,a5,0x3 + +000000da <.LVL17>: + da: 01d59613 sll a2,a1,0x1d + de: 8e5d or a2,a2,a5 + +000000e0 <.LVL18>: + e0: 0035d693 srl a3,a1,0x3 + +000000e4 <.L4>: + e4: 7ff007b7 lui a5,0x7ff00 + e8: 0752 sll a4,a4,0x14 + ea: 06b2 sll a3,a3,0xc + +000000ec <.LBE22>: + ec: 5452 lw s0,52(sp) + +000000ee <.LBB23>: + ee: 8f7d and a4,a4,a5 + f0: 82b1 srl a3,a3,0xc + f2: 01f49793 sll a5,s1,0x1f + f6: 8f55 or a4,a4,a3 + f8: 00f766b3 or a3,a4,a5 + +000000fc <.LBE23>: + fc: 54c2 lw s1,48(sp) + +000000fe <.LVL22>: + fe: 8532 mv a0,a2 + 100: 85b6 mv a1,a3 + 102: 03810113 add sp,sp,56 + +00000106 <.LVL23>: + 106: 8082 ret + +00000108 <.L5>: + 108: fcc00793 li a5,-52 + 10c: 10f74d63 blt a4,a5,226 <.L22> + 110: 47c2 lw a5,16(sp) + 112: 00080537 lui a0,0x80 + +00000116 <.LBB24>: + 116: 85b6 mv a1,a3 + +00000118 <.LBE24>: + 118: 8fc9 or a5,a5,a0 + 11a: c03e sw a5,0(sp) + 11c: c83e sw a5,16(sp) + +0000011e <.LBB26>: + 11e: 03d00793 li a5,61 + 122: 40e78733 sub a4,a5,a4 + +00000126 <.LVL25>: + 126: 40575313 sra t1,a4,0x5 + +0000012a <.LVL26>: + 12a: 4601 li a2,0 + 12c: 8b7d and a4,a4,31 + +0000012e <.LVL27>: + 12e: 4781 li a5,0 + +00000130 <.L8>: + 130: 0005a283 lw t0,0(a1) + 134: 0605 add a2,a2,1 # 800001 <.LLST14+0x7ffafb> + +00000136 <.LVL29>: + 136: 0591 add a1,a1,4 + 138: 0057e7b3 or a5,a5,t0 + +0000013c <.LVL30>: + 13c: fec31ae3 bne t1,a2,130 <.L8> + 140: 460d li a2,3 + +00000142 <.LVL31>: + 142: 40660633 sub a2,a2,t1 + 146: 00231593 sll a1,t1,0x2 + 14a: ef09 bnez a4,164 <.L9> + +0000014c <.L10>: + 14c: 00b68533 add a0,a3,a1 + 150: 4108 lw a0,0(a0) + 152: 0705 add a4,a4,1 + +00000154 <.LVL33>: + 154: c288 sw a0,0(a3) + +00000156 <.LVL34>: + 156: 0691 add a3,a3,4 + 158: fee65ae3 bge a2,a4,14c <.L10> + 15c: 4691 li a3,4 + 15e: 406686b3 sub a3,a3,t1 + 162: a089 j 1a4 <.L14> + +00000164 <.L9>: + 164: 02c58413 add s0,a1,44 + 168: 0048 add a0,sp,4 + 16a: 00a402b3 add t0,s0,a0 + 16e: fd42a283 lw t0,-44(t0) + 172: 02000393 li t2,32 + 176: 40e383b3 sub t2,t2,a4 + 17a: 007292b3 sll t0,t0,t2 + 17e: 0057e7b3 or a5,a5,t0 + +00000182 <.LVL36>: + 182: 95b6 add a1,a1,a3 + 184: 4401 li s0,0 + +00000186 <.L12>: + 186: 04c44963 blt s0,a2,1d8 <.L13> + 18a: 060a sll a2,a2,0x2 + 18c: 004c add a1,sp,4 + 18e: 02c60613 add a2,a2,44 + 192: 962e add a2,a2,a1 + 194: 4582 lw a1,0(sp) + 196: 4691 li a3,4 + 198: 406686b3 sub a3,a3,t1 + +0000019c <.LVL38>: + 19c: 00e5d533 srl a0,a1,a4 + 1a0: fca62a23 sw a0,-44(a2) + +000001a4 <.L14>: + 1a4: 4711 li a4,4 + 1a6: 8f15 sub a4,a4,a3 + 1a8: 068a sll a3,a3,0x2 + +000001aa <.LVL40>: + 1aa: 0691 add a3,a3,4 + 1ac: 070a sll a4,a4,0x2 + 1ae: 4621 li a2,8 + 1b0: 968a add a3,a3,sp + 1b2: 00c76863 bltu a4,a2,1c2 <.L15> + 1b6: 0006a023 sw zero,0(a3) + 1ba: 0006a223 sw zero,4(a3) + 1be: 1761 add a4,a4,-8 + 1c0: 06a1 add a3,a3,8 + +000001c2 <.L15>: + 1c2: 4611 li a2,4 + 1c4: 00c76463 bltu a4,a2,1cc <.L16> + 1c8: 0006a023 sw zero,0(a3) + +000001cc <.L16>: + 1cc: 4712 lw a4,4(sp) + +000001ce <.LBB27>: + 1ce: 00f037b3 snez a5,a5 + +000001d2 <.LBE27>: + 1d2: 8fd9 or a5,a5,a4 + +000001d4 <.LBE29>: + 1d4: 4701 li a4,0 + 1d6: b5d1 j 9a <.L6> + +000001d8 <.L13>: + 1d8: 0005a283 lw t0,0(a1) + 1dc: 0405 add s0,s0,1 + +000001de <.LVL44>: + 1de: 0591 add a1,a1,4 + 1e0: 00e2d533 srl a0,t0,a4 + 1e4: 0005a283 lw t0,0(a1) + 1e8: 007292b3 sll t0,t0,t2 + 1ec: 005562b3 or t0,a0,t0 + 1f0: 0056a023 sw t0,0(a3) + +000001f4 <.LVL45>: + 1f4: 0691 add a3,a3,4 + 1f6: bf41 j 186 <.L12> + +000001f8 <.L3>: + 1f8: cf31 beqz a4,254 <.L23> + +000001fa <.LBB12>: + 1fa: 47a2 lw a5,8(sp) + 1fc: 46b2 lw a3,12(sp) + 1fe: 4742 lw a4,16(sp) + +00000200 <.LBE12>: + 200: 00f6e633 or a2,a3,a5 + 204: 8e59 or a2,a2,a4 + 206: 8e4d or a2,a2,a1 + 208: ca29 beqz a2,25a <.L24> + +0000020a <.LBB32>: + 20a: 00469613 sll a2,a3,0x4 + 20e: 0712 sll a4,a4,0x4 + +00000210 <.LVL49>: + 210: 83f1 srl a5,a5,0x1c + +00000212 <.LVL50>: + 212: 82f1 srl a3,a3,0x1c + +00000214 <.LVL51>: + 214: 8ed9 or a3,a3,a4 + +00000216 <.LVL52>: + 216: 8fd1 or a5,a5,a2 + +00000218 <.LBE33>: + 218: 00400737 lui a4,0x400 + 21c: 8ed9 or a3,a3,a4 + +0000021e <.LVL54>: + 21e: 9be1 and a5,a5,-8 + +00000220 <.LVL55>: + 220: 7ff00713 li a4,2047 + 224: bda5 j 9c <.L17> + +00000226 <.L22>: + 226: 4701 li a4,0 + +00000228 <.LBB17>: + 228: 4795 li a5,5 + 22a: 4681 li a3,0 + +0000022c <.L7>: + 22c: 838d srl a5,a5,0x3 + +0000022e <.LVL59>: + 22e: 01d69613 sll a2,a3,0x1d + 232: 8e5d or a2,a2,a5 + +00000234 <.LVL60>: + 234: 7ff00793 li a5,2047 + 238: 828d srl a3,a3,0x3 + 23a: eaf715e3 bne a4,a5,e4 <.L4> + +0000023e <.LVL62>: + 23e: 8e55 or a2,a2,a3 + 240: 4681 li a3,0 + 242: ea0601e3 beqz a2,e4 <.L4> + 246: 000806b7 lui a3,0x80 + 24a: 4601 li a2,0 + 24c: 4481 li s1,0 + +0000024e <.LVL63>: + 24e: bd59 j e4 <.L4> + +00000250 <.L21>: + 250: 7ff00713 li a4,2047 + +00000254 <.L23>: + 254: 4681 li a3,0 + 256: 4601 li a2,0 + 258: b571 j e4 <.L4> + +0000025a <.L24>: + 25a: 4681 li a3,0 + +0000025c <.LBE35>: + 25c: 7ff00713 li a4,2047 + 260: b551 j e4 <.L4> + +save-restore.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__riscv_save_0>: + 0: 1151 add sp,sp,-12 + 2: c026 sw s1,0(sp) + 4: c222 sw s0,4(sp) + 6: c406 sw ra,8(sp) + 8: 8282 jr t0 + +0000000a <__riscv_restore_0>: + a: 4482 lw s1,0(sp) + c: 4412 lw s0,4(sp) + e: 40a2 lw ra,8(sp) + 10: 0131 add sp,sp,12 + 12: 8082 ret + +muldi3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__mulsi3-0x2>: + 0: 0001 nop + +00000002 <__mulsi3>: + 2: 862a mv a2,a0 + 4: 4501 li a0,0 + +00000006 <.L1>: + 6: 0015f693 and a3,a1,1 + a: c291 beqz a3,e <.L2> + c: 9532 add a0,a0,a2 + +0000000e <.L2>: + e: 8185 srl a1,a1,0x1 + 10: 0606 sll a2,a2,0x1 + 12: f9f5 bnez a1,6 <.L1> + 14: 8082 ret + ... + +multi3.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__muldi3>: + 0: 1151 add sp,sp,-12 + 2: c222 sw s0,4(sp) + 4: 842a mv s0,a0 + 6: 83b6 mv t2,a3 + 8: c406 sw ra,8(sp) + a: c026 sw s1,0(sp) + c: 8532 mv a0,a2 + +0000000e <.LVL1>: + e: 82a2 mv t0,s0 + +00000010 <.LVL2>: + 10: 86b2 mv a3,a2 + 12: 4701 li a4,0 + 14: 4781 li a5,0 + 16: 4301 li t1,0 + +00000018 <.L5>: + 18: 0016f493 and s1,a3,1 + 1c: 00171613 sll a2,a4,0x1 + +00000020 <.LVL4>: + 20: c491 beqz s1,2c <.L2> + 22: 9316 add t1,t1,t0 + +00000024 <.LVL5>: + 24: 973e add a4,a4,a5 + +00000026 <.LVL6>: + 26: 005337b3 sltu a5,t1,t0 + +0000002a <.LVL7>: + 2a: 97ba add a5,a5,a4 + +0000002c <.L2>: + 2c: 01f2d713 srl a4,t0,0x1f + 30: 8285 srl a3,a3,0x1 + 32: 8f51 or a4,a4,a2 + 34: 0286 sll t0,t0,0x1 + +00000036 <.LVL10>: + 36: f2ed bnez a3,18 <.L5> + 38: c591 beqz a1,44 <.L6> + +0000003a <.LBB2>: + 3a: 00000097 auipc ra,0x0 + 3e: 000080e7 jalr ra # 3a <.LBB2> + +00000042 <.LBE2>: + 42: 97aa add a5,a5,a0 + +00000044 <.L6>: + 44: 00038963 beqz t2,56 <.L7> + +00000048 <.LBB3>: + 48: 8522 mv a0,s0 + 4a: 859e mv a1,t2 + 4c: 00000097 auipc ra,0x0 + 50: 000080e7 jalr ra # 4c <.LBB3+0x4> + +00000054 <.LBE3>: + 54: 97aa add a5,a5,a0 + +00000056 <.L7>: + 56: 40a2 lw ra,8(sp) + 58: 4412 lw s0,4(sp) + 5a: 4482 lw s1,0(sp) + 5c: 851a mv a0,t1 + 5e: 85be mv a1,a5 + 60: 0131 add sp,sp,12 + 62: 8082 ret + +div.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__divsi3-0x2>: + 0: 0001 nop + +00000002 <__divsi3>: + 2: 02054e63 bltz a0,3e <.L10> + 6: 0405c363 bltz a1,4c <.L11> + +0000000a <__hidden___udivsi3>: + a: 862e mv a2,a1 + c: 85aa mv a1,a0 + e: 557d li a0,-1 + 10: c215 beqz a2,34 <.L5> + 12: 4685 li a3,1 + 14: 00b67863 bgeu a2,a1,24 <.L2> + +00000018 <.L1>: + 18: 00c05663 blez a2,24 <.L2> + 1c: 0606 sll a2,a2,0x1 + 1e: 0686 sll a3,a3,0x1 + 20: feb66ce3 bltu a2,a1,18 <.L1> + +00000024 <.L2>: + 24: 4501 li a0,0 + +00000026 <.L3>: + 26: 00c5e463 bltu a1,a2,2e <.L4> + 2a: 8d91 sub a1,a1,a2 + 2c: 8d55 or a0,a0,a3 + +0000002e <.L4>: + 2e: 8285 srl a3,a3,0x1 + 30: 8205 srl a2,a2,0x1 + 32: faf5 bnez a3,26 <.L3> + +00000034 <.L5>: + 34: 8082 ret + +00000036 <__umodsi3>: + 36: 8286 mv t0,ra + 38: 3fc9 jal a <__hidden___udivsi3> + 3a: 852e mv a0,a1 + 3c: 8282 jr t0 + +0000003e <.L10>: + 3e: 40a00533 neg a0,a0 + 42: 00b04763 bgtz a1,50 <.L12> + 46: 40b005b3 neg a1,a1 + 4a: b7c1 j a <__hidden___udivsi3> + +0000004c <.L11>: + 4c: 40b005b3 neg a1,a1 + +00000050 <.L12>: + 50: 8286 mv t0,ra + 52: 3f65 jal a <__hidden___udivsi3> + 54: 40a00533 neg a0,a0 + 58: 8282 jr t0 + +0000005a <__modsi3>: + 5a: 8286 mv t0,ra + 5c: 0005c763 bltz a1,6a <.L31> + 60: 00054963 bltz a0,72 <.L32> + +00000064 <.L30>: + 64: 375d jal a <__hidden___udivsi3> + 66: 852e mv a0,a1 + 68: 8282 jr t0 + +0000006a <.L31>: + 6a: 40b005b3 neg a1,a1 + 6e: fe055be3 bgez a0,64 <.L30> + +00000072 <.L32>: + 72: 40a00533 neg a0,a0 + 76: 3f51 jal a <__hidden___udivsi3> + 78: 40b00533 neg a0,a1 + 7c: 8282 jr t0 + ... + +atomic.o: file format elf32-littleriscv + + +enable-execute-stack.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__enable_execute_stack>: + 0: 8082 ret + +unwind-dw2.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 : + 0: 4701 li a4,0 + 2: 4681 li a3,0 + +00000004 <.L2>: + 4: 00054783 lbu a5,0(a0) + 8: 0505 add a0,a0,1 + +0000000a <.LVL2>: + a: 07f7f613 and a2,a5,127 + e: 07e2 sll a5,a5,0x18 + +00000010 <.LVL3>: + 10: 00d61633 sll a2,a2,a3 + 14: 87e1 sra a5,a5,0x18 + 16: 8f51 or a4,a4,a2 + 18: 069d add a3,a3,7 + 1a: fe07c5e3 bltz a5,4 <.L2> + 1e: c198 sw a4,0(a1) + +00000020 <.LVL6>: + 20: 8082 ret + +00000022 : + 22: 4781 li a5,0 + 24: 4701 li a4,0 + +00000026 <.L5>: + 26: 00054683 lbu a3,0(a0) + 2a: 0505 add a0,a0,1 + +0000002c <.LVL9>: + 2c: 07f6f613 and a2,a3,127 + 30: 00e61633 sll a2,a2,a4 + 34: 8fd1 or a5,a5,a2 + 36: 01869613 sll a2,a3,0x18 + 3a: 8661 sra a2,a2,0x18 + 3c: 071d add a4,a4,7 + 3e: fe0644e3 bltz a2,26 <.L5> + 42: 467d li a2,31 + 44: 00e66963 bltu a2,a4,56 <.L6> + 48: 0406f693 and a3,a3,64 + +0000004c <.LVL12>: + 4c: c689 beqz a3,56 <.L6> + 4e: 56fd li a3,-1 + 50: 00e69733 sll a4,a3,a4 + +00000054 <.LVL13>: + 54: 8fd9 or a5,a5,a4 + +00000056 <.L6>: + 56: c19c sw a5,0(a1) + +00000058 <.LVL15>: + 58: 8082 ret + +0000005a <_Unwind_GetGRPtr>: + 5a: 12452703 lw a4,292(a0) + 5e: 400007b7 lui a5,0x40000 + 62: 8ff9 and a5,a5,a4 + 64: 00259713 sll a4,a1,0x2 + +00000068 <.LBE126>: + 68: c799 beqz a5,76 <.L12> + 6a: 95aa add a1,a1,a0 + +0000006c <.LVL17>: + 6c: 1305c783 lbu a5,304(a1) + 70: c399 beqz a5,76 <.L12> + 72: 953a add a0,a0,a4 + +00000074 <.LVL18>: + 74: 8082 ret + +00000076 <.L12>: + 76: 953a add a0,a0,a4 + +00000078 <.LVL20>: + 78: 4108 lw a0,0(a0) + 7a: 8082 ret + +0000007c <_Unwind_SetGRPtr>: + 7c: 12452703 lw a4,292(a0) + 80: 400007b7 lui a5,0x40000 + 84: 8ff9 and a5,a5,a4 + +00000086 <.LBE128>: + 86: c789 beqz a5,90 <.L21> + 88: 00b507b3 add a5,a0,a1 + 8c: 12078823 sb zero,304(a5) # 40000130 <.LLST185+0x3fffda08> + +00000090 <.L21>: + 90: 058a sll a1,a1,0x2 + +00000092 <.LVL22>: + 92: 952e add a0,a0,a1 + +00000094 <.LVL23>: + 94: c110 sw a2,0(a0) + 96: 8082 ret + +00000098 <_Unwind_SetGRValue>: + 98: 04300793 li a5,67 + 9c: 00f59863 bne a1,a5,ac <.L26> + +000000a0 <.L27>: + a0: 1151 add sp,sp,-12 + a2: c406 sw ra,8(sp) + a4: 00000097 auipc ra,0x0 + a8: 000080e7 jalr ra # a4 <.L27+0x4> + +000000ac <.L26>: + ac: 000007b7 lui a5,0x0 + b0: 00078793 mv a5,a5 + b4: 97ae add a5,a5,a1 + b6: 0007c703 lbu a4,0(a5) # 0 + ba: 4791 li a5,4 + bc: fee7e2e3 bltu a5,a4,a0 <.L27> + c0: 00b507b3 add a5,a0,a1 + c4: 4705 li a4,1 + c6: 058a sll a1,a1,0x2 + +000000c8 <.LVL26>: + c8: 12e78823 sb a4,304(a5) + +000000cc <.LBB130>: + cc: 952e add a0,a0,a1 + +000000ce <.LVL28>: + ce: c110 sw a2,0(a0) + d0: 8082 ret + +000000d2 : + d2: 1111 add sp,sp,-28 + d4: cc06 sw ra,24(sp) + d6: ca22 sw s0,20(sp) + d8: c826 sw s1,16(sp) + da: c036 sw a3,0(sp) + +000000dc <.LBB155>: + dc: 0ff00793 li a5,255 + e0: 02f58363 beq a1,a5,106 <.L31> + e4: 0705f693 and a3,a1,112 + +000000e8 <.LVL30>: + e8: 03000793 li a5,48 + ec: 842e mv s0,a1 + ee: 84b2 mv s1,a2 + f0: 04f68b63 beq a3,a5,146 <.L32> + f4: 00d7ed63 bltu a5,a3,10e <.L33> + f8: 02000793 li a5,32 + fc: 04f68263 beq a3,a5,140 <.L34> + 100: 4601 li a2,0 + +00000102 <.LVL31>: + 102: 00d7ff63 bgeu a5,a3,120 <.L35> + +00000106 <.L31>: + 106: 00000097 auipc ra,0x0 + 10a: 000080e7 jalr ra # 106 <.L31> + +0000010e <.L33>: + 10e: 04000793 li a5,64 + 112: 02f68d63 beq a3,a5,14c <.L36> + 116: 05000793 li a5,80 + 11a: 4601 li a2,0 + 11c: fef695e3 bne a3,a5,106 <.L31> + +00000120 <.L35>: + 120: 05000793 li a5,80 + 124: 02f41763 bne s0,a5,152 <.L37> + +00000128 <.LBB158>: + 128: 00348513 add a0,s1,3 + +0000012c <.LVL36>: + 12c: 9971 and a0,a0,-4 + +0000012e <.LVL37>: + 12e: 411c lw a5,0(a0) + +00000130 <.LVL38>: + 130: 0511 add a0,a0,4 + +00000132 <.L38>: + 132: 4702 lw a4,0(sp) + +00000134 <.LBE156>: + 134: 40e2 lw ra,24(sp) + 136: 4452 lw s0,20(sp) + +00000138 <.LBB164>: + 138: c31c sw a5,0(a4) + +0000013a <.LBE164>: + 13a: 44c2 lw s1,16(sp) + +0000013c <.LVL41>: + 13c: 0171 add sp,sp,28 + +0000013e <.LVL42>: + 13e: 8082 ret + +00000140 <.L34>: + 140: 11852603 lw a2,280(a0) + +00000144 <.LBE147>: + 144: bff1 j 120 <.L35> + +00000146 <.L32>: + 146: 11c52603 lw a2,284(a0) + +0000014a <.LBE149>: + 14a: bfd9 j 120 <.L35> + +0000014c <.L36>: + 14c: 12052603 lw a2,288(a0) + +00000150 <.LBE151>: + 150: bfc1 j 120 <.L35> + +00000152 <.L37>: + 152: 00f47793 and a5,s0,15 + 156: 45b1 li a1,12 + +00000158 <.LVL50>: + 158: faf5e7e3 bltu a1,a5,106 <.L31> + 15c: 000005b7 lui a1,0x0 + 160: 078a sll a5,a5,0x2 + 162: 00058593 mv a1,a1 + 166: 97ae add a5,a5,a1 + 168: 439c lw a5,0(a5) + 16a: 8782 jr a5 + +0000016c <.L47>: + 16c: 006c add a1,sp,12 + 16e: 8526 mv a0,s1 + +00000170 <.LVL51>: + 170: c436 sw a3,8(sp) + 172: c232 sw a2,4(sp) + 174: 00000097 auipc ra,0x0 + 178: 000080e7 jalr ra # 174 <.LVL51+0x4> + +0000017c <.L56>: + 17c: 47b2 lw a5,12(sp) + +0000017e <.LBE160>: + 17e: 4612 lw a2,4(sp) + 180: 46a2 lw a3,8(sp) + +00000182 <.L49>: + 182: dbc5 beqz a5,132 <.L38> + 184: 45c1 li a1,16 + 186: 00b69363 bne a3,a1,18c <.L50> + 18a: 8626 mv a2,s1 + +0000018c <.L50>: + 18c: 01841713 sll a4,s0,0x18 + 190: 8761 sra a4,a4,0x18 + 192: 97b2 add a5,a5,a2 + 194: f8075fe3 bgez a4,132 <.L38> + 198: 439c lw a5,0(a5) + 19a: bf61 j 132 <.L38> + +0000019c <.L43>: + 19c: 006c add a1,sp,12 + 19e: 8526 mv a0,s1 + +000001a0 <.LVL58>: + 1a0: c436 sw a3,8(sp) + 1a2: c232 sw a2,4(sp) + 1a4: 00000097 auipc ra,0x0 + 1a8: 000080e7 jalr ra # 1a4 <.LVL58+0x4> + +000001ac <.LVL59>: + 1ac: bfc1 j 17c <.L56> + +000001ae <.L46>: + 1ae: 0014c783 lbu a5,1(s1) + 1b2: 0004c583 lbu a1,0(s1) + 1b6: 07a2 sll a5,a5,0x8 + 1b8: 8fcd or a5,a5,a1 + +000001ba <.L57>: + 1ba: 00248513 add a0,s1,2 + +000001be <.LVL62>: + 1be: b7d1 j 182 <.L49> + +000001c0 <.L42>: + 1c0: 0014c783 lbu a5,1(s1) + 1c4: 0004c583 lbu a1,0(s1) + 1c8: 07a2 sll a5,a5,0x8 + 1ca: 8fcd or a5,a5,a1 + 1cc: 07c2 sll a5,a5,0x10 + 1ce: 87c1 sra a5,a5,0x10 + 1d0: b7ed j 1ba <.L57> + +000001d2 <.L41>: + 1d2: 0014c783 lbu a5,1(s1) + 1d6: 0004c583 lbu a1,0(s1) + 1da: 00448513 add a0,s1,4 + +000001de <.LVL64>: + 1de: 07a2 sll a5,a5,0x8 + 1e0: 8fcd or a5,a5,a1 + 1e2: 0024c583 lbu a1,2(s1) + 1e6: 05c2 sll a1,a1,0x10 + 1e8: 8ddd or a1,a1,a5 + 1ea: 0034c783 lbu a5,3(s1) + 1ee: 07e2 sll a5,a5,0x18 + 1f0: 8fcd or a5,a5,a1 + +000001f2 <.LVL65>: + 1f2: bf41 j 182 <.L49> + +000001f4 <.L39>: + 1f4: 0014c783 lbu a5,1(s1) + 1f8: 0004c583 lbu a1,0(s1) + 1fc: 00848513 add a0,s1,8 + +00000200 <.LVL67>: + 200: 07a2 sll a5,a5,0x8 + 202: 8fcd or a5,a5,a1 + 204: 0024c583 lbu a1,2(s1) + 208: 05c2 sll a1,a1,0x10 + 20a: 8ddd or a1,a1,a5 + 20c: 0034c783 lbu a5,3(s1) + 210: 07e2 sll a5,a5,0x18 + 212: 8fcd or a5,a5,a1 + +00000214 <.LVL68>: + 214: b7bd j 182 <.L49> + +00000216 : + 216: fd410113 add sp,sp,-44 + 21a: d222 sw s0,36(sp) + 21c: d026 sw s1,32(sp) + 21e: d406 sw ra,40(sp) + 220: 1060 add s0,sp,44 + 222: 832a mv t1,a0 + 224: fcb42c23 sw a1,-40(s0) + 228: fcc42e23 sw a2,-36(s0) + 22c: 84b6 mv s1,a3 + 22e: 2006ac23 sw zero,536(a3) + 232: fe042223 sw zero,-28(s0) + +00000236 <.L59>: + 236: fd842783 lw a5,-40(s0) + 23a: 02f37263 bgeu t1,a5,25e <.L58> + 23e: 22c4a783 lw a5,556(s1) + 242: fef42023 sw a5,-32(s0) + +00000246 <.LBB167>: + 246: fdc42783 lw a5,-36(s0) + 24a: 1247a703 lw a4,292(a5) + +0000024e <.LBE167>: + 24e: 1107a783 lw a5,272(a5) + +00000252 <.LBB170>: + 252: 837d srl a4,a4,0x1f + +00000254 <.LBE170>: + 254: 97ba add a5,a5,a4 + 256: fe042703 lw a4,-32(s0) + 25a: 00f76a63 bltu a4,a5,26e <.L116> + +0000025e <.L58>: + 25e: fd440113 add sp,s0,-44 + 262: 50a2 lw ra,40(sp) + 264: 5412 lw s0,36(sp) + +00000266 <.LVL72>: + 266: 5482 lw s1,32(sp) + +00000268 <.LVL73>: + 268: 02c10113 add sp,sp,44 + 26c: 8082 ret + +0000026e <.L116>: + 26e: 00034703 lbu a4,0(t1) + 272: 04000613 li a2,64 + 276: 00130793 add a5,t1,1 + +0000027a <.LVL75>: + 27a: 0c077693 and a3,a4,192 + 27e: 02c69463 bne a3,a2,2a6 <.L60> + 282: 2384a583 lw a1,568(s1) + 286: fcf42a23 sw a5,-44(s0) + 28a: 03f77513 and a0,a4,63 + 28e: 00000097 auipc ra,0x0 + 292: 000080e7 jalr ra # 28e <.LVL75+0x14> + +00000296 <.LVL76>: + 296: fe042783 lw a5,-32(s0) + 29a: 953e add a0,a0,a5 + 29c: 22a4a623 sw a0,556(s1) + +000002a0 <.L120>: + 2a0: fd442783 lw a5,-44(s0) + 2a4: a859 j 33a <.L64> + +000002a6 <.L60>: + 2a6: 08000613 li a2,128 + 2aa: 04c69163 bne a3,a2,2ec <.L63> + 2ae: fec40593 add a1,s0,-20 + 2b2: 853e mv a0,a5 + 2b4: fce42a23 sw a4,-44(s0) + 2b8: 00000097 auipc ra,0x0 + 2bc: 000080e7 jalr ra # 2b8 <.L60+0x12> + +000002c0 <.LVL78>: + 2c0: fea42023 sw a0,-32(s0) + 2c4: fec42583 lw a1,-20(s0) + 2c8: 2344a503 lw a0,564(s1) + +000002cc <.LVL79>: + 2cc: 00000097 auipc ra,0x0 + 2d0: 000080e7 jalr ra # 2cc <.LVL79> + +000002d4 <.LVL80>: + 2d4: fd442703 lw a4,-44(s0) + 2d8: 4685 li a3,1 + 2da: 03f77713 and a4,a4,63 + 2de: 070e sll a4,a4,0x3 + 2e0: 9726 add a4,a4,s1 + 2e2: c354 sw a3,4(a4) + 2e4: c308 sw a0,0(a4) + +000002e6 <.L119>: + 2e6: fe042783 lw a5,-32(s0) + 2ea: a881 j 33a <.L64> + +000002ec <.L63>: + 2ec: 0c000613 li a2,192 + 2f0: 00c69963 bne a3,a2,302 <.L65> + 2f4: 03f77713 and a4,a4,63 + +000002f8 <.L124>: + 2f8: 070e sll a4,a4,0x3 + 2fa: 9726 add a4,a4,s1 + 2fc: 00072223 sw zero,4(a4) + 300: a82d j 33a <.L64> + +00000302 <.L65>: + 302: 02f00693 li a3,47 + 306: 44e6e863 bltu a3,a4,756 <.L66> + 30a: 000006b7 lui a3,0x0 + 30e: 070a sll a4,a4,0x2 + +00000310 <.LVL85>: + 310: 00068693 mv a3,a3 + 314: 9736 add a4,a4,a3 + 316: 4318 lw a4,0(a4) + 318: 8702 jr a4 + +0000031a <.L92>: + 31a: 2404c583 lbu a1,576(s1) + 31e: fdc42503 lw a0,-36(s0) + 322: 863e mv a2,a5 + 324: ff040693 add a3,s0,-16 + 328: 00000097 auipc ra,0x0 + 32c: 000080e7 jalr ra # 328 <.L92+0xe> + +00000330 <.LVL86>: + 330: ff042703 lw a4,-16(s0) + 334: 87aa mv a5,a0 + 336: 22e4a623 sw a4,556(s1) + +0000033a <.L64>: + 33a: 833e mv t1,a5 + 33c: bded j 236 <.L59> + +0000033e <.L91>: + 33e: 00134503 lbu a0,1(t1) + 342: 2384a583 lw a1,568(s1) + 346: fc642a23 sw t1,-44(s0) + 34a: 00000097 auipc ra,0x0 + 34e: 000080e7 jalr ra # 34a <.L91+0xc> + +00000352 <.LVL89>: + 352: fe042783 lw a5,-32(s0) + 356: fd442303 lw t1,-44(s0) + 35a: 953e add a0,a0,a5 + 35c: 22a4a623 sw a0,556(s1) + +00000360 <.LVL90>: + 360: 00230793 add a5,t1,2 + +00000364 <.LVL91>: + 364: bfd9 j 33a <.L64> + +00000366 <.L90>: + 366: 00234783 lbu a5,2(t1) + +0000036a <.LVL93>: + 36a: 00134503 lbu a0,1(t1) + +0000036e <.LBE175>: + 36e: 2384a583 lw a1,568(s1) + +00000372 <.LBB178>: + 372: 07a2 sll a5,a5,0x8 + 374: fc642a23 sw t1,-44(s0) + +00000378 <.LBE178>: + 378: 8d5d or a0,a0,a5 + 37a: 00000097 auipc ra,0x0 + 37e: 000080e7 jalr ra # 37a <.LBE178+0x2> + +00000382 <.LVL94>: + 382: fe042783 lw a5,-32(s0) + 386: fd442303 lw t1,-44(s0) + 38a: 953e add a0,a0,a5 + 38c: 22a4a623 sw a0,556(s1) + +00000390 <.LVL95>: + 390: 00330793 add a5,t1,3 + +00000394 <.LVL96>: + 394: b75d j 33a <.L64> + +00000396 <.L89>: + 396: 00234703 lbu a4,2(t1) + 39a: 00134783 lbu a5,1(t1) + +0000039e <.LVL98>: + 39e: 00434503 lbu a0,4(t1) + 3a2: 0722 sll a4,a4,0x8 + 3a4: 8f5d or a4,a4,a5 + 3a6: 00334783 lbu a5,3(t1) + +000003aa <.LBE179>: + 3aa: 2384a583 lw a1,568(s1) + +000003ae <.LBB182>: + 3ae: 0562 sll a0,a0,0x18 + 3b0: 07c2 sll a5,a5,0x10 + 3b2: 8fd9 or a5,a5,a4 + 3b4: fc642a23 sw t1,-44(s0) + +000003b8 <.LBE182>: + 3b8: 8d5d or a0,a0,a5 + 3ba: 00000097 auipc ra,0x0 + 3be: 000080e7 jalr ra # 3ba <.LBE182+0x2> + +000003c2 <.LVL99>: + 3c2: fe042783 lw a5,-32(s0) + 3c6: fd442303 lw t1,-44(s0) + 3ca: 953e add a0,a0,a5 + 3cc: 22a4a623 sw a0,556(s1) + +000003d0 <.LVL100>: + 3d0: 00530793 add a5,t1,5 + +000003d4 <.LVL101>: + 3d4: b79d j 33a <.L64> + +000003d6 <.L88>: + 3d6: fe840593 add a1,s0,-24 + 3da: 853e mv a0,a5 + 3dc: 00000097 auipc ra,0x0 + 3e0: 000080e7 jalr ra # 3dc <.L88+0x6> + +000003e4 <.LVL103>: + 3e4: fec40593 add a1,s0,-20 + 3e8: 00000097 auipc ra,0x0 + 3ec: 000080e7 jalr ra # 3e8 <.LVL103+0x4> + +000003f0 <.LVL104>: + 3f0: fec42583 lw a1,-20(s0) + 3f4: fea42023 sw a0,-32(s0) + +000003f8 <.L134>: + 3f8: 2344a503 lw a0,564(s1) + +000003fc <.LVL106>: + 3fc: 00000097 auipc ra,0x0 + 400: 000080e7 jalr ra # 3fc <.LVL106> + +00000404 <.LVL107>: + 404: fe842703 lw a4,-24(s0) + 408: 04200693 li a3,66 + 40c: fe042783 lw a5,-32(s0) + 410: f2e6e5e3 bltu a3,a4,33a <.L64> + 414: 070e sll a4,a4,0x3 + 416: 9726 add a4,a4,s1 + 418: 4685 li a3,1 + +0000041a <.L129>: + 41a: c354 sw a3,4(a4) + +0000041c <.L121>: + 41c: c308 sw a0,0(a4) + 41e: bf31 j 33a <.L64> + +00000420 <.L85>: + 420: 853e mv a0,a5 + 422: fe840593 add a1,s0,-24 + 426: 00000097 auipc ra,0x0 + 42a: 000080e7 jalr ra # 426 <.L85+0x6> + +0000042e <.LVL110>: + 42e: fe842703 lw a4,-24(s0) + 432: 04200693 li a3,66 + 436: 87aa mv a5,a0 + 438: ece6f0e3 bgeu a3,a4,2f8 <.L124> + 43c: bdfd j 33a <.L64> + +0000043e <.L86>: + 43e: 853e mv a0,a5 + 440: fe840593 add a1,s0,-24 + 444: 00000097 auipc ra,0x0 + 448: 000080e7 jalr ra # 444 <.L86+0x6> + +0000044c <.LVL112>: + 44c: fe842703 lw a4,-24(s0) + 450: 04200693 li a3,66 + 454: 87aa mv a5,a0 + 456: eee6e2e3 bltu a3,a4,33a <.L64> + 45a: 070e sll a4,a4,0x3 + 45c: 9726 add a4,a4,s1 + 45e: 4699 li a3,6 + 460: c354 sw a3,4(a4) + 462: bde1 j 33a <.L64> + +00000464 <.L84>: + 464: 853e mv a0,a5 + 466: fe840593 add a1,s0,-24 + 46a: 00000097 auipc ra,0x0 + 46e: 000080e7 jalr ra # 46a <.L84+0x6> + +00000472 <.LVL114>: + 472: ff040593 add a1,s0,-16 + 476: 00000097 auipc ra,0x0 + 47a: 000080e7 jalr ra # 476 <.LVL114+0x4> + +0000047e <.LVL115>: + 47e: fe842703 lw a4,-24(s0) + 482: 04200693 li a3,66 + 486: 87aa mv a5,a0 + +00000488 <.LVL116>: + 488: eae6e9e3 bltu a3,a4,33a <.L64> + 48c: 070e sll a4,a4,0x3 + 48e: 9726 add a4,a4,s1 + 490: 4689 li a3,2 + 492: c354 sw a3,4(a4) + 494: ff042683 lw a3,-16(s0) + 498: c314 sw a3,0(a4) + +0000049a <.LBE183>: + 49a: b545 j 33a <.L64> + +0000049c <.L83>: + 49c: fe442703 lw a4,-28(s0) + 4a0: c315 beqz a4,4c4 <.L102> + +000004a2 <.LVL118>: + 4a2: 21872683 lw a3,536(a4) + 4a6: fed42223 sw a3,-28(s0) + +000004aa <.L103>: + 4aa: 22c00613 li a2,556 + 4ae: 85a6 mv a1,s1 + 4b0: 853a mv a0,a4 + 4b2: fef42023 sw a5,-32(s0) + +000004b6 <.LVL120>: + 4b6: 00000097 auipc ra,0x0 + 4ba: 000080e7 jalr ra # 4b6 <.LVL120> + +000004be <.LVL121>: + 4be: 20a4ac23 sw a0,536(s1) + 4c2: b515 j 2e6 <.L119> + +000004c4 <.L102>: + 4c4: dc810113 add sp,sp,-568 + 4c8: 00f10713 add a4,sp,15 + 4cc: 9b41 and a4,a4,-16 + +000004ce <.LVL123>: + 4ce: bff1 j 4aa <.L103> + +000004d0 <.L82>: + 4d0: 2184a583 lw a1,536(s1) + 4d4: 22c00613 li a2,556 + 4d8: 8526 mv a0,s1 + 4da: fcf42a23 sw a5,-44(s0) + +000004de <.LVL125>: + 4de: feb42023 sw a1,-32(s0) + 4e2: 00000097 auipc ra,0x0 + 4e6: 000080e7 jalr ra # 4e2 <.LVL125+0x4> + +000004ea <.LVL126>: + 4ea: fe442783 lw a5,-28(s0) + 4ee: fe042583 lw a1,-32(s0) + 4f2: 20f5ac23 sw a5,536(a1) # 218 + +000004f6 <.LBE185>: + 4f6: feb42223 sw a1,-28(s0) + 4fa: b35d j 2a0 <.L120> + +000004fc <.L81>: + 4fc: fec40593 add a1,s0,-20 + 500: 853e mv a0,a5 + 502: 00000097 auipc ra,0x0 + 506: 000080e7 jalr ra # 502 <.L81+0x6> + +0000050a <.LVL129>: + 50a: fec42783 lw a5,-20(s0) + 50e: fec40593 add a1,s0,-20 + 512: 22f4a023 sw a5,544(s1) + 516: 00000097 auipc ra,0x0 + 51a: 000080e7 jalr ra # 516 <.LVL129+0xc> + +0000051e <.LVL130>: + 51e: fec42703 lw a4,-20(s0) + 522: 87aa mv a5,a0 + +00000524 <.LVL131>: + 524: 20e4ae23 sw a4,540(s1) + +00000528 <.L123>: + 528: 4705 li a4,1 + 52a: 22e4a423 sw a4,552(s1) + 52e: b531 j 33a <.L64> + +00000530 <.L80>: + 530: 853e mv a0,a5 + 532: fec40593 add a1,s0,-20 + 536: 00000097 auipc ra,0x0 + 53a: 000080e7 jalr ra # 536 <.L80+0x6> + +0000053e <.LVL133>: + 53e: fec42703 lw a4,-20(s0) + 542: 87aa mv a5,a0 + 544: 22e4a023 sw a4,544(s1) + 548: b7c5 j 528 <.L123> + +0000054a <.L79>: + 54a: 853e mv a0,a5 + 54c: fec40593 add a1,s0,-20 + 550: 00000097 auipc ra,0x0 + 554: 000080e7 jalr ra # 550 <.L79+0x6> + +00000558 <.LVL135>: + 558: fec42703 lw a4,-20(s0) + 55c: 87aa mv a5,a0 + 55e: 20e4ae23 sw a4,540(s1) + 562: bbe1 j 33a <.L64> + +00000564 <.L78>: + 564: 4709 li a4,2 + 566: 22f4a223 sw a5,548(s1) + +0000056a <.LVL137>: + 56a: 22e4a423 sw a4,552(s1) + 56e: fec40593 add a1,s0,-20 + 572: 853e mv a0,a5 + +00000574 <.L125>: + 574: 00000097 auipc ra,0x0 + 578: 000080e7 jalr ra # 574 <.L125> + +0000057c <.LVL139>: + 57c: fec42703 lw a4,-20(s0) + 580: 00e507b3 add a5,a0,a4 + +00000584 <.LVL140>: + 584: bb5d j 33a <.L64> + +00000586 <.L77>: + 586: 853e mv a0,a5 + 588: fe840593 add a1,s0,-24 + 58c: 00000097 auipc ra,0x0 + 590: 000080e7 jalr ra # 58c <.L77+0x6> + +00000594 <.LVL142>: + 594: fe842783 lw a5,-24(s0) + 598: 04200713 li a4,66 + 59c: 00f76763 bltu a4,a5,5aa <.L111> + 5a0: 078e sll a5,a5,0x3 + 5a2: 97a6 add a5,a5,s1 + 5a4: 470d li a4,3 + +000005a6 <.L127>: + 5a6: c3d8 sw a4,4(a5) + 5a8: c388 sw a0,0(a5) + +000005aa <.L111>: + 5aa: fec40593 add a1,s0,-20 + 5ae: b7d9 j 574 <.L125> + +000005b0 <.L76>: + 5b0: fe840593 add a1,s0,-24 + 5b4: 853e mv a0,a5 + 5b6: 00000097 auipc ra,0x0 + 5ba: 000080e7 jalr ra # 5b6 <.L76+0x6> + +000005be <.LVL144>: + 5be: ff040593 add a1,s0,-16 + 5c2: 00000097 auipc ra,0x0 + 5c6: 000080e7 jalr ra # 5c2 <.LVL144+0x4> + +000005ca <.LVL145>: + 5ca: ff042583 lw a1,-16(s0) + 5ce: fea42023 sw a0,-32(s0) + +000005d2 <.LVL146>: + 5d2: b51d j 3f8 <.L134> + +000005d4 <.L75>: + 5d4: fec40593 add a1,s0,-20 + 5d8: 853e mv a0,a5 + 5da: 00000097 auipc ra,0x0 + 5de: 000080e7 jalr ra # 5da <.L75+0x6> + +000005e2 <.LVL148>: + 5e2: fec42783 lw a5,-20(s0) + 5e6: 20048713 add a4,s1,512 + 5ea: ff040593 add a1,s0,-16 + 5ee: d31c sw a5,32(a4) + 5f0: fee42023 sw a4,-32(s0) + 5f4: 00000097 auipc ra,0x0 + 5f8: 000080e7 jalr ra # 5f4 <.LVL148+0x12> + +000005fc <.LVL149>: + 5fc: fe042703 lw a4,-32(s0) + 600: fca42a23 sw a0,-44(s0) + +00000604 <.LVL150>: + 604: ff042583 lw a1,-16(s0) + 608: 5b48 lw a0,52(a4) + +0000060a <.LVL151>: + 60a: 4685 li a3,1 + 60c: d714 sw a3,40(a4) + 60e: 00000097 auipc ra,0x0 + 612: 000080e7 jalr ra # 60e <.LVL151+0x4> + +00000616 <.LVL152>: + 616: fe042703 lw a4,-32(s0) + 61a: cf48 sw a0,28(a4) + 61c: b151 j 2a0 <.L120> + +0000061e <.L74>: + 61e: ff040593 add a1,s0,-16 + 622: 853e mv a0,a5 + 624: 00000097 auipc ra,0x0 + 628: 000080e7 jalr ra # 624 <.L74+0x6> + +0000062c <.LVL154>: + 62c: fea42023 sw a0,-32(s0) + 630: 2344a583 lw a1,564(s1) + 634: ff042503 lw a0,-16(s0) + +00000638 <.LVL155>: + 638: 00000097 auipc ra,0x0 + 63c: 000080e7 jalr ra # 638 <.LVL155> + +00000640 <.LVL156>: + 640: 20a4ae23 sw a0,540(s1) + 644: b14d j 2e6 <.L119> + +00000646 <.L73>: + 646: fe840593 add a1,s0,-24 + 64a: 853e mv a0,a5 + 64c: 00000097 auipc ra,0x0 + 650: 000080e7 jalr ra # 64c <.L73+0x6> + +00000654 <.LVL158>: + 654: fec40593 add a1,s0,-20 + 658: 00000097 auipc ra,0x0 + 65c: 000080e7 jalr ra # 658 <.LVL158+0x4> + +00000660 <.LVL159>: + 660: fec42583 lw a1,-20(s0) + 664: fea42023 sw a0,-32(s0) + +00000668 <.L131>: + 668: 2344a503 lw a0,564(s1) + +0000066c <.LVL161>: + 66c: 00000097 auipc ra,0x0 + 670: 000080e7 jalr ra # 66c <.LVL161> + +00000674 <.LVL162>: + 674: fe842703 lw a4,-24(s0) + 678: 04200693 li a3,66 + 67c: fe042783 lw a5,-32(s0) + 680: cae6ede3 bltu a3,a4,33a <.L64> + 684: 070e sll a4,a4,0x3 + 686: 9726 add a4,a4,s1 + 688: 4691 li a3,4 + 68a: bb41 j 41a <.L129> + +0000068c <.L72>: + 68c: fe840593 add a1,s0,-24 + 690: 853e mv a0,a5 + 692: 00000097 auipc ra,0x0 + 696: 000080e7 jalr ra # 692 <.L72+0x6> + +0000069a <.LVL164>: + 69a: ff040593 add a1,s0,-16 + 69e: 00000097 auipc ra,0x0 + 6a2: 000080e7 jalr ra # 69e <.LVL164+0x4> + +000006a6 <.LVL165>: + 6a6: ff042583 lw a1,-16(s0) + 6aa: fea42023 sw a0,-32(s0) + +000006ae <.LVL166>: + 6ae: bf6d j 668 <.L131> + +000006b0 <.L71>: + 6b0: 853e mv a0,a5 + 6b2: fe840593 add a1,s0,-24 + 6b6: 00000097 auipc ra,0x0 + 6ba: 000080e7 jalr ra # 6b6 <.L71+0x6> + +000006be <.LVL168>: + 6be: fe842783 lw a5,-24(s0) + 6c2: 04200713 li a4,66 + 6c6: eef762e3 bltu a4,a5,5aa <.L111> + 6ca: 078e sll a5,a5,0x3 + 6cc: 97a6 add a5,a5,s1 + 6ce: 4715 li a4,5 + 6d0: bdd9 j 5a6 <.L127> + +000006d2 <.L70>: + 6d2: 08048693 add a3,s1,128 + 6d6: 4701 li a4,0 + 6d8: 4585 li a1,1 + 6da: 04000613 li a2,64 + +000006de <.L112>: + 6de: c298 sw a4,0(a3) + 6e0: c2cc sw a1,4(a3) + 6e2: 0711 add a4,a4,4 + 6e4: 06a1 add a3,a3,8 # 8 <.L2+0x4> + 6e6: fec71ce3 bne a4,a2,6de <.L112> + 6ea: b981 j 33a <.L64> + +000006ec <.L69>: + 6ec: 853e mv a0,a5 + 6ee: fec40593 add a1,s0,-20 + 6f2: 00000097 auipc ra,0x0 + 6f6: 000080e7 jalr ra # 6f2 <.L69+0x6> + +000006fa <.LVL172>: + 6fa: fec42703 lw a4,-20(s0) + 6fe: fdc42683 lw a3,-36(s0) + 702: 87aa mv a5,a0 + 704: 12e6a623 sw a4,300(a3) + 708: b90d j 33a <.L64> + +0000070a <.L67>: + 70a: 853e mv a0,a5 + 70c: fe840593 add a1,s0,-24 + 710: 00000097 auipc ra,0x0 + 714: 000080e7 jalr ra # 710 <.L67+0x6> + +00000718 <.LVL174>: + 718: fec40593 add a1,s0,-20 + 71c: 00000097 auipc ra,0x0 + 720: 000080e7 jalr ra # 71c <.LVL174+0x4> + +00000724 <.LVL175>: + 724: fea42023 sw a0,-32(s0) + +00000728 <.LVL176>: + 728: fec42583 lw a1,-20(s0) + 72c: 2344a503 lw a0,564(s1) + +00000730 <.LVL177>: + 730: 00000097 auipc ra,0x0 + 734: 000080e7 jalr ra # 730 <.LVL177> + +00000738 <.LVL178>: + 738: fe842703 lw a4,-24(s0) + 73c: 04200693 li a3,66 + 740: fe042783 lw a5,-32(s0) + 744: bee6ebe3 bltu a3,a4,33a <.L64> + 748: 070e sll a4,a4,0x3 + 74a: 9726 add a4,a4,s1 + 74c: 4685 li a3,1 + 74e: c354 sw a3,4(a4) + 750: 40a00533 neg a0,a0 + +00000754 <.LVL179>: + 754: b1e1 j 41c <.L121> + +00000756 <.L66>: + 756: 00000097 auipc ra,0x0 + 75a: 000080e7 jalr ra # 756 <.L66> + +0000075e : + 75e: fd810113 add sp,sp,-40 + 762: d022 sw s0,32(sp) + 764: 842e mv s0,a1 + 766: ce26 sw s1,28(sp) + 768: 24800613 li a2,584 + 76c: 84aa mv s1,a0 + 76e: 4581 li a1,0 + +00000770 <.LVL183>: + 770: 8522 mv a0,s0 + +00000772 <.LVL184>: + 772: d206 sw ra,36(sp) + 774: 00000097 auipc ra,0x0 + 778: 000080e7 jalr ra # 774 <.LVL184+0x2> + +0000077c <.LVL185>: + 77c: 1104a503 lw a0,272(s1) + 780: 1204a623 sw zero,300(s1) + 784: 1004aa23 sw zero,276(s1) + 788: e901 bnez a0,798 <.L136> + +0000078a <.L138>: + 78a: 4515 li a0,5 + +0000078c <.L135>: + 78c: 5092 lw ra,36(sp) + 78e: 5402 lw s0,32(sp) + +00000790 <.LVL186>: + 790: 44f2 lw s1,28(sp) + +00000792 <.LVL187>: + 792: 02810113 add sp,sp,40 + 796: 8082 ret + +00000798 <.L136>: + 798: 1244a783 lw a5,292(s1) + +0000079c <.LBE203>: + 79c: 11848593 add a1,s1,280 + +000007a0 <.LBB206>: + 7a0: 83fd srl a5,a5,0x1f + +000007a2 <.LBE206>: + 7a2: 17fd add a5,a5,-1 + 7a4: 953e add a0,a0,a5 + 7a6: 00000097 auipc ra,0x0 + 7aa: 000080e7 jalr ra # 7a6 <.LBE206+0x4> + +000007ae <.LVL189>: + 7ae: c42a sw a0,8(sp) + +000007b0 <.LVL190>: + 7b0: dd69 beqz a0,78a <.L138> + 7b2: 1204a783 lw a5,288(s1) + +000007b6 <.LBB207>: + 7b6: 4158 lw a4,4(a0) + +000007b8 <.LBE207>: + 7b8: 22f42623 sw a5,556(s0) + +000007bc <.LBB210>: + 7bc: 00450793 add a5,a0,4 + 7c0: 8f99 sub a5,a5,a4 + 7c2: c03e sw a5,0(sp) + +000007c4 <.LBB211>: + 7c4: 07a5 add a5,a5,9 + +000007c6 <.LVL193>: + 7c6: 853e mv a0,a5 + +000007c8 <.LVL194>: + 7c8: c23e sw a5,4(sp) + +000007ca <.LVL195>: + 7ca: 00000097 auipc ra,0x0 + 7ce: 000080e7 jalr ra # 7ca <.LVL195> + +000007d2 <.LVL196>: + 7d2: 4792 lw a5,4(sp) + 7d4: 0505 add a0,a0,1 + 7d6: 953e add a0,a0,a5 + +000007d8 <.LVL197>: + 7d8: 4782 lw a5,0(sp) + 7da: 0097c703 lbu a4,9(a5) + 7de: 06500793 li a5,101 + 7e2: 02f71d63 bne a4,a5,81c <.L139> + 7e6: 4782 lw a5,0(sp) + 7e8: 00a7c703 lbu a4,10(a5) + 7ec: 06800793 li a5,104 + 7f0: 02f71663 bne a4,a5,81c <.L139> + +000007f4 <.LBB213>: + 7f4: 00154783 lbu a5,1(a0) + 7f8: 00054703 lbu a4,0(a0) + +000007fc <.LBE213>: + 7fc: 0511 add a0,a0,4 + +000007fe <.LBB216>: + 7fe: 07a2 sll a5,a5,0x8 + 800: 8fd9 or a5,a5,a4 + 802: ffe54703 lbu a4,-2(a0) + 806: 0742 sll a4,a4,0x10 + 808: 8f5d or a4,a4,a5 + 80a: fff54783 lbu a5,-1(a0) + 80e: 07e2 sll a5,a5,0x18 + 810: 8fd9 or a5,a5,a4 + +00000812 <.LBE216>: + 812: 24f42223 sw a5,580(s0) + +00000816 <.LVL200>: + 816: 4782 lw a5,0(sp) + 818: 07ad add a5,a5,11 + 81a: c23e sw a5,4(sp) + +0000081c <.L139>: + 81c: 4782 lw a5,0(sp) + 81e: 0087c703 lbu a4,8(a5) + 822: 478d li a5,3 + 824: 00e7fd63 bgeu a5,a4,83e <.L140> + 828: 00054683 lbu a3,0(a0) + 82c: 4791 li a5,4 + 82e: 00f68463 beq a3,a5,836 <.L141> + +00000832 <.L158>: + 832: 450d li a0,3 + 834: bfa1 j 78c <.L135> + +00000836 <.L141>: + 836: 00154783 lbu a5,1(a0) + 83a: ffe5 bnez a5,832 <.L158> + 83c: 0509 add a0,a0,2 + +0000083e <.L140>: + 83e: 080c add a1,sp,16 + 840: c63a sw a4,12(sp) + 842: 00000097 auipc ra,0x0 + 846: 000080e7 jalr ra # 842 <.L140+0x4> + +0000084a <.LVL205>: + 84a: 47c2 lw a5,16(sp) + 84c: 084c add a1,sp,20 + 84e: 22f42c23 sw a5,568(s0) + 852: 00000097 auipc ra,0x0 + 856: 000080e7 jalr ra # 852 <.LVL205+0x8> + +0000085a <.LVL206>: + 85a: 46d2 lw a3,20(sp) + 85c: 4732 lw a4,12(sp) + 85e: 87aa mv a5,a0 + +00000860 <.LVL207>: + 860: 22d42a23 sw a3,564(s0) + 864: 4685 li a3,1 + 866: 04d71863 bne a4,a3,8b6 <.L143> + 86a: 0007c783 lbu a5,0(a5) + 86e: 0505 add a0,a0,1 + +00000870 <.L144>: + 870: 22f42e23 sw a5,572(s0) + 874: 57fd li a5,-1 + 876: 24f400a3 sb a5,577(s0) + 87a: 4792 lw a5,4(sp) + 87c: 07a00713 li a4,122 + 880: 0007c683 lbu a3,0(a5) + 884: 4781 li a5,0 + 886: 00e69f63 bne a3,a4,8a4 <.L145> + 88a: 080c add a1,sp,16 + 88c: 00000097 auipc ra,0x0 + 890: 000080e7 jalr ra # 88c <.L144+0x1c> + +00000894 <.LVL209>: + 894: 4705 li a4,1 + 896: 24e40123 sb a4,578(s0) + 89a: 4712 lw a4,4(sp) + 89c: 47c2 lw a5,16(sp) + 89e: 0705 add a4,a4,1 + 8a0: 97aa add a5,a5,a0 + +000008a2 <.LVL210>: + 8a2: c23a sw a4,4(sp) + +000008a4 <.L145>: + 8a4: 4712 lw a4,4(sp) + 8a6: 00170313 add t1,a4,1 + +000008aa <.L155>: + 8aa: fff34703 lbu a4,-1(t1) + 8ae: eb19 bnez a4,8c4 <.L156> + 8b0: eb8d bnez a5,8e2 <.L154> + 8b2: 87aa mv a5,a0 + +000008b4 <.LVL213>: + 8b4: a035 j 8e0 <.L150> + +000008b6 <.L143>: + 8b6: 080c add a1,sp,16 + 8b8: 00000097 auipc ra,0x0 + 8bc: 000080e7 jalr ra # 8b8 <.L143+0x2> + +000008c0 <.LVL215>: + 8c0: 47c2 lw a5,16(sp) + 8c2: b77d j 870 <.L144> + +000008c4 <.L156>: + 8c4: 05000693 li a3,80 + 8c8: 08d70263 beq a4,a3,94c <.L146> + 8cc: 04e6e863 bltu a3,a4,91c <.L147> + 8d0: 04200693 li a3,66 + 8d4: 06d70563 beq a4,a3,93e <.L153> + 8d8: 04c00693 li a3,76 + 8dc: 04d70c63 beq a4,a3,934 <.L149> + +000008e0 <.L150>: + 8e0: dba9 beqz a5,832 <.L158> + +000008e2 <.L154>: + 8e2: 4702 lw a4,0(sp) + +000008e4 <.LBE227>: + 8e4: 853e mv a0,a5 + 8e6: 86a2 mv a3,s0 + +000008e8 <.LBB228>: + 8e8: 430c lw a1,0(a4) + +000008ea <.LBE228>: + 8ea: 8626 mv a2,s1 + +000008ec <.LBB229>: + 8ec: 0591 add a1,a1,4 + +000008ee <.LBE229>: + 8ee: 95ba add a1,a1,a4 + 8f0: 00000097 auipc ra,0x0 + 8f4: 000080e7 jalr ra # 8f0 <.LBE229+0x2> + +000008f8 <.LVL219>: + 8f8: 24044783 lbu a5,576(s0) + +000008fc <.LBB230>: + 8fc: 0ff00713 li a4,255 + 900: 08e78e63 beq a5,a4,99c <.L167> + 904: 8b9d and a5,a5,7 + +00000906 <.LVL221>: + 906: 4709 li a4,2 + 908: 08e78c63 beq a5,a4,9a0 <.L168> + 90c: 06f76263 bltu a4,a5,970 <.L160> + 910: 4511 li a0,4 + 912: c7b5 beqz a5,97e <.L159> + +00000914 <.L161>: + 914: 00000097 auipc ra,0x0 + 918: 000080e7 jalr ra # 914 <.L161> + +0000091c <.L147>: + 91c: 05200693 li a3,82 + 920: 02d70163 beq a4,a3,942 <.L151> + 924: 05300693 li a3,83 + 928: fad71ce3 bne a4,a3,8e0 <.L150> + +0000092c <.LBB234>: + 92c: 4705 li a4,1 + 92e: 24e401a3 sb a4,579(s0) + +00000932 <.LVL223>: + 932: a031 j 93e <.L153> + +00000934 <.L149>: + 934: 00054703 lbu a4,0(a0) + 938: 24e400a3 sb a4,577(s0) + +0000093c <.L184>: + 93c: 0505 add a0,a0,1 + +0000093e <.L153>: + 93e: 0305 add t1,t1,1 + 940: b7ad j 8aa <.L155> + +00000942 <.L151>: + 942: 00054703 lbu a4,0(a0) + 946: 24e40023 sb a4,576(s0) + 94a: bfcd j 93c <.L184> + +0000094c <.L146>: + 94c: 00054583 lbu a1,0(a0) + 950: 00150613 add a2,a0,1 + 954: 0834 add a3,sp,24 + 956: 8526 mv a0,s1 + +00000958 <.LVL229>: + 958: c61a sw t1,12(sp) + 95a: c23e sw a5,4(sp) + 95c: 00000097 auipc ra,0x0 + 960: 000080e7 jalr ra # 95c <.LVL229+0x4> + +00000964 <.LVL230>: + 964: 4762 lw a4,24(sp) + +00000966 <.LBE217>: + 966: 4792 lw a5,4(sp) + 968: 4332 lw t1,12(sp) + +0000096a <.LBB218>: + 96a: 22e42823 sw a4,560(s0) + +0000096e <.LBE218>: + 96e: bfc1 j 93e <.L153> + +00000970 <.L160>: + 970: 470d li a4,3 + 972: 02e78963 beq a5,a4,9a4 <.L170> + 976: 4711 li a4,4 + 978: 4521 li a0,8 + 97a: f8e79de3 bne a5,a4,914 <.L161> + +0000097e <.L159>: + 97e: 47a2 lw a5,8(sp) + 980: 0506 sll a0,a0,0x1 + 982: 0521 add a0,a0,8 + 984: 953e add a0,a0,a5 + +00000986 <.LVL234>: + 986: 24244783 lbu a5,578(s0) + 98a: ef99 bnez a5,9a8 <.L162> + 98c: 24144583 lbu a1,577(s0) + 990: 0ff00793 li a5,255 + 994: 04f58563 beq a1,a5,9de <.L164> + 998: 4701 li a4,0 + 99a: a025 j 9c2 <.L163> + +0000099c <.L167>: + 99c: 4501 li a0,0 + 99e: b7c5 j 97e <.L159> + +000009a0 <.L168>: + 9a0: 4509 li a0,2 + 9a2: bff1 j 97e <.L159> + +000009a4 <.L170>: + 9a4: 4511 li a0,4 + 9a6: bfe1 j 97e <.L159> + +000009a8 <.L162>: + 9a8: 082c add a1,sp,24 + 9aa: 00000097 auipc ra,0x0 + 9ae: 000080e7 jalr ra # 9aa <.L162+0x2> + +000009b2 <.LVL238>: + 9b2: 4762 lw a4,24(sp) + +000009b4 <.LBE237>: + 9b4: 24144583 lbu a1,577(s0) + 9b8: 0ff00793 li a5,255 + +000009bc <.LBB238>: + 9bc: 972a add a4,a4,a0 + +000009be <.LBE238>: + 9be: 00f58e63 beq a1,a5,9da <.L165> + +000009c2 <.L163>: + 9c2: 862a mv a2,a0 + 9c4: 0834 add a3,sp,24 + 9c6: 8526 mv a0,s1 + +000009c8 <.LVL241>: + 9c8: c03a sw a4,0(sp) + +000009ca <.LVL242>: + 9ca: 00000097 auipc ra,0x0 + 9ce: 000080e7 jalr ra # 9ca <.LVL242> + +000009d2 <.LVL243>: + 9d2: 47e2 lw a5,24(sp) + 9d4: 4702 lw a4,0(sp) + 9d6: 10f4aa23 sw a5,276(s1) + +000009da <.L165>: + 9da: c311 beqz a4,9de <.L164> + 9dc: 853a mv a0,a4 + +000009de <.L164>: + 9de: 47a2 lw a5,8(sp) + +000009e0 <.LBE244>: + 9e0: 86a2 mv a3,s0 + 9e2: 8626 mv a2,s1 + +000009e4 <.LBB245>: + 9e4: 438c lw a1,0(a5) + 9e6: 0591 add a1,a1,4 + +000009e8 <.LBE245>: + 9e8: 95be add a1,a1,a5 + 9ea: 00000097 auipc ra,0x0 + 9ee: 000080e7 jalr ra # 9ea <.LBE245+0x2> + +000009f2 <.LVL245>: + 9f2: 4501 li a0,0 + 9f4: bb61 j 78c <.L135> + +000009f6 <_Unwind_SetSpColumn>: + 9f6: 00000737 lui a4,0x0 + 9fa: 00274683 lbu a3,2(a4) # 2 + 9fe: 4711 li a4,4 + a00: 00e69863 bne a3,a4,a10 <.L186> + a04: c20c sw a1,0(a2) + +00000a06 <.LVL247>: + a06: 4589 li a1,2 + +00000a08 <.LVL248>: + a08: 00000317 auipc t1,0x0 + a0c: 00030067 jr t1 # a08 <.LVL248> + +00000a10 <.L186>: + a10: 1151 add sp,sp,-12 + a12: c406 sw ra,8(sp) + a14: 00000097 auipc ra,0x0 + a18: 000080e7 jalr ra # a14 <.L186+0x4> + +00000a1c <_Unwind_GetGR>: + a1c: 04200793 li a5,66 + a20: 00b7d863 bge a5,a1,a30 <.L190> + +00000a24 <.L193>: + a24: 1151 add sp,sp,-12 + a26: c406 sw ra,8(sp) + a28: 00000097 auipc ra,0x0 + a2c: 000080e7 jalr ra # a28 <.L193+0x4> + +00000a30 <.L190>: + a30: 12452683 lw a3,292(a0) + +00000a34 <.LBE246>: + a34: 00259793 sll a5,a1,0x2 + a38: 97aa add a5,a5,a0 + a3a: 4398 lw a4,0(a5) + +00000a3c <.LBB249>: + a3c: 400007b7 lui a5,0x40000 + a40: 8ff5 and a5,a5,a3 + +00000a42 <.LBE249>: + a42: cb81 beqz a5,a52 <.L191> + a44: 00b507b3 add a5,a0,a1 + a48: 1307c783 lbu a5,304(a5) # 40000130 <.LLST185+0x3fffda08> + a4c: c399 beqz a5,a52 <.L191> + +00000a4e <.LBB250>: + a4e: 853a mv a0,a4 + +00000a50 <.LBE250>: + a50: 8082 ret + +00000a52 <.L191>: + a52: 000007b7 lui a5,0x0 + a56: 00078793 mv a5,a5 + a5a: 97ae add a5,a5,a1 + a5c: 0007c683 lbu a3,0(a5) # 0 + a60: 4791 li a5,4 + a62: fcf691e3 bne a3,a5,a24 <.L193> + a66: 4308 lw a0,0(a4) + +00000a68 <.LVL257>: + a68: 8082 ret + +00000a6a : + a6a: 1111 add sp,sp,-28 + a6c: ca22 sw s0,20(sp) + a6e: 842e mv s0,a1 + a70: c826 sw s1,16(sp) + a72: 4589 li a1,2 + +00000a74 <.LVL259>: + a74: 84aa mv s1,a0 + a76: 8522 mv a0,s0 + +00000a78 <.LVL260>: + a78: cc06 sw ra,24(sp) + a7a: 00000097 auipc ra,0x0 + a7e: 000080e7 jalr ra # a7a <.LVL260+0x2> + +00000a82 <.LVL261>: + a82: e909 bnez a0,a94 <.L203> + a84: 10c42583 lw a1,268(s0) + a88: 0030 add a2,sp,8 + a8a: 8522 mv a0,s0 + a8c: 00000097 auipc ra,0x0 + a90: 000080e7 jalr ra # a8c <.LVL261+0xa> + +00000a94 <.L203>: + a94: 13000713 li a4,304 + a98: 4781 li a5,0 + +00000a9a <.L208>: + a9a: 00279693 sll a3,a5,0x2 + a9e: 00d48633 add a2,s1,a3 + aa2: 96a2 add a3,a3,s0 + aa4: 428c lw a1,0(a3) + aa6: 00e486b3 add a3,s1,a4 + aaa: 0006c683 lbu a3,0(a3) + aae: 4208 lw a0,0(a2) + +00000ab0 <.LVL264>: + ab0: c689 beqz a3,aba <.L204> + +00000ab2 <.L207>: + ab2: 00000097 auipc ra,0x0 + ab6: 000080e7 jalr ra # ab2 <.L207> + +00000aba <.L204>: + aba: 00e406b3 add a3,s0,a4 + abe: 0006c683 lbu a3,0(a3) + ac2: c6bd beqz a3,b30 <.L205> + ac4: c515 beqz a0,af0 <.L206> + ac6: c23a sw a4,4(sp) + +00000ac8 <.LBB253>: + ac8: 00000737 lui a4,0x0 + acc: 00070693 mv a3,a4 + ad0: 96be add a3,a3,a5 + ad2: 0006c603 lbu a2,0(a3) + ad6: c03e sw a5,0(sp) + ad8: 4691 li a3,4 + ada: fcd61ce3 bne a2,a3,ab2 <.L207> + ade: c62e sw a1,12(sp) + ae0: 4611 li a2,4 + ae2: 006c add a1,sp,12 + +00000ae4 <.LVL266>: + ae4: 00000097 auipc ra,0x0 + ae8: 000080e7 jalr ra # ae4 <.LVL266> + +00000aec <.LBE253>: + aec: 4782 lw a5,0(sp) + aee: 4712 lw a4,4(sp) + +00000af0 <.L206>: + af0: 0785 add a5,a5,1 + +00000af2 <.LVL269>: + af2: 04200693 li a3,66 + af6: 0705 add a4,a4,1 # 1 + af8: fad791e3 bne a5,a3,a9a <.L208> + afc: 4589 li a1,2 + afe: 8526 mv a0,s1 + b00: 00000097 auipc ra,0x0 + b04: 000080e7 jalr ra # b00 <.LVL269+0xe> + +00000b08 <.LVL270>: + b08: 87aa mv a5,a0 + b0a: 4501 li a0,0 + b0c: ef89 bnez a5,b26 <.L202> + +00000b0e <.LBB254>: + b0e: 4589 li a1,2 + b10: 8522 mv a0,s0 + b12: 00000097 auipc ra,0x0 + b16: 000080e7 jalr ra # b12 <.LBB254+0x4> + +00000b1a <.LBE255>: + b1a: 10c4a783 lw a5,268(s1) + b1e: 8d1d sub a0,a0,a5 + +00000b20 <.LVL273>: + b20: 12c42783 lw a5,300(s0) + b24: 953e add a0,a0,a5 + +00000b26 <.L202>: + b26: 40e2 lw ra,24(sp) + b28: 4452 lw s0,20(sp) + +00000b2a <.LVL275>: + b2a: 44c2 lw s1,16(sp) + +00000b2c <.LVL276>: + b2c: 0171 add sp,sp,28 + b2e: 8082 ret + +00000b30 <.L205>: + b30: d1e1 beqz a1,af0 <.L206> + b32: dd5d beqz a0,af0 <.L206> + b34: fab50ee3 beq a0,a1,af0 <.L206> + b38: c23a sw a4,4(sp) + b3a: 00000737 lui a4,0x0 + b3e: 00070693 mv a3,a4 + b42: 96be add a3,a3,a5 + b44: 0006c603 lbu a2,0(a3) + b48: c03e sw a5,0(sp) + b4a: 00000097 auipc ra,0x0 + b4e: 000080e7 jalr ra # b4a <.L205+0x1a> + +00000b52 <.LVL278>: + b52: 4712 lw a4,4(sp) + b54: 4782 lw a5,0(sp) + b56: bf69 j af0 <.L206> + +00000b58 : + b58: ed810113 add sp,sp,-296 + b5c: 10912e23 sw s1,284(sp) + b60: 12112223 sw ra,292(sp) + b64: 12812023 sw s0,288(sp) + b68: c22e sw a1,4(sp) + b6a: c032 sw a2,0(sp) + b6c: ce36 sw a3,28(sp) + +00000b6e <.LVL280>: + b6e: 4485 li s1,1 + +00000b70 <.L223>: + b70: 4792 lw a5,4(sp) + b72: 02f56563 bltu a0,a5,b9c <.L293> + b76: cc8d beqz s1,bb0 <.L226> + +00000b78 <.LVL282>: + b78: fff48713 add a4,s1,-1 + +00000b7c <.LVL283>: + b7c: 12412083 lw ra,292(sp) + b80: 12012403 lw s0,288(sp) + b84: 070a sll a4,a4,0x2 + +00000b86 <.LVL284>: + b86: 11070793 add a5,a4,272 # 110 <.L33+0x2> + b8a: 0078 add a4,sp,12 + b8c: 973e add a4,a4,a5 + b8e: f0072503 lw a0,-256(a4) + +00000b92 <.LVL285>: + b92: 11c12483 lw s1,284(sp) + +00000b96 <.LVL286>: + b96: 12810113 add sp,sp,296 + +00000b9a <.LVL287>: + b9a: 8082 ret + +00000b9c <.L293>: + b9c: 00054683 lbu a3,0(a0) + ba0: 47d9 li a5,22 + ba2: 00150413 add s0,a0,1 + +00000ba6 <.LVL289>: + ba6: 08d7eb63 bltu a5,a3,c3c <.L224> + baa: 4789 li a5,2 + bac: 06d7ea63 bltu a5,a3,c20 <.L225> + +00000bb0 <.L226>: + bb0: 00000097 auipc ra,0x0 + bb4: 000080e7 jalr ra # bb0 <.L226> + +00000bb8 <.L316>: + bb8: fe968593 add a1,a3,-23 + bbc: 4785 li a5,1 + bbe: 00b797b3 sll a5,a5,a1 + bc2: 6585 lui a1,0x1 + bc4: cf858513 add a0,a1,-776 # cf8 <.L248+0x24> + bc8: 8d7d and a0,a0,a5 + bca: e959 bnez a0,c60 <.L227> + bcc: 30458593 add a1,a1,772 + bd0: 8dfd and a1,a1,a5 + bd2: fff48513 add a0,s1,-1 + bd6: 32059863 bnez a1,f06 <.L228> + bda: 8b85 and a5,a5,1 + bdc: dbf1 beqz a5,bb0 <.L226> + +00000bde <.LBB270>: + bde: 4789 li a5,2 + be0: fc97d8e3 bge a5,s1,bb0 <.L226> + be4: 050a sll a0,a0,0x2 + be6: ffe48693 add a3,s1,-2 + +00000bea <.LVL292>: + bea: 0078 add a4,sp,12 + bec: 11050793 add a5,a0,272 + bf0: 068a sll a3,a3,0x2 + bf2: 00e78533 add a0,a5,a4 + bf6: 11068793 add a5,a3,272 + bfa: 00e786b3 add a3,a5,a4 + bfe: ffd48793 add a5,s1,-3 + c02: 078a sll a5,a5,0x2 + c04: 11078793 add a5,a5,272 + c08: f006a303 lw t1,-256(a3) + c0c: 97ba add a5,a5,a4 + c0e: f007a283 lw t0,-256(a5) + c12: f0052583 lw a1,-256(a0) + +00000c16 <.LVL293>: + c16: f0652023 sw t1,-256(a0) + c1a: f056a023 sw t0,-256(a3) + c1e: ac45 j ece <.L330> + +00000c20 <.L225>: + c20: 16f5 add a3,a3,-3 + +00000c22 <.LVL295>: + c22: 0ff6f693 zext.b a3,a3 + +00000c26 <.LVL296>: + c26: 47cd li a5,19 + c28: f8d7e4e3 bltu a5,a3,bb0 <.L226> + c2c: 000007b7 lui a5,0x0 + c30: 00078793 mv a5,a5 + c34: 068a sll a3,a3,0x2 + c36: 96be add a3,a3,a5 + c38: 429c lw a5,0(a3) + c3a: 8782 jr a5 + +00000c3c <.L224>: + c3c: 06f00793 li a5,111 + c40: 08d7ea63 bltu a5,a3,cd4 <.L248> + c44: 04f00793 li a5,79 + c48: 1cd7e063 bltu a5,a3,e08 <.L249> + c4c: 02800793 li a5,40 + c50: 3cf68463 beq a3,a5,1018 <.L250> + c54: 04d7ea63 bltu a5,a3,ca8 <.L251> + c58: 02300793 li a5,35 + c5c: f4d7fee3 bgeu a5,a3,bb8 <.L316> + +00000c60 <.L227>: + c60: 4785 li a5,1 + c62: f497d7e3 bge a5,s1,bb0 <.L226> + c66: ffe48313 add t1,s1,-2 + +00000c6a <.LVL298>: + c6a: 00231793 sll a5,t1,0x2 + c6e: 0078 add a4,sp,12 + c70: 11078793 add a5,a5,272 # 110 <.L33+0x2> + c74: 97ba add a5,a5,a4 + c76: fff48713 add a4,s1,-1 + c7a: 070a sll a4,a4,0x2 + c7c: f007a503 lw a0,-256(a5) + +00000c80 <.LVL299>: + c80: 1699 add a3,a3,-26 + +00000c82 <.LVL300>: + c82: 11070793 add a5,a4,272 + c86: 0078 add a4,sp,12 + c88: 973e add a4,a4,a5 + c8a: 0ff6f693 zext.b a3,a3 + +00000c8e <.LVL301>: + c8e: 47d1 li a5,20 + c90: f0072583 lw a1,-256(a4) + +00000c94 <.LVL302>: + c94: f0d7eee3 bltu a5,a3,bb0 <.L226> + c98: 000007b7 lui a5,0x0 + c9c: 00078793 mv a5,a5 + ca0: 068a sll a3,a3,0x2 + ca2: 96be add a3,a3,a5 + ca4: 429c lw a5,0(a3) + ca6: 8782 jr a5 + +00000ca8 <.L251>: + ca8: 02f00793 li a5,47 + cac: 34f68a63 beq a3,a5,1000 <.L253> + cb0: fad7f8e3 bgeu a5,a3,c60 <.L227> + cb4: fd068793 add a5,a3,-48 + +00000cb8 <.L254>: + cb8: 03f00693 li a3,63 + cbc: ee96cae3 blt a3,s1,bb0 <.L226> + +00000cc0 <.LVL305>: + cc0: 00249693 sll a3,s1,0x2 + cc4: 11068713 add a4,a3,272 + cc8: 0074 add a3,sp,12 + cca: 96ba add a3,a3,a4 + ccc: f0f6a023 sw a5,-256(a3) + cd0: 0485 add s1,s1,1 + +00000cd2 <.LVL306>: + cd2: a26d j e7c <.L264> + +00000cd4 <.L248>: + cd4: 09200793 li a5,146 + cd8: 16f68563 beq a3,a5,e42 <.L255> + cdc: 02d7e363 bltu a5,a3,d02 <.L256> + ce0: 08f00793 li a5,143 + ce4: 12d7fb63 bgeu a5,a3,e1a <.L257> + ce8: 09000793 li a5,144 + cec: ecf692e3 bne a3,a5,bb0 <.L226> + cf0: 006c add a1,sp,12 + cf2: 8522 mv a0,s0 + cf4: 00000097 auipc ra,0x0 + cf8: 000080e7 jalr ra # cf4 <.L248+0x20> + +00000cfc <.LVL308>: + cfc: 45b2 lw a1,12(sp) + cfe: 842a mv s0,a0 + d00: a231 j e0c <.L327> + +00000d02 <.L256>: + d02: 09600793 li a5,150 + d06: 16f68b63 beq a3,a5,e7c <.L264> + d0a: 0f100793 li a5,241 + d0e: 00250613 add a2,a0,2 + d12: 04f68463 beq a3,a5,d5a <.L260> + d16: 09400793 li a5,148 + d1a: e8f69be3 bne a3,a5,bb0 <.L226> + d1e: e80489e3 beqz s1,bb0 <.L226> + d22: 14fd add s1,s1,-1 + +00000d24 <.LBB272>: + d24: 00249793 sll a5,s1,0x2 + +00000d28 <.LBB273>: + d28: 00154683 lbu a3,1(a0) + +00000d2c <.LBE273>: + d2c: 11078793 add a5,a5,272 # 110 <.L33+0x2> + d30: 0078 add a4,sp,12 + d32: 97ba add a5,a5,a4 + +00000d34 <.LBB274>: + d34: 4591 li a1,4 + d36: f007a783 lw a5,-256(a5) + +00000d3a <.LVL312>: + d3a: 8432 mv s0,a2 + d3c: 1eb69f63 bne a3,a1,f3a <.L317> + +00000d40 <.L274>: + d40: 0017c583 lbu a1,1(a5) + d44: 0007c683 lbu a3,0(a5) + d48: 05a2 sll a1,a1,0x8 + d4a: 8dd5 or a1,a1,a3 + d4c: 0027c683 lbu a3,2(a5) + d50: 0037c783 lbu a5,3(a5) + +00000d54 <.LVL314>: + d54: 06c2 sll a3,a3,0x10 + d56: 8ecd or a3,a3,a1 + d58: a26d j f02 <.L325> + +00000d5a <.L260>: + d5a: 00154583 lbu a1,1(a0) + d5e: 4502 lw a0,0(sp) + d60: 0834 add a3,sp,24 + +00000d62 <.LVL316>: + d62: 00000097 auipc ra,0x0 + d66: 000080e7 jalr ra # d62 <.LVL316> + +00000d6a <.L321>: + d6a: 47e2 lw a5,24(sp) + d6c: 842a mv s0,a0 + +00000d6e <.LVL318>: + d6e: b7a9 j cb8 <.L254> + +00000d70 <.L245>: + d70: 00154783 lbu a5,1(a0) + +00000d74 <.L323>: + d74: 00250413 add s0,a0,2 + +00000d78 <.LVL321>: + d78: b781 j cb8 <.L254> + +00000d7a <.L244>: + d7a: 00150783 lb a5,1(a0) + d7e: bfdd j d74 <.L323> + +00000d80 <.L243>: + d80: 00254783 lbu a5,2(a0) + d84: 00154683 lbu a3,1(a0) + d88: 07a2 sll a5,a5,0x8 + +00000d8a <.LBE280>: + d8a: 8fd5 or a5,a5,a3 + +00000d8c <.L324>: + d8c: 00350413 add s0,a0,3 + +00000d90 <.LVL325>: + d90: b725 j cb8 <.L254> + +00000d92 <.L242>: + d92: 00254783 lbu a5,2(a0) + d96: 00154683 lbu a3,1(a0) + d9a: 07a2 sll a5,a5,0x8 + d9c: 8fd5 or a5,a5,a3 + +00000d9e <.LBE282>: + d9e: 07c2 sll a5,a5,0x10 + da0: 87c1 sra a5,a5,0x10 + da2: b7ed j d8c <.L324> + +00000da4 <.L240>: + da4: 00254783 lbu a5,2(a0) + da8: 00154683 lbu a3,1(a0) + +00000dac <.LBE284>: + dac: 00550413 add s0,a0,5 + +00000db0 <.LBB287>: + db0: 07a2 sll a5,a5,0x8 + db2: 8fd5 or a5,a5,a3 + db4: 00354683 lbu a3,3(a0) + db8: 06c2 sll a3,a3,0x10 + dba: 8edd or a3,a3,a5 + dbc: 00454783 lbu a5,4(a0) + dc0: 07e2 sll a5,a5,0x18 + dc2: 8fd5 or a5,a5,a3 + +00000dc4 <.LBE287>: + dc4: bdd5 j cb8 <.L254> + +00000dc6 <.L238>: + dc6: 00254783 lbu a5,2(a0) + dca: 00154683 lbu a3,1(a0) + +00000dce <.LBE288>: + dce: 00950413 add s0,a0,9 + +00000dd2 <.LBB291>: + dd2: 07a2 sll a5,a5,0x8 + dd4: 8fd5 or a5,a5,a3 + dd6: 00354683 lbu a3,3(a0) + dda: 06c2 sll a3,a3,0x10 + ddc: 8edd or a3,a3,a5 + dde: 00454783 lbu a5,4(a0) + de2: 07e2 sll a5,a5,0x18 + de4: 8fd5 or a5,a5,a3 + +00000de6 <.LBE291>: + de6: bdc9 j cb8 <.L254> + +00000de8 <.L237>: + de8: 8522 mv a0,s0 + +00000dea <.LVL334>: + dea: 080c add a1,sp,16 + dec: 00000097 auipc ra,0x0 + df0: 000080e7 jalr ra # dec <.LVL334+0x2> + +00000df4 <.LVL335>: + df4: 47c2 lw a5,16(sp) + df6: 842a mv s0,a0 + +00000df8 <.LVL336>: + df8: b5c1 j cb8 <.L254> + +00000dfa <.L236>: + dfa: 082c add a1,sp,24 + dfc: 8522 mv a0,s0 + +00000dfe <.LVL338>: + dfe: 00000097 auipc ra,0x0 + e02: 000080e7 jalr ra # dfe <.LVL338> + +00000e06 <.LVL339>: + e06: b795 j d6a <.L321> + +00000e08 <.L249>: + e08: fb068593 add a1,a3,-80 + +00000e0c <.L327>: + e0c: 4502 lw a0,0(sp) + e0e: 00000097 auipc ra,0x0 + e12: 000080e7 jalr ra # e0e <.L327+0x2> + +00000e16 <.LVL342>: + e16: 87aa mv a5,a0 + +00000e18 <.LVL343>: + e18: b545 j cb8 <.L254> + +00000e1a <.L257>: + e1a: 084c add a1,sp,20 + e1c: 8522 mv a0,s0 + e1e: c436 sw a3,8(sp) + e20: 00000097 auipc ra,0x0 + e24: 000080e7 jalr ra # e20 <.L257+0x6> + +00000e28 <.LVL345>: + e28: 46a2 lw a3,8(sp) + e2a: 842a mv s0,a0 + e2c: f9068593 add a1,a3,-112 + +00000e30 <.L328>: + e30: 4502 lw a0,0(sp) + e32: 00000097 auipc ra,0x0 + e36: 000080e7 jalr ra # e32 <.L328+0x2> + +00000e3a <.LVL347>: + e3a: 46d2 lw a3,20(sp) + e3c: 00d507b3 add a5,a0,a3 + +00000e40 <.LVL348>: + e40: bda5 j cb8 <.L254> + +00000e42 <.L255>: + e42: 006c add a1,sp,12 + e44: 8522 mv a0,s0 + e46: 00000097 auipc ra,0x0 + e4a: 000080e7 jalr ra # e46 <.L255+0x4> + +00000e4e <.LVL350>: + e4e: 084c add a1,sp,20 + e50: 00000097 auipc ra,0x0 + e54: 000080e7 jalr ra # e50 <.LVL350+0x2> + +00000e58 <.LVL351>: + e58: 45b2 lw a1,12(sp) + e5a: 842a mv s0,a0 + +00000e5c <.LVL352>: + e5c: bfd1 j e30 <.L328> + +00000e5e <.L235>: + e5e: d40489e3 beqz s1,bb0 <.L226> + e62: fff48793 add a5,s1,-1 + +00000e66 <.L329>: + e66: 078a sll a5,a5,0x2 + e68: 11078793 add a5,a5,272 + e6c: 0078 add a4,sp,12 + e6e: 97ba add a5,a5,a4 + e70: f007a783 lw a5,-256(a5) + +00000e74 <.LVL354>: + e74: b591 j cb8 <.L254> + +00000e76 <.L234>: + e76: d2048de3 beqz s1,bb0 <.L226> + e7a: 14fd add s1,s1,-1 + +00000e7c <.L264>: + e7c: 8522 mv a0,s0 + e7e: b9cd j b70 <.L223> + +00000e80 <.L232>: + e80: 00154683 lbu a3,1(a0) + e84: fff48793 add a5,s1,-1 + e88: 00250413 add s0,a0,2 + +00000e8c <.LVL358>: + e8c: d2f6d2e3 bge a3,a5,bb0 <.L226> + e90: 8f95 sub a5,a5,a3 + e92: bfd1 j e66 <.L329> + +00000e94 <.L233>: + e94: 4785 li a5,1 + e96: d097dde3 bge a5,s1,bb0 <.L226> + e9a: ffe48793 add a5,s1,-2 + e9e: b7e1 j e66 <.L329> + +00000ea0 <.L230>: + ea0: 4785 li a5,1 + ea2: d097d7e3 bge a5,s1,bb0 <.L226> + ea6: fff48693 add a3,s1,-1 + eaa: 068a sll a3,a3,0x2 + eac: 11068793 add a5,a3,272 + eb0: 0078 add a4,sp,12 + eb2: 00e786b3 add a3,a5,a4 + eb6: ffe48793 add a5,s1,-2 + eba: 078a sll a5,a5,0x2 + ebc: 11078793 add a5,a5,272 + ec0: 97ba add a5,a5,a4 + ec2: f007a503 lw a0,-256(a5) + +00000ec6 <.LVL359>: + ec6: f006a583 lw a1,-256(a3) + +00000eca <.LVL360>: + eca: f0a6a023 sw a0,-256(a3) + +00000ece <.L330>: + ece: f0b7a023 sw a1,-256(a5) + +00000ed2 <.LVL362>: + ed2: b76d j e7c <.L264> + +00000ed4 <.L246>: + ed4: cc048ee3 beqz s1,bb0 <.L226> + ed8: 14fd add s1,s1,-1 + +00000eda <.LBB294>: + eda: 00249793 sll a5,s1,0x2 + ede: 11078793 add a5,a5,272 + ee2: 0078 add a4,sp,12 + ee4: 97ba add a5,a5,a4 + +00000ee6 <.LBB299>: + ee6: f007a583 lw a1,-256(a5) + eea: 0015c783 lbu a5,1(a1) + eee: 0005c683 lbu a3,0(a1) + ef2: 07a2 sll a5,a5,0x8 + ef4: 8fd5 or a5,a5,a3 + ef6: 0025c683 lbu a3,2(a1) + efa: 06c2 sll a3,a3,0x10 + efc: 8edd or a3,a3,a5 + efe: 0035c783 lbu a5,3(a1) + +00000f02 <.L325>: + f02: 07e2 sll a5,a5,0x18 + f04: a889 j f56 <.L326> + +00000f06 <.L228>: + f06: ca0485e3 beqz s1,bb0 <.L226> + f0a: 00251793 sll a5,a0,0x2 + f0e: 11078793 add a5,a5,272 + f12: 0078 add a4,sp,12 + f14: 97ba add a5,a5,a4 + f16: 02000593 li a1,32 + f1a: f007a783 lw a5,-256(a5) + f1e: 84aa mv s1,a0 + +00000f20 <.LVL367>: + f20: 04b68963 beq a3,a1,f72 <.L267> + f24: 12d5e363 bltu a1,a3,104a <.L268> + f28: 45e5 li a1,25 + f2a: 02b68f63 beq a3,a1,f68 <.L269> + f2e: 45fd li a1,31 + f30: c8b690e3 bne a3,a1,bb0 <.L226> + f34: 40f007b3 neg a5,a5 + f38: b341 j cb8 <.L254> + +00000f3a <.L317>: + f3a: 4591 li a1,4 + f3c: 00d5ef63 bltu a1,a3,f5a <.L271> + f40: 4585 li a1,1 + f42: 02b68063 beq a3,a1,f62 <.L272> + f46: 4589 li a1,2 + f48: c6b694e3 bne a3,a1,bb0 <.L226> + +00000f4c <.LBB265>: + f4c: 0007c683 lbu a3,0(a5) + f50: 0017c783 lbu a5,1(a5) + +00000f54 <.LVL371>: + f54: 07a2 sll a5,a5,0x8 + +00000f56 <.L326>: + f56: 8fd5 or a5,a5,a3 + +00000f58 <.LBE267>: + f58: b385 j cb8 <.L254> + +00000f5a <.L271>: + f5a: 45a1 li a1,8 + f5c: deb682e3 beq a3,a1,d40 <.L274> + f60: b981 j bb0 <.L226> + +00000f62 <.L272>: + f62: 0007c783 lbu a5,0(a5) + +00000f66 <.LVL376>: + f66: bb89 j cb8 <.L254> + +00000f68 <.L269>: + f68: 41f7d693 sra a3,a5,0x1f + +00000f6c <.LVL378>: + f6c: 8fb5 xor a5,a5,a3 + +00000f6e <.LVL379>: + f6e: 8f95 sub a5,a5,a3 + f70: b3a1 j cb8 <.L254> + +00000f72 <.L267>: + f72: fff7c793 not a5,a5 + f76: b389 j cb8 <.L254> + +00000f78 <.L292>: + f78: 00b577b3 and a5,a0,a1 + +00000f7c <.L322>: + f7c: 849a mv s1,t1 + +00000f7e <.LVL384>: + f7e: bb2d j cb8 <.L254> + +00000f80 <.L291>: + f80: c41a sw t1,8(sp) + f82: 00000097 auipc ra,0x0 + f86: 000080e7 jalr ra # f82 <.L291+0x2> + +00000f8a <.L331>: + f8a: 4322 lw t1,8(sp) + f8c: 87aa mv a5,a0 + +00000f8e <.LVL387>: + f8e: b7fd j f7c <.L322> + +00000f90 <.L290>: + f90: 40b507b3 sub a5,a0,a1 + +00000f94 <.LVL389>: + f94: b7e5 j f7c <.L322> + +00000f96 <.L289>: + f96: c41a sw t1,8(sp) + f98: 00000097 auipc ra,0x0 + f9c: 000080e7 jalr ra # f98 <.L289+0x2> + +00000fa0 <.LVL391>: + fa0: b7ed j f8a <.L331> + +00000fa2 <.L288>: + fa2: c41a sw t1,8(sp) + fa4: 00000097 auipc ra,0x0 + fa8: 000080e7 jalr ra # fa4 <.L288+0x2> + +00000fac <.LVL393>: + fac: bff9 j f8a <.L331> + +00000fae <.L287>: + fae: 00b567b3 or a5,a0,a1 + +00000fb2 <.LVL395>: + fb2: b7e9 j f7c <.L322> + +00000fb4 <.L286>: + fb4: 00b507b3 add a5,a0,a1 + +00000fb8 <.LVL397>: + fb8: b7d1 j f7c <.L322> + +00000fba <.L285>: + fba: 00b517b3 sll a5,a0,a1 + +00000fbe <.LVL399>: + fbe: bf7d j f7c <.L322> + +00000fc0 <.L284>: + fc0: 00b557b3 srl a5,a0,a1 + +00000fc4 <.LVL401>: + fc4: bf65 j f7c <.L322> + +00000fc6 <.L283>: + fc6: 40b557b3 sra a5,a0,a1 + +00000fca <.LVL403>: + fca: bf4d j f7c <.L322> + +00000fcc <.L282>: + fcc: 00b547b3 xor a5,a0,a1 + +00000fd0 <.LVL405>: + fd0: b775 j f7c <.L322> + +00000fd2 <.L278>: + fd2: 00a5a7b3 slt a5,a1,a0 + +00000fd6 <.L332>: + fd6: 0017c793 xor a5,a5,1 + +00000fda <.LVL407>: + fda: b74d j f7c <.L322> + +00000fdc <.L280>: + fdc: 00b527b3 slt a5,a0,a1 + fe0: bfdd j fd6 <.L332> + +00000fe2 <.L281>: + fe2: 40b507b3 sub a5,a0,a1 + fe6: 0017b793 seqz a5,a5 + +00000fea <.LVL409>: + fea: bf49 j f7c <.L322> + +00000fec <.L277>: + fec: 00b527b3 slt a5,a0,a1 + +00000ff0 <.LVL411>: + ff0: b771 j f7c <.L322> + +00000ff2 <.L279>: + ff2: 00a5a7b3 slt a5,a1,a0 + +00000ff6 <.LVL413>: + ff6: b759 j f7c <.L322> + +00000ff8 <.L275>: + ff8: 8d0d sub a0,a0,a1 + +00000ffa <.LVL415>: + ffa: 00a037b3 snez a5,a0 + ffe: bfbd j f7c <.L322> + +00001000 <.L253>: + 1000: 00254603 lbu a2,2(a0) + 1004: 00154783 lbu a5,1(a0) + 1008: 0622 sll a2,a2,0x8 + 100a: 8e5d or a2,a2,a5 + +0000100c <.LBE306>: + 100c: 0642 sll a2,a2,0x10 + 100e: 8641 sra a2,a2,0x10 + 1010: 060d add a2,a2,3 + +00001012 <.LVL417>: + 1012: 00c50433 add s0,a0,a2 + +00001016 <.LVL418>: + 1016: b59d j e7c <.L264> + +00001018 <.L250>: + 1018: b8048ce3 beqz s1,bb0 <.L226> + 101c: 14fd add s1,s1,-1 + +0000101e <.LBB307>: + 101e: 00249793 sll a5,s1,0x2 + 1022: 11078793 add a5,a5,272 + 1026: 0078 add a4,sp,12 + 1028: 97ba add a5,a5,a4 + 102a: f007a783 lw a5,-256(a5) + 102e: 00350413 add s0,a0,3 + +00001032 <.LVL421>: + 1032: e40785e3 beqz a5,e7c <.L264> + +00001036 <.LBB310>: + 1036: 00254783 lbu a5,2(a0) + 103a: 00154683 lbu a3,1(a0) + +0000103e <.LVL422>: + 103e: 07a2 sll a5,a5,0x8 + 1040: 8fd5 or a5,a5,a3 + +00001042 <.LBE310>: + 1042: 07c2 sll a5,a5,0x10 + 1044: 87c1 sra a5,a5,0x10 + +00001046 <.LVL423>: + 1046: 943e add s0,s0,a5 + +00001048 <.LVL424>: + 1048: bd15 j e7c <.L264> + +0000104a <.L268>: + 104a: 02300593 li a1,35 + 104e: b6b691e3 bne a3,a1,bb0 <.L226> + 1052: 8522 mv a0,s0 + 1054: 080c add a1,sp,16 + 1056: c43e sw a5,8(sp) + 1058: 00000097 auipc ra,0x0 + 105c: 000080e7 jalr ra # 1058 <.L268+0xe> + +00001060 <.LVL426>: + 1060: 46c2 lw a3,16(sp) + 1062: 47a2 lw a5,8(sp) + 1064: 842a mv s0,a0 + 1066: 97b6 add a5,a5,a3 + +00001068 <.LVL427>: + 1068: b981 j cb8 <.L254> + +0000106a : + 106a: e6c10113 add sp,sp,-404 + 106e: 18912423 sw s1,392(sp) + 1072: c02a sw a0,0(sp) + 1074: 84ae mv s1,a1 + 1076: 17400613 li a2,372 + 107a: 85aa mv a1,a0 + +0000107c <.LVL429>: + 107c: 0848 add a0,sp,20 + +0000107e <.LVL430>: + 107e: 18112823 sw ra,400(sp) + 1082: 18812623 sw s0,396(sp) + 1086: 00000097 auipc ra,0x0 + 108a: 000080e7 jalr ra # 1086 <.LVL430+0x8> + +0000108e <.LVL431>: + 108e: 4589 li a1,2 + 1090: 0848 add a0,sp,20 + 1092: 00000097 auipc ra,0x0 + 1096: 000080e7 jalr ra # 1092 <.LVL431+0x4> + +0000109a <.LVL432>: + 109a: e911 bnez a0,10ae <.L334> + 109c: 4782 lw a5,0(sp) + 109e: 0070 add a2,sp,12 + 10a0: 0848 add a0,sp,20 + 10a2: 10c7a583 lw a1,268(a5) + 10a6: 00000097 auipc ra,0x0 + 10aa: 000080e7 jalr ra # 10a6 <.LVL432+0xc> + +000010ae <.L334>: + 10ae: 4502 lw a0,0(sp) + 10b0: 4601 li a2,0 + 10b2: 4589 li a1,2 + 10b4: 00000097 auipc ra,0x0 + 10b8: 000080e7 jalr ra # 10b4 <.L334+0x6> + +000010bc <.LVL434>: + 10bc: 2284a783 lw a5,552(s1) + 10c0: 4705 li a4,1 + 10c2: 4409 li s0,2 + 10c4: 00e78863 beq a5,a4,10d4 <.L335> + 10c8: 04878463 beq a5,s0,1110 <.L336> + 10cc: 00000097 auipc ra,0x0 + 10d0: 000080e7 jalr ra # 10cc <.LVL434+0x10> + +000010d4 <.L335>: + 10d4: 2204a583 lw a1,544(s1) + 10d8: 0848 add a0,sp,20 + +000010da <.LVL436>: + 10da: 00000097 auipc ra,0x0 + 10de: 000080e7 jalr ra # 10da <.LVL436> + +000010e2 <.LBE320>: + 10e2: 21c4a783 lw a5,540(s1) + 10e6: 97aa add a5,a5,a0 + 10e8: c43e sw a5,8(sp) + +000010ea <.L338>: + 10ea: 4782 lw a5,0(sp) + 10ec: 4722 lw a4,8(sp) + 10ee: 8426 mv s0,s1 + 10f0: c202 sw zero,4(sp) + 10f2: 10e7a623 sw a4,268(a5) + +000010f6 <.L347>: + 10f6: 4058 lw a4,4(s0) + 10f8: 4691 li a3,4 + 10fa: 177d add a4,a4,-1 + 10fc: 04e6e463 bltu a3,a4,1144 <.L339> + 1100: 000007b7 lui a5,0x0 + 1104: 070a sll a4,a4,0x2 + 1106: 00078693 mv a3,a5 + 110a: 9736 add a4,a4,a3 + 110c: 4318 lw a4,0(a4) + 110e: 8702 jr a4 + +00001110 <.L336>: + 1110: 2244a503 lw a0,548(s1) + 1114: 080c add a1,sp,16 + 1116: 00000097 auipc ra,0x0 + 111a: 000080e7 jalr ra # 1116 <.L336+0x6> + +0000111e <.LVL441>: + 111e: 45c2 lw a1,16(sp) + 1120: 4681 li a3,0 + 1122: 0850 add a2,sp,20 + 1124: 95aa add a1,a1,a0 + 1126: 00000097 auipc ra,0x0 + 112a: 000080e7 jalr ra # 1126 <.LVL441+0x8> + +0000112e <.LVL442>: + 112e: c42a sw a0,8(sp) + +00001130 <.LVL443>: + 1130: bf6d j 10ea <.L338> + +00001132 <.L345>: + 1132: 4010 lw a2,0(s0) + 1134: 47a2 lw a5,8(sp) + 1136: 963e add a2,a2,a5 + +00001138 <.L353>: + 1138: 4592 lw a1,4(sp) + 113a: 4502 lw a0,0(sp) + 113c: 00000097 auipc ra,0x0 + 1140: 000080e7 jalr ra # 113c <.L353+0x4> + +00001144 <.L339>: + 1144: 4792 lw a5,4(sp) + 1146: 04300713 li a4,67 + 114a: 0421 add s0,s0,8 + 114c: 0785 add a5,a5,1 # 1 + 114e: c23e sw a5,4(sp) + +00001150 <.LVL446>: + 1150: fae793e3 bne a5,a4,10f6 <.L347> + +00001154 <.LBB323>: + 1154: 4782 lw a5,0(sp) + +00001156 <.LVL448>: + 1156: 2434c703 lbu a4,579(s1) + +0000115a <.LVL449>: + 115a: 1247a783 lw a5,292(a5) + 115e: cf49 beqz a4,11f8 <.L348> + 1160: 80000737 lui a4,0x80000 + +00001164 <.LVL450>: + 1164: 8fd9 or a5,a5,a4 + +00001166 <.L349>: + 1166: 4702 lw a4,0(sp) + +00001168 <.LBE323>: + 1168: 19012083 lw ra,400(sp) + 116c: 18c12403 lw s0,396(sp) + 1170: 12f72223 sw a5,292(a4) # 80000124 <.LLST185+0x7fffd9fc> + +00001174 <.LVL451>: + 1174: 18812483 lw s1,392(sp) + +00001178 <.LVL452>: + 1178: 19410113 add sp,sp,404 + +0000117c <.LVL453>: + 117c: 8082 ret + +0000117e <.L344>: + 117e: 400c lw a1,0(s0) + +00001180 <.LBB326>: + 1180: 0078 add a4,sp,12 + +00001182 <.LBE326>: + 1182: 0848 add a0,sp,20 + +00001184 <.LBB329>: + 1184: 17c58793 add a5,a1,380 + 1188: 973e add a4,a4,a5 + +0000118a <.LBE329>: + 118a: fbc74703 lbu a4,-68(a4) + 118e: c719 beqz a4,119c <.L346> + 1190: 00000097 auipc ra,0x0 + 1194: 000080e7 jalr ra # 1190 <.LBE329+0x6> + +00001198 <.L356>: + 1198: 862a mv a2,a0 + 119a: a80d j 11cc <.L354> + +0000119c <.L346>: + 119c: 00000097 auipc ra,0x0 + 11a0: 000080e7 jalr ra # 119c <.L346> + +000011a4 <.L355>: + 11a4: 862a mv a2,a0 + 11a6: bf49 j 1138 <.L353> + +000011a8 <.L343>: + 11a8: 4008 lw a0,0(s0) + 11aa: 080c add a1,sp,16 + 11ac: 00000097 auipc ra,0x0 + 11b0: 000080e7 jalr ra # 11ac <.L343+0x4> + +000011b4 <.LVL459>: + 11b4: 45c2 lw a1,16(sp) + 11b6: 46a2 lw a3,8(sp) + 11b8: 0850 add a2,sp,20 + 11ba: 95aa add a1,a1,a0 + 11bc: 00000097 auipc ra,0x0 + 11c0: 000080e7 jalr ra # 11bc <.LVL459+0x8> + +000011c4 <.LVL460>: + 11c4: b7c5 j 11a4 <.L355> + +000011c6 <.L342>: + 11c6: 4010 lw a2,0(s0) + 11c8: 47a2 lw a5,8(sp) + 11ca: 963e add a2,a2,a5 + +000011cc <.L354>: + 11cc: 4592 lw a1,4(sp) + 11ce: 4502 lw a0,0(sp) + 11d0: 00000097 auipc ra,0x0 + 11d4: 000080e7 jalr ra # 11d0 <.L354+0x4> + +000011d8 <.LBE332>: + 11d8: b7b5 j 1144 <.L339> + +000011da <.L340>: + 11da: 4008 lw a0,0(s0) + 11dc: 080c add a1,sp,16 + 11de: 00000097 auipc ra,0x0 + 11e2: 000080e7 jalr ra # 11de <.L340+0x4> + +000011e6 <.LVL465>: + 11e6: 45c2 lw a1,16(sp) + 11e8: 46a2 lw a3,8(sp) + 11ea: 0850 add a2,sp,20 + 11ec: 95aa add a1,a1,a0 + 11ee: 00000097 auipc ra,0x0 + 11f2: 000080e7 jalr ra # 11ee <.LVL465+0x8> + +000011f6 <.LVL466>: + 11f6: b74d j 1198 <.L356> + +000011f8 <.L348>: + 11f8: 0786 sll a5,a5,0x1 + 11fa: 8385 srl a5,a5,0x1 + 11fc: b7ad j 1166 <.L349> + +000011fe : + 11fe: da010113 add sp,sp,-608 + +00001202 <.LVL469>: + 1202: 24912a23 sw s1,596(sp) + 1206: c02e sw a1,0(sp) + 1208: 84b2 mv s1,a2 + 120a: 4581 li a1,0 + +0000120c <.LVL470>: + 120c: 17400613 li a2,372 + +00001210 <.LVL471>: + 1210: 24812c23 sw s0,600(sp) + 1214: 24112e23 sw ra,604(sp) + 1218: 842a mv s0,a0 + 121a: c206 sw ra,4(sp) + +0000121c <.LVL472>: + 121c: 00000097 auipc ra,0x0 + 1220: 000080e7 jalr ra # 121c <.LVL472> + +00001224 <.LVL473>: + 1224: 4792 lw a5,4(sp) + 1226: 006c add a1,sp,12 + 1228: 8522 mv a0,s0 + 122a: 10f42823 sw a5,272(s0) + 122e: 400007b7 lui a5,0x40000 + 1232: 12f42223 sw a5,292(s0) + 1236: 00000097 auipc ra,0x0 + 123a: 000080e7 jalr ra # 1236 <.LVL473+0x12> + +0000123e <.LVL474>: + 123e: c509 beqz a0,1248 <.L358> + 1240: 00000097 auipc ra,0x0 + 1244: 000080e7 jalr ra # 1240 <.LVL474+0x2> + +00001248 <.L358>: + 1248: 000007b7 lui a5,0x0 + 124c: 00078793 mv a5,a5 + 1250: 0007c703 lbu a4,0(a5) # 0 + 1254: e761 bnez a4,131c <.L359> + +00001256 <.LBB337>: + 1256: 4711 li a4,4 + 1258: 00e78023 sb a4,0(a5) + 125c: 00e780a3 sb a4,1(a5) + 1260: 00e78123 sb a4,2(a5) + 1264: 00e781a3 sb a4,3(a5) + 1268: 00e78223 sb a4,4(a5) + 126c: 00e782a3 sb a4,5(a5) + 1270: 00e78323 sb a4,6(a5) + 1274: 00e783a3 sb a4,7(a5) + 1278: 00e78423 sb a4,8(a5) + 127c: 00e784a3 sb a4,9(a5) + 1280: 00e78523 sb a4,10(a5) + 1284: 00e785a3 sb a4,11(a5) + 1288: 00e78623 sb a4,12(a5) + 128c: 00e786a3 sb a4,13(a5) + 1290: 00e78723 sb a4,14(a5) + 1294: 00e787a3 sb a4,15(a5) + 1298: 02e78023 sb a4,32(a5) + 129c: 02e780a3 sb a4,33(a5) + 12a0: 02e78123 sb a4,34(a5) + 12a4: 02e781a3 sb a4,35(a5) + 12a8: 02e78223 sb a4,36(a5) + 12ac: 02e782a3 sb a4,37(a5) + 12b0: 02e78323 sb a4,38(a5) + 12b4: 02e783a3 sb a4,39(a5) + 12b8: 02e78423 sb a4,40(a5) + 12bc: 02e784a3 sb a4,41(a5) + 12c0: 02e78523 sb a4,42(a5) + 12c4: 02e785a3 sb a4,43(a5) + 12c8: 02e78623 sb a4,44(a5) + 12cc: 02e786a3 sb a4,45(a5) + 12d0: 02e78723 sb a4,46(a5) + 12d4: 02e787a3 sb a4,47(a5) + 12d8: 02e78823 sb a4,48(a5) + 12dc: 02e788a3 sb a4,49(a5) + 12e0: 02e78923 sb a4,50(a5) + 12e4: 02e789a3 sb a4,51(a5) + 12e8: 02e78a23 sb a4,52(a5) + 12ec: 02e78aa3 sb a4,53(a5) + 12f0: 02e78b23 sb a4,54(a5) + 12f4: 02e78ba3 sb a4,55(a5) + 12f8: 02e78c23 sb a4,56(a5) + 12fc: 02e78ca3 sb a4,57(a5) + 1300: 02e78d23 sb a4,58(a5) + 1304: 02e78da3 sb a4,59(a5) + 1308: 02e78e23 sb a4,60(a5) + 130c: 02e78ea3 sb a4,61(a5) + 1310: 02e78f23 sb a4,62(a5) + 1314: 02e78fa3 sb a4,63(a5) + 1318: 04e78023 sb a4,64(a5) + +0000131c <.L359>: + 131c: 4582 lw a1,0(sp) + 131e: 0030 add a2,sp,8 + 1320: 8522 mv a0,s0 + +00001322 <.LVL476>: + 1322: 00000097 auipc ra,0x0 + 1326: 000080e7 jalr ra # 1322 <.LVL476> + +0000132a <.LVL477>: + 132a: 4785 li a5,1 + 132c: 22f12a23 sw a5,564(sp) + 1330: 006c add a1,sp,12 + 1332: 4789 li a5,2 + 1334: 8522 mv a0,s0 + 1336: 22f12623 sw a5,556(sp) + 133a: 22012423 sw zero,552(sp) + 133e: 00000097 auipc ra,0x0 + 1342: 000080e7 jalr ra # 133e <.LVL477+0x14> + +00001346 <.LVL478>: + 1346: 25c12083 lw ra,604(sp) + 134a: 10942823 sw s1,272(s0) + 134e: 25812403 lw s0,600(sp) + +00001352 <.LVL479>: + 1352: 25412483 lw s1,596(sp) + +00001356 <.LVL480>: + 1356: 26010113 add sp,sp,608 + +0000135a <.LVL481>: + 135a: 8082 ret + +0000135c : + 135c: 1151 add sp,sp,-12 + 135e: c222 sw s0,4(sp) + 1360: c026 sw s1,0(sp) + 1362: 842e mv s0,a1 + 1364: 84aa mv s1,a0 + 1366: c406 sw ra,8(sp) + 1368: 00000097 auipc ra,0x0 + 136c: 000080e7 jalr ra # 1368 + +00001370 <.LVL483>: + 1370: 23c42583 lw a1,572(s0) + 1374: 4501 li a0,0 + 1376: 00359793 sll a5,a1,0x3 + 137a: 943e add s0,s0,a5 + +0000137c <.LVL484>: + 137c: 4058 lw a4,4(s0) + 137e: 4799 li a5,6 + 1380: 00f70763 beq a4,a5,138e <.L362> + +00001384 <.LBB339>: + 1384: 8526 mv a0,s1 + 1386: 00000097 auipc ra,0x0 + 138a: 000080e7 jalr ra # 1386 <.LBB339+0x2> + +0000138e <.L362>: + 138e: 40a2 lw ra,8(sp) + 1390: 4412 lw s0,4(sp) + 1392: 10a4a823 sw a0,272(s1) + 1396: 4482 lw s1,0(sp) + +00001398 <.LVL487>: + 1398: 0131 add sp,sp,12 + 139a: 8082 ret + +0000139c <_Unwind_RaiseException_Phase2>: + 139c: da010113 add sp,sp,-608 + 13a0: 24812c23 sw s0,600(sp) + 13a4: 24912a23 sw s1,596(sp) + 13a8: 24112e23 sw ra,604(sp) + 13ac: c02a sw a0,0(sp) + 13ae: 842e mv s0,a1 + 13b0: c232 sw a2,4(sp) + 13b2: 4485 li s1,1 + +000013b4 <.L373>: + 13b4: 006c add a1,sp,12 + 13b6: 8522 mv a0,s0 + 13b8: 00000097 auipc ra,0x0 + 13bc: 000080e7 jalr ra # 13b8 <.L373+0x4> + +000013c0 <.LBB343>: + 13c0: 12442683 lw a3,292(s0) + +000013c4 <.LBE347>: + 13c4: 10c42703 lw a4,268(s0) + +000013c8 <.LBE343>: + 13c8: 4782 lw a5,0(sp) + +000013ca <.LBB350>: + 13ca: 82fd srl a3,a3,0x1f + +000013cc <.LBE350>: + 13cc: 8f15 sub a4,a4,a3 + +000013ce <.LBE352>: + 13ce: 4b94 lw a3,16(a5) + 13d0: 00e69b63 bne a3,a4,13e6 <.L367> + +000013d4 <.LVL491>: + 13d4: e939 bnez a0,142a <.L368> + 13d6: 23c12383 lw t2,572(sp) + 13da: 02039463 bnez t2,1402 <.L375> + +000013de <.L372>: + 13de: 00000097 auipc ra,0x0 + 13e2: 000080e7 jalr ra # 13de <.L372> + +000013e6 <.L367>: + 13e6: e131 bnez a0,142a <.L368> + 13e8: 23c12383 lw t2,572(sp) + 13ec: 4301 li t1,0 + 13ee: 00039b63 bnez t2,1404 <.L369> + +000013f2 <.L370>: + 13f2: 006c add a1,sp,12 + 13f4: 8522 mv a0,s0 + +000013f6 <.LVL495>: + 13f6: 00000097 auipc ra,0x0 + 13fa: 000080e7 jalr ra # 13f6 <.LVL495> + +000013fe <.LVL496>: + 13fe: 0485 add s1,s1,1 + +00001400 <.LBE342>: + 1400: bf55 j 13b4 <.L373> + +00001402 <.L375>: + 1402: 4311 li t1,4 + +00001404 <.L369>: + 1404: 4702 lw a4,0(sp) + 1406: 87a2 mv a5,s0 + 1408: 00236593 or a1,t1,2 + 140c: 4310 lw a2,0(a4) + 140e: 4354 lw a3,4(a4) + 1410: 4505 li a0,1 + +00001412 <.LVL500>: + 1412: c41a sw t1,8(sp) + 1414: 9382 jalr t2 + +00001416 <.LVL501>: + 1416: 471d li a4,7 + 1418: 02e50363 beq a0,a4,143e <.L371> + 141c: 4721 li a4,8 + 141e: 00e51663 bne a0,a4,142a <.L368> + 1422: 4322 lw t1,8(sp) + 1424: fc0307e3 beqz t1,13f2 <.L370> + 1428: bf5d j 13de <.L372> + +0000142a <.L368>: + 142a: 4509 li a0,2 + +0000142c <.L366>: + 142c: 25c12083 lw ra,604(sp) + 1430: 25812403 lw s0,600(sp) + +00001434 <.LVL503>: + 1434: 25412483 lw s1,596(sp) + +00001438 <.LVL504>: + 1438: 26010113 add sp,sp,608 + +0000143c <.LVL505>: + 143c: 8082 ret + +0000143e <.L371>: + 143e: 4792 lw a5,4(sp) + 1440: c384 sw s1,0(a5) + 1442: b7ed j 142c <.L366> + +00001444 <_Unwind_ForcedUnwind_Phase2>: + 1444: 455c lw a5,12(a0) + 1446: d9410113 add sp,sp,-620 + 144a: 26812223 sw s0,612(sp) + 144e: c43e sw a5,8(sp) + +00001450 <.LVL508>: + 1450: 491c lw a5,16(a0) + +00001452 <.LVL509>: + 1452: 26912023 sw s1,608(sp) + 1456: 26112423 sw ra,616(sp) + 145a: 842a mv s0,a0 + 145c: c22e sw a1,4(sp) + 145e: c832 sw a2,16(sp) + 1460: c63e sw a5,12(sp) + +00001462 <.LVL510>: + 1462: 4485 li s1,1 + +00001464 <.L386>: + 1464: 4512 lw a0,4(sp) + 1466: 082c add a1,sp,24 + 1468: 00000097 auipc ra,0x0 + 146c: 000080e7 jalr ra # 1468 <.L386+0x4> + +00001470 <.LVL512>: + 1470: 832a mv t1,a0 + +00001472 <.LVL513>: + 1472: c131 beqz a0,14b6 <.L390> + 1474: ffc50793 add a5,a0,-4 + 1478: 4705 li a4,1 + 147a: 04f76e63 bltu a4,a5,14d6 <.L382> + 147e: 45e9 li a1,26 + +00001480 <.L381>: + 1480: 47b2 lw a5,12(sp) + 1482: ca1a sw t1,20(sp) + +00001484 <.LVL514>: + 1484: 4322 lw t1,8(sp) + +00001486 <.LVL515>: + 1486: c03e sw a5,0(sp) + 1488: 4010 lw a2,0(s0) + 148a: 4792 lw a5,4(sp) + 148c: 4054 lw a3,4(s0) + 148e: 8722 mv a4,s0 + 1490: 4505 li a0,1 + +00001492 <.LVL516>: + 1492: 9302 jalr t1 + +00001494 <.LVL517>: + 1494: e129 bnez a0,14d6 <.L382> + 1496: 4352 lw t1,20(sp) + 1498: 4795 li a5,5 + 149a: 04f30963 beq t1,a5,14ec <.L384> + 149e: 24812303 lw t1,584(sp) + 14a2: 00031c63 bnez t1,14ba <.L385> + +000014a6 <.L388>: + 14a6: 4512 lw a0,4(sp) + 14a8: 082c add a1,sp,24 + +000014aa <.LBE355>: + 14aa: 0485 add s1,s1,1 + +000014ac <.LBB358>: + 14ac: 00000097 auipc ra,0x0 + 14b0: 000080e7 jalr ra # 14ac <.LBB358> + +000014b4 <.LBE354>: + 14b4: bf45 j 1464 <.L386> + +000014b6 <.L390>: + 14b6: 45a9 li a1,10 + 14b8: b7e1 j 1480 <.L381> + +000014ba <.L385>: + 14ba: 4792 lw a5,4(sp) + 14bc: 4010 lw a2,0(s0) + 14be: 4054 lw a3,4(s0) + 14c0: 8722 mv a4,s0 + 14c2: 45a9 li a1,10 + 14c4: 4505 li a0,1 + +000014c6 <.LVL524>: + 14c6: 9302 jalr t1 + +000014c8 <.LVL525>: + 14c8: 479d li a5,7 + 14ca: 832a mv t1,a0 + +000014cc <.LVL526>: + 14cc: 02f50063 beq a0,a5,14ec <.L384> + 14d0: 47a1 li a5,8 + 14d2: fcf50ae3 beq a0,a5,14a6 <.L388> + +000014d6 <.L382>: + 14d6: 4309 li t1,2 + +000014d8 <.L380>: + 14d8: 26812083 lw ra,616(sp) + 14dc: 26412403 lw s0,612(sp) + +000014e0 <.LVL528>: + 14e0: 26012483 lw s1,608(sp) + +000014e4 <.LVL529>: + 14e4: 851a mv a0,t1 + 14e6: 26c10113 add sp,sp,620 + +000014ea <.LVL530>: + 14ea: 8082 ret + +000014ec <.L384>: + 14ec: 47c2 lw a5,16(sp) + 14ee: c384 sw s1,0(a5) + 14f0: b7e5 j 14d8 <.L380> + +000014f2 <_Unwind_GetCFA>: + 14f2: 10c52503 lw a0,268(a0) + +000014f6 <.LVL533>: + 14f6: 8082 ret + +000014f8 <_Unwind_SetGR>: + 14f8: 04200793 li a5,66 + 14fc: 00b7d863 bge a5,a1,150c <.L394> + +00001500 <.L397>: + 1500: 1151 add sp,sp,-12 + 1502: c406 sw ra,8(sp) + 1504: 00000097 auipc ra,0x0 + 1508: 000080e7 jalr ra # 1504 <.L397+0x4> + +0000150c <.L394>: + 150c: 000007b7 lui a5,0x0 + 1510: 00078793 mv a5,a5 + 1514: 97ae add a5,a5,a1 + 1516: 0007c683 lbu a3,0(a5) # 0 + +0000151a <.LBB360>: + 151a: 12452783 lw a5,292(a0) + 151e: 40000737 lui a4,0x40000 + 1522: 8f7d and a4,a4,a5 + 1524: 00259793 sll a5,a1,0x2 + +00001528 <.LBE360>: + 1528: cb01 beqz a4,1538 <.L395> + 152a: 95aa add a1,a1,a0 + +0000152c <.LVL538>: + 152c: 1305c703 lbu a4,304(a1) + 1530: c701 beqz a4,1538 <.L395> + +00001532 <.LBB362>: + 1532: 97aa add a5,a5,a0 + +00001534 <.L406>: + 1534: c390 sw a2,0(a5) + 1536: 8082 ret + +00001538 <.L395>: + 1538: 953e add a0,a0,a5 + +0000153a <.LVL542>: + 153a: 4711 li a4,4 + 153c: 411c lw a5,0(a0) + 153e: fee68be3 beq a3,a4,1534 <.L406> + 1542: bf7d j 1500 <.L397> + +00001544 <_Unwind_GetIP>: + 1544: 11052503 lw a0,272(a0) + +00001548 <.LVL545>: + 1548: 8082 ret + +0000154a <_Unwind_GetIPInfo>: + 154a: 12452783 lw a5,292(a0) + +0000154e <.LBE364>: + 154e: 11052503 lw a0,272(a0) + +00001552 <.LBB367>: + 1552: 83fd srl a5,a5,0x1f + +00001554 <.LBE367>: + 1554: c19c sw a5,0(a1) + 1556: 8082 ret + +00001558 <_Unwind_SetIP>: + 1558: 10b52823 sw a1,272(a0) + 155c: 8082 ret + +0000155e <_Unwind_GetLanguageSpecificData>: + 155e: 11452503 lw a0,276(a0) + +00001562 <.LVL550>: + 1562: 8082 ret + +00001564 <_Unwind_GetRegionStart>: + 1564: 12052503 lw a0,288(a0) + +00001568 <.LVL552>: + 1568: 8082 ret + +0000156a <_Unwind_FindEnclosingFunction>: + 156a: 1121 add sp,sp,-24 + 156c: 858a mv a1,sp + 156e: 157d add a0,a0,-1 + +00001570 <.LVL554>: + 1570: ca06 sw ra,20(sp) + 1572: 00000097 auipc ra,0x0 + 1576: 000080e7 jalr ra # 1572 <.LVL554+0x2> + +0000157a <.LVL555>: + 157a: c111 beqz a0,157e <.L412> + 157c: 4522 lw a0,8(sp) + +0000157e <.L412>: + 157e: 40d2 lw ra,20(sp) + 1580: 0161 add sp,sp,24 + 1582: 8082 ret + +00001584 <_Unwind_GetDataRelBase>: + 1584: 11c52503 lw a0,284(a0) + +00001588 <.LVL558>: + 1588: 8082 ret + +0000158a <_Unwind_GetTextRelBase>: + 158a: 11852503 lw a0,280(a0) + +0000158e <.LVL560>: + 158e: 8082 ret + +00001590 <__frame_state_for>: + 1590: c3810113 add sp,sp,-968 + 1594: 3c812023 sw s0,960(sp) + 1598: 3a912e23 sw s1,956(sp) + 159c: 842e mv s0,a1 + 159e: 84aa mv s1,a0 + 15a0: 4581 li a1,0 + +000015a2 <.LVL562>: + 15a2: 17400613 li a2,372 + 15a6: 850a mv a0,sp + +000015a8 <.LVL563>: + 15a8: 3c112223 sw ra,964(sp) + 15ac: 00000097 auipc ra,0x0 + 15b0: 000080e7 jalr ra # 15ac <.LVL563+0x4> + +000015b4 <.LVL564>: + 15b4: 400007b7 lui a5,0x40000 + 15b8: 0485 add s1,s1,1 + +000015ba <.LVL565>: + 15ba: 1acc add a1,sp,372 + 15bc: 850a mv a0,sp + 15be: 12f12223 sw a5,292(sp) + 15c2: 10912823 sw s1,272(sp) + 15c6: 00000097 auipc ra,0x0 + 15ca: 000080e7 jalr ra # 15c6 <.LVL565+0xc> + +000015ce <.LVL566>: + 15ce: e935 bnez a0,1642 <.L426> + 15d0: 39c12703 lw a4,924(sp) + 15d4: 4789 li a5,2 + 15d6: 06f70663 beq a4,a5,1642 <.L426> + 15da: 1adc add a5,sp,372 + 15dc: 12040693 add a3,s0,288 + 15e0: 01040713 add a4,s0,16 + 15e4: 11c40513 add a0,s0,284 + 15e8: 4305 li t1,1 + 15ea: 4289 li t0,2 + +000015ec <.L424>: + 15ec: 0047c583 lbu a1,4(a5) # 40000004 <.LLST185+0x3fffd8dc> + 15f0: 00b68023 sb a1,0(a3) + 15f4: 00658563 beq a1,t1,15fe <.L422> + 15f8: 4601 li a2,0 + 15fa: 00559363 bne a1,t0,1600 <.L423> + +000015fe <.L422>: + 15fe: 4390 lw a2,0(a5) + +00001600 <.L423>: + 1600: c310 sw a2,0(a4) + +00001602 <.LVL568>: + 1602: 0711 add a4,a4,4 # 40000004 <.LLST185+0x3fffd8dc> + 1604: 07a1 add a5,a5,8 + 1606: 0685 add a3,a3,1 + +00001608 <.LVL569>: + 1608: fea712e3 bne a4,a0,15ec <.L424> + 160c: 39012783 lw a5,912(sp) + 1610: c41c sw a5,8(s0) + 1612: 39412783 lw a5,916(sp) + 1616: 10f41e23 sh a5,284(s0) + 161a: 3b012783 lw a5,944(sp) + 161e: 10f41f23 sh a5,286(s0) + 1622: 12c12783 lw a5,300(sp) + 1626: c45c sw a5,12(s0) + 1628: 3b812783 lw a5,952(sp) + 162c: c05c sw a5,4(s0) + +0000162e <.L421>: + 162e: 3c412083 lw ra,964(sp) + 1632: 8522 mv a0,s0 + 1634: 3c012403 lw s0,960(sp) + 1638: 3bc12483 lw s1,956(sp) + +0000163c <.LVL571>: + 163c: 3c810113 add sp,sp,968 + 1640: 8082 ret + +00001642 <.L426>: + 1642: 4401 li s0,0 + +00001644 <.LVL573>: + 1644: b7ed j 162e <.L421> + +00001646 <_Unwind_DebugHook>: + 1646: 8082 ret + +00001648 <_Unwind_RaiseException>: + 1648: ab010113 add sp,sp,-1360 + 164c: 54812423 sw s0,1352(sp) + 1650: 54a12023 sw a0,1344(sp) + 1654: 52b12e23 sw a1,1340(sp) + 1658: 52c12c23 sw a2,1336(sp) + 165c: 55010593 add a1,sp,1360 + 1660: 8606 mv a2,ra + 1662: 842a mv s0,a0 + 1664: 0048 add a0,sp,4 + +00001666 <.LVL576>: + 1666: 54112623 sw ra,1356(sp) + 166a: 54912223 sw s1,1348(sp) + 166e: 52d12a23 sw a3,1332(sp) + 1672: 00000097 auipc ra,0x0 + 1676: 000080e7 jalr ra # 1672 <.LVL576+0xc> + +0000167a <.LVL577>: + 167a: 17400613 li a2,372 + 167e: 004c add a1,sp,4 + 1680: 1aa8 add a0,sp,376 + 1682: 00000097 auipc ra,0x0 + 1686: 000080e7 jalr ra # 1682 <.LVL577+0x8> + +0000168a <.L435>: + 168a: 15ec add a1,sp,748 + 168c: 1aa8 add a0,sp,376 + 168e: 00000097 auipc ra,0x0 + 1692: 000080e7 jalr ra # 168e <.L435+0x4> + +00001696 <.LVL579>: + 1696: 4795 li a5,5 + 1698: 00f50463 beq a0,a5,16a0 <.L431> + 169c: c919 beqz a0,16b2 <.L433> + +0000169e <.L437>: + 169e: 450d li a0,3 + +000016a0 <.L431>: + 16a0: 54c12083 lw ra,1356(sp) + 16a4: 54812403 lw s0,1352(sp) + +000016a8 <.LVL581>: + 16a8: 54412483 lw s1,1348(sp) + 16ac: 55010113 add sp,sp,1360 + 16b0: 8082 ret + +000016b2 <.L433>: + 16b2: 51c12303 lw t1,1308(sp) + 16b6: 00031963 bnez t1,16c8 <.L434> + +000016ba <.L438>: + 16ba: 15ec add a1,sp,748 + 16bc: 1aa8 add a0,sp,376 + +000016be <.LVL583>: + 16be: 00000097 auipc ra,0x0 + 16c2: 000080e7 jalr ra # 16be <.LVL583> + +000016c6 <.LBE369>: + 16c6: b7d1 j 168a <.L435> + +000016c8 <.L434>: + 16c8: 4010 lw a2,0(s0) + 16ca: 4054 lw a3,4(s0) + 16cc: 1abc add a5,sp,376 + 16ce: 8722 mv a4,s0 + 16d0: 4585 li a1,1 + 16d2: 4505 li a0,1 + +000016d4 <.LVL586>: + 16d4: 9302 jalr t1 + +000016d6 <.LVL587>: + 16d6: 4799 li a5,6 + 16d8: 00f50663 beq a0,a5,16e4 <.L436> + 16dc: 47a1 li a5,8 + 16de: fcf50ee3 beq a0,a5,16ba <.L438> + 16e2: bf75 j 169e <.L437> + +000016e4 <.L436>: + 16e4: 29c12703 lw a4,668(sp) + +000016e8 <.LBE373>: + 16e8: 28412783 lw a5,644(sp) + +000016ec <.LBE371>: + 16ec: 17400613 li a2,372 + +000016f0 <.LBB377>: + 16f0: 837d srl a4,a4,0x1f + +000016f2 <.LBE377>: + 16f2: 8f99 sub a5,a5,a4 + +000016f4 <.LBE383>: + 16f4: c81c sw a5,16(s0) + 16f6: 004c add a1,sp,4 + 16f8: 00042623 sw zero,12(s0) + +000016fc <.LBB378>: + 16fc: 1aa8 add a0,sp,376 + +000016fe <.LVL589>: + 16fe: 00000097 auipc ra,0x0 + 1702: 000080e7 jalr ra # 16fe <.LVL589> + +00001706 <.LVL590>: + 1706: 15f0 add a2,sp,748 + 1708: 1aac add a1,sp,376 + 170a: 8522 mv a0,s0 + 170c: 00000097 auipc ra,0x0 + 1710: 000080e7 jalr ra # 170c <.LVL590+0x6> + +00001714 <.LVL591>: + 1714: 479d li a5,7 + 1716: f8f515e3 bne a0,a5,16a0 <.L431> + +0000171a <.LBB385>: + 171a: 1aac add a1,sp,376 + 171c: 0048 add a0,sp,4 + +0000171e <.LVL592>: + 171e: 00000097 auipc ra,0x0 + 1722: 000080e7 jalr ra # 171e <.LVL592> + +00001726 <.LVL593>: + 1726: 28812403 lw s0,648(sp) + +0000172a <.LVL594>: + 172a: c02a sw a0,0(sp) + +0000172c <.LVL595>: + 172c: 28412503 lw a0,644(sp) + +00001730 <.LVL596>: + 1730: 85a2 mv a1,s0 + 1732: 00000097 auipc ra,0x0 + 1736: 000080e7 jalr ra # 1732 <.LVL596+0x2> + +0000173a <.LBE385>: + 173a: 54812623 sw s0,1356(sp) + 173e: 54812403 lw s0,1352(sp) + +00001742 <.LVL598>: + 1742: 4702 lw a4,0(sp) + 1744: 54c12083 lw ra,1356(sp) + 1748: 54412483 lw s1,1348(sp) + 174c: 54012503 lw a0,1344(sp) + 1750: 53c12583 lw a1,1340(sp) + 1754: 53812603 lw a2,1336(sp) + 1758: 53412683 lw a3,1332(sp) + 175c: 55010113 add sp,sp,1360 + +00001760 <.LVL599>: + 1760: 913a add sp,sp,a4 + +00001762 <.LVL600>: + 1762: 8082 ret + +00001764 <_Unwind_ForcedUnwind>: + 1764: cf410113 add sp,sp,-780 + 1768: 30812223 sw s0,772(sp) + 176c: 30912023 sw s1,768(sp) + 1770: 842a mv s0,a0 + 1772: 2ea12e23 sw a0,764(sp) + 1776: 2eb12c23 sw a1,760(sp) + 177a: 2ec12a23 sw a2,756(sp) + 177e: c02e sw a1,0(sp) + 1780: 84b2 mv s1,a2 + 1782: 066c add a1,sp,780 + +00001784 <.LVL602>: + 1784: 8606 mv a2,ra + +00001786 <.LVL603>: + 1786: 0028 add a0,sp,8 + +00001788 <.LVL604>: + 1788: 30112423 sw ra,776(sp) + 178c: 2ed12823 sw a3,752(sp) + 1790: 00000097 auipc ra,0x0 + 1794: 000080e7 jalr ra # 1790 <.LVL604+0x8> + +00001798 <.LVL605>: + 1798: 17400613 li a2,372 + 179c: 002c add a1,sp,8 + 179e: 1ae8 add a0,sp,380 + 17a0: 00000097 auipc ra,0x0 + 17a4: 000080e7 jalr ra # 17a0 <.LVL605+0x8> + +000017a8 <.LVL606>: + 17a8: 4782 lw a5,0(sp) + 17aa: c804 sw s1,16(s0) + 17ac: 0050 add a2,sp,4 + 17ae: c45c sw a5,12(s0) + 17b0: 1aec add a1,sp,380 + 17b2: 8522 mv a0,s0 + 17b4: 00000097 auipc ra,0x0 + 17b8: 000080e7 jalr ra # 17b4 <.LVL606+0xc> + +000017bc <.LVL607>: + 17bc: 479d li a5,7 + 17be: 04f51763 bne a0,a5,180c <.L446> + +000017c2 <.LBB386>: + 17c2: 1aec add a1,sp,380 + 17c4: 0028 add a0,sp,8 + +000017c6 <.LVL608>: + 17c6: 00000097 auipc ra,0x0 + 17ca: 000080e7 jalr ra # 17c6 <.LVL608> + +000017ce <.LVL609>: + 17ce: 28c12403 lw s0,652(sp) + +000017d2 <.LVL610>: + 17d2: c02a sw a0,0(sp) + +000017d4 <.LVL611>: + 17d4: 28812503 lw a0,648(sp) + +000017d8 <.LVL612>: + 17d8: 85a2 mv a1,s0 + 17da: 00000097 auipc ra,0x0 + 17de: 000080e7 jalr ra # 17da <.LVL612+0x2> + +000017e2 <.LBE386>: + 17e2: 30812423 sw s0,776(sp) + 17e6: 30412403 lw s0,772(sp) + +000017ea <.LVL614>: + 17ea: 4702 lw a4,0(sp) + 17ec: 30812083 lw ra,776(sp) + 17f0: 30012483 lw s1,768(sp) + +000017f4 <.LVL615>: + 17f4: 2fc12503 lw a0,764(sp) + 17f8: 2f812583 lw a1,760(sp) + 17fc: 2f412603 lw a2,756(sp) + 1800: 2f012683 lw a3,752(sp) + 1804: 30c10113 add sp,sp,780 + +00001808 <.LVL616>: + 1808: 913a add sp,sp,a4 + +0000180a <.LVL617>: + 180a: 8082 ret + +0000180c <.L446>: + 180c: 30812083 lw ra,776(sp) + 1810: 30412403 lw s0,772(sp) + +00001814 <.LVL619>: + 1814: 30012483 lw s1,768(sp) + +00001818 <.LVL620>: + 1818: 30c10113 add sp,sp,780 + +0000181c <.LVL621>: + 181c: 8082 ret + +0000181e <_Unwind_Resume>: + 181e: cf410113 add sp,sp,-780 + 1822: 30812223 sw s0,772(sp) + 1826: 2ea12e23 sw a0,764(sp) + 182a: 842a mv s0,a0 + 182c: 2eb12c23 sw a1,760(sp) + 1830: 2ec12a23 sw a2,756(sp) + 1834: 066c add a1,sp,780 + 1836: 8606 mv a2,ra + 1838: 0028 add a0,sp,8 + +0000183a <.LVL623>: + 183a: 30112423 sw ra,776(sp) + 183e: 2ed12823 sw a3,752(sp) + 1842: 30912023 sw s1,768(sp) + 1846: 00000097 auipc ra,0x0 + 184a: 000080e7 jalr ra # 1846 <.LVL623+0xc> + +0000184e <.LVL624>: + 184e: 17400613 li a2,372 + 1852: 002c add a1,sp,8 + 1854: 1ae8 add a0,sp,380 + 1856: 00000097 auipc ra,0x0 + 185a: 000080e7 jalr ra # 1856 <.LVL624+0x8> + +0000185e <.LVL625>: + 185e: 445c lw a5,12(s0) + 1860: 0050 add a2,sp,4 + 1862: 1aec add a1,sp,380 + 1864: 8522 mv a0,s0 + 1866: ef81 bnez a5,187e <.L448> + 1868: 00000097 auipc ra,0x0 + 186c: 000080e7 jalr ra # 1868 <.LVL625+0xa> + +00001870 <.L449>: + 1870: 479d li a5,7 + 1872: 00f50b63 beq a0,a5,1888 <.L450> + 1876: 00000097 auipc ra,0x0 + 187a: 000080e7 jalr ra # 1876 <.L449+0x6> + +0000187e <.L448>: + 187e: 00000097 auipc ra,0x0 + 1882: 000080e7 jalr ra # 187e <.L448> + +00001886 <.LVL628>: + 1886: b7ed j 1870 <.L449> + +00001888 <.L450>: + 1888: 1aec add a1,sp,380 + 188a: 0028 add a0,sp,8 + +0000188c <.LVL630>: + 188c: 00000097 auipc ra,0x0 + 1890: 000080e7 jalr ra # 188c <.LVL630> + +00001894 <.LVL631>: + 1894: 28c12403 lw s0,652(sp) + +00001898 <.LVL632>: + 1898: c02a sw a0,0(sp) + +0000189a <.LVL633>: + 189a: 28812503 lw a0,648(sp) + +0000189e <.LVL634>: + 189e: 85a2 mv a1,s0 + 18a0: 00000097 auipc ra,0x0 + 18a4: 000080e7 jalr ra # 18a0 <.LVL634+0x2> + +000018a8 <.LBE387>: + 18a8: 30812423 sw s0,776(sp) + 18ac: 30412403 lw s0,772(sp) + +000018b0 <.LVL636>: + 18b0: 4702 lw a4,0(sp) + 18b2: 30812083 lw ra,776(sp) + 18b6: 30012483 lw s1,768(sp) + 18ba: 2fc12503 lw a0,764(sp) + 18be: 2f812583 lw a1,760(sp) + 18c2: 2f412603 lw a2,756(sp) + 18c6: 2f012683 lw a3,752(sp) + 18ca: 30c10113 add sp,sp,780 + +000018ce <.LVL637>: + 18ce: 913a add sp,sp,a4 + +000018d0 <.LVL638>: + 18d0: 8082 ret + +000018d2 <_Unwind_Resume_or_Rethrow>: + 18d2: 455c lw a5,12(a0) + 18d4: cf410113 add sp,sp,-780 + 18d8: 30812223 sw s0,772(sp) + 18dc: 2ec12a23 sw a2,756(sp) + 18e0: 30112423 sw ra,776(sp) + 18e4: 30912023 sw s1,768(sp) + 18e8: 2ea12e23 sw a0,764(sp) + 18ec: 2eb12c23 sw a1,760(sp) + 18f0: 2ed12823 sw a3,752(sp) + 18f4: 8606 mv a2,ra + 18f6: 842a mv s0,a0 + 18f8: c3d1 beqz a5,197c <.L459> + 18fa: 066c add a1,sp,780 + 18fc: 0028 add a0,sp,8 + +000018fe <.LVL640>: + 18fe: 00000097 auipc ra,0x0 + 1902: 000080e7 jalr ra # 18fe <.LVL640> + +00001906 <.LVL641>: + 1906: 17400613 li a2,372 + 190a: 002c add a1,sp,8 + 190c: 1ae8 add a0,sp,380 + 190e: 00000097 auipc ra,0x0 + 1912: 000080e7 jalr ra # 190e <.LVL641+0x8> + +00001916 <.LVL642>: + 1916: 0050 add a2,sp,4 + 1918: 1aec add a1,sp,380 + 191a: 8522 mv a0,s0 + 191c: 00000097 auipc ra,0x0 + 1920: 000080e7 jalr ra # 191c <.LVL642+0x6> + +00001924 <.LVL643>: + 1924: 479d li a5,7 + 1926: 00f50663 beq a0,a5,1932 <.L455> + 192a: 00000097 auipc ra,0x0 + 192e: 000080e7 jalr ra # 192a <.LVL643+0x6> + +00001932 <.L455>: + 1932: 1aec add a1,sp,380 + 1934: 0028 add a0,sp,8 + +00001936 <.LVL645>: + 1936: 00000097 auipc ra,0x0 + 193a: 000080e7 jalr ra # 1936 <.LVL645> + +0000193e <.LVL646>: + 193e: 28c12403 lw s0,652(sp) + +00001942 <.LVL647>: + 1942: c02a sw a0,0(sp) + +00001944 <.LVL648>: + 1944: 28812503 lw a0,648(sp) + +00001948 <.LVL649>: + 1948: 85a2 mv a1,s0 + 194a: 00000097 auipc ra,0x0 + 194e: 000080e7 jalr ra # 194a <.LVL649+0x2> + +00001952 <.LBE388>: + 1952: 30812423 sw s0,776(sp) + 1956: 30412403 lw s0,772(sp) + +0000195a <.LVL651>: + 195a: 4702 lw a4,0(sp) + 195c: 30812083 lw ra,776(sp) + 1960: 30012483 lw s1,768(sp) + 1964: 2fc12503 lw a0,764(sp) + 1968: 2f812583 lw a1,760(sp) + 196c: 2f412603 lw a2,756(sp) + 1970: 2f012683 lw a3,752(sp) + 1974: 30c10113 add sp,sp,780 + +00001978 <.LVL652>: + 1978: 913a add sp,sp,a4 + +0000197a <.LVL653>: + 197a: 8082 ret + +0000197c <.L459>: + 197c: 00000097 auipc ra,0x0 + 1980: 000080e7 jalr ra # 197c <.L459> + +00001984 <.LVL655>: + 1984: 30812083 lw ra,776(sp) + 1988: 30412403 lw s0,772(sp) + +0000198c <.LVL656>: + 198c: 30012483 lw s1,768(sp) + 1990: 30c10113 add sp,sp,780 + 1994: 8082 ret + +00001996 <_Unwind_DeleteException>: + 1996: 451c lw a5,8(a0) + 1998: 85aa mv a1,a0 + 199a: c399 beqz a5,19a0 <.L460> + 199c: 4505 li a0,1 + +0000199e <.LVL658>: + 199e: 8782 jr a5 + +000019a0 <.L460>: + 19a0: 8082 ret + +000019a2 <_Unwind_Backtrace>: + 19a2: c3410113 add sp,sp,-972 + 19a6: 3c812223 sw s0,964(sp) + 19aa: c02e sw a1,0(sp) + 19ac: 842a mv s0,a0 + 19ae: 8606 mv a2,ra + 19b0: 07ec add a1,sp,972 + +000019b2 <.LVL661>: + 19b2: 0048 add a0,sp,4 + +000019b4 <.LVL662>: + 19b4: 3c112423 sw ra,968(sp) + 19b8: 3c912023 sw s1,960(sp) + 19bc: 00000097 auipc ra,0x0 + 19c0: 000080e7 jalr ra # 19bc <.LVL662+0x8> + +000019c4 <.L466>: + 19c4: 1aac add a1,sp,376 + 19c6: 0048 add a0,sp,4 + 19c8: 00000097 auipc ra,0x0 + 19cc: 000080e7 jalr ra # 19c8 <.L466+0x4> + +000019d0 <.LVL664>: + 19d0: 84aa mv s1,a0 + +000019d2 <.LVL665>: + 19d2: c511 beqz a0,19de <.L463> + 19d4: ffc50713 add a4,a0,-4 + 19d8: 4685 li a3,1 + 19da: 02e6e063 bltu a3,a4,19fa <.L464> + +000019de <.L463>: + 19de: 4582 lw a1,0(sp) + 19e0: 0048 add a0,sp,4 + 19e2: 9402 jalr s0 + +000019e4 <.LVL666>: + 19e4: e919 bnez a0,19fa <.L464> + 19e6: 4715 li a4,5 + 19e8: 00e48a63 beq s1,a4,19fc <.L462> + 19ec: 1aac add a1,sp,376 + 19ee: 0048 add a0,sp,4 + 19f0: 00000097 auipc ra,0x0 + 19f4: 000080e7 jalr ra # 19f0 <.LVL666+0xc> + +000019f8 <.LBE389>: + 19f8: b7f1 j 19c4 <.L466> + +000019fa <.L464>: + 19fa: 448d li s1,3 + +000019fc <.L462>: + 19fc: 3c812083 lw ra,968(sp) + 1a00: 3c412403 lw s0,964(sp) + +00001a04 <.LVL669>: + 1a04: 8526 mv a0,s1 + 1a06: 3c012483 lw s1,960(sp) + 1a0a: 3cc10113 add sp,sp,972 + +00001a0e <.LVL670>: + 1a0e: 8082 ret + +unwind-dw2-fde.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 : + 0: 4701 li a4,0 + 2: 4681 li a3,0 + +00000004 <.L2>: + 4: 00054783 lbu a5,0(a0) + 8: 0505 add a0,a0,1 + +0000000a <.LVL2>: + a: 07f7f613 and a2,a5,127 + e: 07e2 sll a5,a5,0x18 + +00000010 <.LVL3>: + 10: 00d61633 sll a2,a2,a3 + 14: 87e1 sra a5,a5,0x18 + 16: 8f51 or a4,a4,a2 + 18: 069d add a3,a3,7 + 1a: fe07c5e3 bltz a5,4 <.L2> + 1e: c198 sw a4,0(a1) + +00000020 <.LVL6>: + 20: 8082 ret + +00000022 : + 22: 4781 li a5,0 + 24: 4701 li a4,0 + +00000026 <.L5>: + 26: 00054683 lbu a3,0(a0) + 2a: 0505 add a0,a0,1 + +0000002c <.LVL9>: + 2c: 07f6f613 and a2,a3,127 + 30: 00e61633 sll a2,a2,a4 + 34: 8fd1 or a5,a5,a2 + 36: 01869613 sll a2,a3,0x18 + 3a: 8661 sra a2,a2,0x18 + 3c: 071d add a4,a4,7 + 3e: fe0644e3 bltz a2,26 <.L5> + 42: 467d li a2,31 + 44: 00e66963 bltu a2,a4,56 <.L6> + 48: 0406f693 and a3,a3,64 + +0000004c <.LVL12>: + 4c: c689 beqz a3,56 <.L6> + 4e: 56fd li a3,-1 + 50: 00e69733 sll a4,a3,a4 + +00000054 <.LVL13>: + 54: 8fd9 or a5,a5,a4 + +00000056 <.L6>: + 56: c19c sw a5,0(a1) + +00000058 <.LVL15>: + 58: 8082 ret + +0000005a : + 5a: 1101 add sp,sp,-32 + 5c: 00169793 sll a5,a3,0x1 + 60: cc22 sw s0,24(sp) + 62: ce06 sw ra,28(sp) + 64: ca26 sw s1,20(sp) + 66: c02a sw a0,0(sp) + 68: c22e sw a1,4(sp) + 6a: 8432 mv s0,a2 + 6c: c43a sw a4,8(sp) + 6e: 0785 add a5,a5,1 + +00000070 <.L12>: + 70: 4722 lw a4,8(sp) + 72: 00e7c763 blt a5,a4,80 <.L16> + +00000076 <.L11>: + 76: 40f2 lw ra,28(sp) + 78: 4462 lw s0,24(sp) + +0000007a <.LVL19>: + 7a: 44d2 lw s1,20(sp) + 7c: 6105 add sp,sp,32 + +0000007e <.LVL20>: + 7e: 8082 ret + +00000080 <.L16>: + 80: 4722 lw a4,8(sp) + 82: 00178493 add s1,a5,1 + 86: 02e4d063 bge s1,a4,a6 <.L13> + 8a: 00279593 sll a1,a5,0x2 + 8e: 95a2 add a1,a1,s0 + 90: 41d0 lw a2,4(a1) + 92: c63e sw a5,12(sp) + 94: 418c lw a1,0(a1) + 96: 4792 lw a5,4(sp) + +00000098 <.LVL22>: + 98: 4502 lw a0,0(sp) + 9a: c836 sw a3,16(sp) + 9c: 9782 jalr a5 + +0000009e <.LVL23>: + 9e: 47b2 lw a5,12(sp) + a0: 46c2 lw a3,16(sp) + a2: 00054363 bltz a0,a8 <.L14> + +000000a6 <.L13>: + a6: 84be mv s1,a5 + +000000a8 <.L14>: + a8: 068a sll a3,a3,0x2 + aa: 00249793 sll a5,s1,0x2 + ae: 97a2 add a5,a5,s0 + b0: 96a2 add a3,a3,s0 + b2: 4390 lw a2,0(a5) + b4: c83e sw a5,16(sp) + b6: 428c lw a1,0(a3) + b8: 4502 lw a0,0(sp) + ba: 4792 lw a5,4(sp) + bc: c636 sw a3,12(sp) + be: 9782 jalr a5 + +000000c0 <.LVL26>: + c0: fa055be3 bgez a0,76 <.L11> + +000000c4 <.LBB49>: + c4: 47c2 lw a5,16(sp) + c6: 46b2 lw a3,12(sp) + c8: 438c lw a1,0(a5) + ca: 4290 lw a2,0(a3) + cc: c28c sw a1,0(a3) + ce: c390 sw a2,0(a5) + +000000d0 <.LBE49>: + d0: 00149793 sll a5,s1,0x1 + d4: 0785 add a5,a5,1 + +000000d6 <.LVL29>: + d6: 86a6 mv a3,s1 + d8: bf61 j 70 <.L12> + +000000da : + da: 1111 add sp,sp,-28 + dc: ca22 sw s0,20(sp) + de: 4240 lw s0,4(a2) + e0: 00860793 add a5,a2,8 + e4: c826 sw s1,16(sp) + e6: cc06 sw ra,24(sp) + e8: c22a sw a0,4(sp) + ea: c42e sw a1,8(sp) + ec: 84b2 mv s1,a2 + ee: c03e sw a5,0(sp) + +000000f0 <.LVL31>: + f0: 00145693 srl a3,s0,0x1 + +000000f4 <.L25>: + f4: 16fd add a3,a3,-1 + +000000f6 <.LVL33>: + f6: 577d li a4,-1 + f8: 02e69063 bne a3,a4,118 <.L21> + fc: 00241793 sll a5,s0,0x2 + 100: fff40713 add a4,s0,-1 + +00000104 <.LVL34>: + 104: 00f48433 add s0,s1,a5 + +00000108 <.L22>: + 108: 1471 add s0,s0,-4 + 10a: 02e04263 bgtz a4,12e <.L23> + 10e: 40e2 lw ra,24(sp) + 110: 4452 lw s0,20(sp) + 112: 44c2 lw s1,16(sp) + +00000114 <.LVL36>: + 114: 0171 add sp,sp,28 + +00000116 <.LVL37>: + 116: 8082 ret + +00000118 <.L21>: + 118: 4602 lw a2,0(sp) + 11a: 45a2 lw a1,8(sp) + 11c: 4512 lw a0,4(sp) + 11e: 8722 mv a4,s0 + 120: c636 sw a3,12(sp) + 122: 00000097 auipc ra,0x0 + 126: 000080e7 jalr ra # 122 <.L21+0xa> + +0000012a <.LVL39>: + 12a: 46b2 lw a3,12(sp) + 12c: b7e1 j f4 <.L25> + +0000012e <.L23>: + 12e: 4410 lw a2,8(s0) + 130: 4494 lw a3,8(s1) + +00000132 <.LBE50>: + 132: 45a2 lw a1,8(sp) + +00000134 <.LBB51>: + 134: c490 sw a2,8(s1) + +00000136 <.LBE51>: + 136: 4512 lw a0,4(sp) + 138: 4602 lw a2,0(sp) + +0000013a <.LBB52>: + 13a: c414 sw a3,8(s0) + +0000013c <.LBE52>: + 13c: 4681 li a3,0 + +0000013e <.LVL42>: + 13e: c63a sw a4,12(sp) + 140: 00000097 auipc ra,0x0 + 144: 000080e7 jalr ra # 140 <.LVL42+0x2> + +00000148 <.LVL43>: + 148: 4732 lw a4,12(sp) + 14a: 177d add a4,a4,-1 + +0000014c <.LVL44>: + 14c: bf75 j 108 <.L22> + +0000014e : + 14e: 0ff00793 li a5,255 + 152: 02f50963 beq a0,a5,184 <.L30> + 156: 00757793 and a5,a0,7 + 15a: 4709 li a4,2 + 15c: 02e78663 beq a5,a4,188 <.L31> + 160: 00f76a63 bltu a4,a5,174 <.L28> + 164: 4511 li a0,4 + +00000166 <.LVL46>: + 166: cf91 beqz a5,182 <.L26> + +00000168 <.L29>: + 168: 1151 add sp,sp,-12 + 16a: c406 sw ra,8(sp) + 16c: 00000097 auipc ra,0x0 + 170: 000080e7 jalr ra # 16c <.L29+0x4> + +00000174 <.L28>: + 174: 470d li a4,3 + 176: 00e78b63 beq a5,a4,18c <.L33> + 17a: 4711 li a4,4 + 17c: 4521 li a0,8 + +0000017e <.LVL48>: + 17e: fee795e3 bne a5,a4,168 <.L29> + +00000182 <.L26>: + 182: 8082 ret + +00000184 <.L30>: + 184: 4501 li a0,0 + +00000186 <.LVL50>: + 186: 8082 ret + +00000188 <.L31>: + 188: 4509 li a0,2 + +0000018a <.LVL52>: + 18a: 8082 ret + +0000018c <.L33>: + 18c: 4511 li a0,4 + +0000018e <.LVL54>: + 18e: bfd5 j 182 <.L26> + +00000190 : + 190: 0ff00793 li a5,255 + 194: 02f50d63 beq a0,a5,1ce <.L44> + 198: 07057793 and a5,a0,112 + 19c: 02000713 li a4,32 + 1a0: 02e78363 beq a5,a4,1c6 <.L40> + 1a4: 02f77563 bgeu a4,a5,1ce <.L44> + 1a8: 03000713 li a4,48 + 1ac: 00e78f63 beq a5,a4,1ca <.L41> + 1b0: 05000713 li a4,80 + 1b4: 4501 li a0,0 + +000001b6 <.LVL56>: + 1b6: 00e78d63 beq a5,a4,1d0 <.L38> + 1ba: 1151 add sp,sp,-12 + 1bc: c406 sw ra,8(sp) + 1be: 00000097 auipc ra,0x0 + 1c2: 000080e7 jalr ra # 1be <.LVL56+0x8> + +000001c6 <.L40>: + 1c6: 41c8 lw a0,4(a1) + +000001c8 <.LVL58>: + 1c8: 8082 ret + +000001ca <.L41>: + 1ca: 4588 lw a0,8(a1) + +000001cc <.LVL60>: + 1cc: 8082 ret + +000001ce <.L44>: + 1ce: 4501 li a0,0 + +000001d0 <.L38>: + 1d0: 8082 ret + +000001d2 : + 1d2: 1121 add sp,sp,-24 + 1d4: ca06 sw ra,20(sp) + 1d6: c822 sw s0,16(sp) + 1d8: c626 sw s1,12(sp) + 1da: c036 sw a3,0(sp) + 1dc: 05000793 li a5,80 + 1e0: 00f51e63 bne a0,a5,1fc <.L51> + +000001e4 <.LBB53>: + 1e4: 00360513 add a0,a2,3 + +000001e8 <.LVL65>: + 1e8: 9971 and a0,a0,-4 + +000001ea <.LVL66>: + 1ea: 411c lw a5,0(a0) + +000001ec <.LVL67>: + 1ec: 0511 add a0,a0,4 + +000001ee <.L52>: + 1ee: 4702 lw a4,0(sp) + 1f0: 40d2 lw ra,20(sp) + 1f2: 4442 lw s0,16(sp) + 1f4: c31c sw a5,0(a4) + 1f6: 44b2 lw s1,12(sp) + 1f8: 0161 add sp,sp,24 + +000001fa <.LVL69>: + 1fa: 8082 ret + +000001fc <.L51>: + 1fc: 00f57793 and a5,a0,15 + 200: 46b1 li a3,12 + +00000202 <.LVL71>: + 202: 84aa mv s1,a0 + 204: 0af6ef63 bltu a3,a5,2c2 <.L53> + 208: 000006b7 lui a3,0x0 + 20c: 078a sll a5,a5,0x2 + 20e: 00068693 mv a3,a3 + 212: 97b6 add a5,a5,a3 + 214: 439c lw a5,0(a5) + 216: 842e mv s0,a1 + 218: 8782 jr a5 + +0000021a <.L62>: + 21a: 002c add a1,sp,8 + 21c: 8532 mv a0,a2 + +0000021e <.LVL73>: + 21e: c232 sw a2,4(sp) + 220: 00000097 auipc ra,0x0 + 224: 000080e7 jalr ra # 220 <.LVL73+0x2> + +00000228 <.L70>: + 228: 47a2 lw a5,8(sp) + +0000022a <.LBE55>: + 22a: 4612 lw a2,4(sp) + +0000022c <.L64>: + 22c: d3e9 beqz a5,1ee <.L52> + 22e: 0704f693 and a3,s1,112 + 232: 45c1 li a1,16 + 234: 00b69363 bne a3,a1,23a <.L65> + 238: 8432 mv s0,a2 + +0000023a <.L65>: + 23a: 01849713 sll a4,s1,0x18 + 23e: 8761 sra a4,a4,0x18 + 240: 97a2 add a5,a5,s0 + 242: fa0756e3 bgez a4,1ee <.L52> + 246: 439c lw a5,0(a5) + 248: b75d j 1ee <.L52> + +0000024a <.L58>: + 24a: 002c add a1,sp,8 + 24c: 8532 mv a0,a2 + +0000024e <.LVL81>: + 24e: c232 sw a2,4(sp) + 250: 00000097 auipc ra,0x0 + 254: 000080e7 jalr ra # 250 <.LVL81+0x2> + +00000258 <.LVL82>: + 258: bfc1 j 228 <.L70> + +0000025a <.L61>: + 25a: 00164783 lbu a5,1(a2) + 25e: 00064683 lbu a3,0(a2) + 262: 07a2 sll a5,a5,0x8 + 264: 8fd5 or a5,a5,a3 + +00000266 <.L71>: + 266: 00260513 add a0,a2,2 + +0000026a <.LVL85>: + 26a: b7c9 j 22c <.L64> + +0000026c <.L57>: + 26c: 00164783 lbu a5,1(a2) + 270: 00064683 lbu a3,0(a2) + 274: 07a2 sll a5,a5,0x8 + 276: 8fd5 or a5,a5,a3 + 278: 07c2 sll a5,a5,0x10 + 27a: 87c1 sra a5,a5,0x10 + 27c: b7ed j 266 <.L71> + +0000027e <.L56>: + 27e: 00164783 lbu a5,1(a2) + 282: 00064683 lbu a3,0(a2) + 286: 00460513 add a0,a2,4 + +0000028a <.LVL87>: + 28a: 07a2 sll a5,a5,0x8 + 28c: 8fd5 or a5,a5,a3 + 28e: 00264683 lbu a3,2(a2) + 292: 06c2 sll a3,a3,0x10 + 294: 8edd or a3,a3,a5 + 296: 00364783 lbu a5,3(a2) + 29a: 07e2 sll a5,a5,0x18 + 29c: 8fd5 or a5,a5,a3 + +0000029e <.LVL88>: + 29e: b779 j 22c <.L64> + +000002a0 <.L54>: + 2a0: 00164783 lbu a5,1(a2) + 2a4: 00064683 lbu a3,0(a2) + 2a8: 00860513 add a0,a2,8 + +000002ac <.LVL90>: + 2ac: 07a2 sll a5,a5,0x8 + 2ae: 8fd5 or a5,a5,a3 + 2b0: 00264683 lbu a3,2(a2) + 2b4: 06c2 sll a3,a3,0x10 + 2b6: 8edd or a3,a3,a5 + 2b8: 00364783 lbu a5,3(a2) + 2bc: 07e2 sll a5,a5,0x18 + 2be: 8fd5 or a5,a5,a3 + +000002c0 <.LVL91>: + 2c0: b7b5 j 22c <.L64> + +000002c2 <.L53>: + 2c2: 00000097 auipc ra,0x0 + 2c6: 000080e7 jalr ra # 2c2 <.L53> + +000002ca : + 2ca: 1121 add sp,sp,-24 + 2cc: c822 sw s0,16(sp) + 2ce: 4900 lw s0,16(a0) + 2d0: c02e sw a1,0(sp) + 2d2: 85aa mv a1,a0 + +000002d4 <.LVL95>: + 2d4: 800d srl s0,s0,0x3 + 2d6: 0ff47413 zext.b s0,s0 + 2da: 8522 mv a0,s0 + +000002dc <.LVL96>: + 2dc: ca06 sw ra,20(sp) + 2de: c626 sw s1,12(sp) + 2e0: 84b2 mv s1,a2 + 2e2: 00000097 auipc ra,0x0 + 2e6: 000080e7 jalr ra # 2e2 <.LVL96+0x6> + +000002ea <.LVL97>: + 2ea: 4782 lw a5,0(sp) + 2ec: 85aa mv a1,a0 + +000002ee <.LVL98>: + 2ee: 0054 add a3,sp,4 + 2f0: 00878613 add a2,a5,8 + 2f4: c02a sw a0,0(sp) + +000002f6 <.LVL99>: + 2f6: 8522 mv a0,s0 + +000002f8 <.LVL100>: + 2f8: 00000097 auipc ra,0x0 + 2fc: 000080e7 jalr ra # 2f8 <.LVL100> + +00000300 <.LVL101>: + 300: 4582 lw a1,0(sp) + 302: 0034 add a3,sp,8 + 304: 00848613 add a2,s1,8 + 308: 8522 mv a0,s0 + 30a: 00000097 auipc ra,0x0 + 30e: 000080e7 jalr ra # 30a <.LVL101+0xa> + +00000312 <.LVL102>: + 312: 4512 lw a0,4(sp) + 314: 47a2 lw a5,8(sp) + 316: 00a7eb63 bltu a5,a0,32c <.L74> + 31a: 00f53533 sltu a0,a0,a5 + 31e: 40a00533 neg a0,a0 + +00000322 <.L72>: + 322: 40d2 lw ra,20(sp) + 324: 4442 lw s0,16(sp) + 326: 44b2 lw s1,12(sp) + +00000328 <.LVL103>: + 328: 0161 add sp,sp,24 + +0000032a <.LVL104>: + 32a: 8082 ret + +0000032c <.L74>: + 32c: 4505 li a0,1 + 32e: bfd5 j 322 <.L72> + +00000330 : + 330: 1121 add sp,sp,-24 + 332: c626 sw s1,12(sp) + 334: 00950493 add s1,a0,9 + +00000338 <.LVL107>: + 338: c822 sw s0,16(sp) + 33a: 842a mv s0,a0 + 33c: 8526 mv a0,s1 + +0000033e <.LVL108>: + 33e: ca06 sw ra,20(sp) + 340: 00000097 auipc ra,0x0 + 344: 000080e7 jalr ra # 340 <.LVL108+0x2> + +00000348 <.LVL109>: + 348: 0505 add a0,a0,1 + 34a: 9526 add a0,a0,s1 + +0000034c <.LVL110>: + 34c: 00844483 lbu s1,8(s0) + +00000350 <.LVL111>: + 350: 478d li a5,3 + 352: 0097fd63 bgeu a5,s1,36c <.L77> + 356: 00054683 lbu a3,0(a0) + 35a: 4711 li a4,4 + 35c: 0ff00793 li a5,255 + 360: 00e69d63 bne a3,a4,37a <.L76> + 364: 00154703 lbu a4,1(a0) + 368: eb09 bnez a4,37a <.L76> + 36a: 0509 add a0,a0,2 + +0000036c <.L77>: + 36c: 00944703 lbu a4,9(s0) + 370: 07a00793 li a5,122 + 374: 00f70963 beq a4,a5,386 <.L79> + +00000378 <.L86>: + 378: 4781 li a5,0 + +0000037a <.L76>: + 37a: 40d2 lw ra,20(sp) + 37c: 4442 lw s0,16(sp) + 37e: 44b2 lw s1,12(sp) + 380: 853e mv a0,a5 + +00000382 <.LVL114>: + 382: 0161 add sp,sp,24 + 384: 8082 ret + +00000386 <.L79>: + 386: 004c add a1,sp,4 + 388: 00000097 auipc ra,0x0 + 38c: 000080e7 jalr ra # 388 <.L79+0x2> + +00000390 <.LVL116>: + 390: 002c add a1,sp,8 + 392: 00000097 auipc ra,0x0 + 396: 000080e7 jalr ra # 392 <.LVL116+0x2> + +0000039a <.LVL117>: + 39a: 4705 li a4,1 + 39c: 02e49263 bne s1,a4,3c0 <.L80> + 3a0: 0505 add a0,a0,1 + +000003a2 <.L81>: + 3a2: 004c add a1,sp,4 + 3a4: 0429 add s0,s0,10 + +000003a6 <.LVL119>: + 3a6: 00000097 auipc ra,0x0 + 3aa: 000080e7 jalr ra # 3a6 <.LVL119> + +000003ae <.L87>: + 3ae: 00044783 lbu a5,0(s0) + 3b2: 05200713 li a4,82 + 3b6: 00e79b63 bne a5,a4,3cc <.L82> + 3ba: 00054783 lbu a5,0(a0) + 3be: bf75 j 37a <.L76> + +000003c0 <.L80>: + 3c0: 004c add a1,sp,4 + 3c2: 00000097 auipc ra,0x0 + 3c6: 000080e7 jalr ra # 3c2 <.L80+0x2> + +000003ca <.LVL122>: + 3ca: bfe1 j 3a2 <.L81> + +000003cc <.L82>: + 3cc: 05000713 li a4,80 + 3d0: 02e79063 bne a5,a4,3f0 <.L83> + 3d4: 00054783 lbu a5,0(a0) + 3d8: 00150613 add a2,a0,1 + 3dc: 868a mv a3,sp + 3de: 4581 li a1,0 + 3e0: 07f7f513 and a0,a5,127 + +000003e4 <.LVL124>: + 3e4: 00000097 auipc ra,0x0 + 3e8: 000080e7 jalr ra # 3e4 <.LVL124> + +000003ec <.L84>: + 3ec: 0405 add s0,s0,1 + 3ee: b7c1 j 3ae <.L87> + +000003f0 <.L83>: + 3f0: 04c00713 li a4,76 + 3f4: 00e79463 bne a5,a4,3fc <.L85> + +000003f8 <.L91>: + 3f8: 0505 add a0,a0,1 + 3fa: bfcd j 3ec <.L84> + +000003fc <.L85>: + 3fc: 04200713 li a4,66 + 400: fee78ce3 beq a5,a4,3f8 <.L91> + 404: bf95 j 378 <.L86> + +00000406 : + 406: fd810113 add sp,sp,-40 + 40a: ce26 sw s1,28(sp) + 40c: d206 sw ra,36(sp) + 40e: 84ae mv s1,a1 + 410: d022 sw s0,32(sp) + 412: 832a mv t1,a0 + 414: 4581 li a1,0 + +00000416 <.LVL129>: + 416: 4281 li t0,0 + 418: c002 sw zero,0(sp) + 41a: 4781 li a5,0 + +0000041c <.L93>: + 41c: 4098 lw a4,0(s1) + 41e: c43a sw a4,8(sp) + +00000420 <.LBE57>: + 420: c70d beqz a4,44a <.L92> + +00000422 <.LBB59>: + 422: 40d4 lw a3,4(s1) + 424: c2f5 beqz a3,508 <.L94> + +00000426 <.LBB60>: + 426: 00448413 add s0,s1,4 + 42a: 8c15 sub s0,s0,a3 + +0000042c <.LBE60>: + 42c: 06878463 beq a5,s0,494 <.L95> + 430: 8522 mv a0,s0 + 432: c21a sw t1,4(sp) + +00000434 <.LVL134>: + 434: 00000097 auipc ra,0x0 + 438: 000080e7 jalr ra # 434 <.LVL134> + +0000043c <.LVL135>: + 43c: 0ff00793 li a5,255 + 440: 4312 lw t1,4(sp) + 442: 00f51b63 bne a0,a5,458 <.L96> + 446: 57fd li a5,-1 + 448: c03e sw a5,0(sp) + +0000044a <.L92>: + 44a: 5092 lw ra,36(sp) + 44c: 5402 lw s0,32(sp) + 44e: 4502 lw a0,0(sp) + 450: 44f2 lw s1,28(sp) + +00000452 <.LVL137>: + 452: 02810113 add sp,sp,40 + 456: 8082 ret + +00000458 <.L96>: + 458: 0ff57693 zext.b a3,a0 + 45c: 859a mv a1,t1 + 45e: c82a sw a0,16(sp) + 460: 8536 mv a0,a3 + +00000462 <.LVL139>: + 462: c61a sw t1,12(sp) + 464: c236 sw a3,4(sp) + 466: 00000097 auipc ra,0x0 + 46a: 000080e7 jalr ra # 466 <.LVL139+0x4> + +0000046e <.LVL140>: + 46e: 4332 lw t1,12(sp) + 470: 85aa mv a1,a0 + +00000472 <.LVL141>: + 472: 7f800613 li a2,2040 + 476: 01032783 lw a5,16(t1) + 47a: 4692 lw a3,4(sp) + 47c: 42c2 lw t0,16(sp) + 47e: 7f87f513 and a0,a5,2040 + +00000482 <.LVL142>: + 482: 06c51963 bne a0,a2,4f4 <.L98> + 486: 00369513 sll a0,a3,0x3 + 48a: 8077f793 and a5,a5,-2041 + 48e: 8fc9 or a5,a5,a0 + +00000490 <.L111>: + 490: 00f32823 sw a5,16(t1) + +00000494 <.L95>: + 494: 0ff2f793 zext.b a5,t0 + 498: 0834 add a3,sp,24 + 49a: 853e mv a0,a5 + 49c: 00848613 add a2,s1,8 + 4a0: ca1a sw t1,20(sp) + +000004a2 <.LVL144>: + 4a2: c816 sw t0,16(sp) + 4a4: c62e sw a1,12(sp) + 4a6: c23e sw a5,4(sp) + 4a8: 00000097 auipc ra,0x0 + 4ac: 000080e7 jalr ra # 4a8 <.LVL144+0x6> + +000004b0 <.LVL145>: + 4b0: 4512 lw a0,4(sp) + 4b2: 00000097 auipc ra,0x0 + 4b6: 000080e7 jalr ra # 4b2 <.LVL145+0x2> + +000004ba <.LVL146>: + 4ba: 468d li a3,3 + 4bc: 45b2 lw a1,12(sp) + 4be: 42c2 lw t0,16(sp) + 4c0: 4352 lw t1,20(sp) + 4c2: 57fd li a5,-1 + 4c4: 00a6e763 bltu a3,a0,4d2 <.L101> + 4c8: 050e sll a0,a0,0x3 + +000004ca <.LVL147>: + 4ca: 4785 li a5,1 + 4cc: 00a797b3 sll a5,a5,a0 + 4d0: 17fd add a5,a5,-1 + +000004d2 <.L101>: + 4d2: 46e2 lw a3,24(sp) + 4d4: 8ff5 and a5,a5,a3 + +000004d6 <.LVL149>: + 4d6: cb85 beqz a5,506 <.L106> + 4d8: 4782 lw a5,0(sp) + 4da: 0785 add a5,a5,1 + 4dc: c03e sw a5,0(sp) + +000004de <.LVL150>: + 4de: 00032783 lw a5,0(t1) + +000004e2 <.LVL151>: + 4e2: 00f6f463 bgeu a3,a5,4ea <.L103> + 4e6: 00d32023 sw a3,0(t1) + +000004ea <.L103>: + 4ea: 47a2 lw a5,8(sp) + 4ec: 0791 add a5,a5,4 + 4ee: 94be add s1,s1,a5 + +000004f0 <.LVL153>: + 4f0: 87a2 mv a5,s0 + 4f2: b72d j 41c <.L93> + +000004f4 <.L98>: + 4f4: 0037d693 srl a3,a5,0x3 + 4f8: 0ff6f693 zext.b a3,a3 + 4fc: f8568ce3 beq a3,t0,494 <.L95> + 500: 0047e793 or a5,a5,4 + 504: b771 j 490 <.L111> + +00000506 <.L106>: + 506: 87a2 mv a5,s0 + +00000508 <.L94>: + 508: 843e mv s0,a5 + 50a: b7c5 j 4ea <.L103> + +0000050c : + 50c: 491c lw a5,16(a0) + 50e: fd410113 add sp,sp,-44 + 512: d222 sw s0,36(sp) + 514: 838d srl a5,a5,0x3 + 516: 0ff7f793 zext.b a5,a5 + 51a: d026 sw s1,32(sp) + 51c: 842a mv s0,a0 + 51e: 84ae mv s1,a1 + 520: 85aa mv a1,a0 + +00000522 <.LVL158>: + 522: 853e mv a0,a5 + +00000524 <.LVL159>: + 524: c03e sw a5,0(sp) + +00000526 <.LVL160>: + 526: d406 sw ra,40(sp) + 528: c432 sw a2,8(sp) + 52a: 00000097 auipc ra,0x0 + 52e: 000080e7 jalr ra # 52a <.LVL160+0x4> + +00000532 <.LVL161>: + 532: 82aa mv t0,a0 + +00000534 <.LVL162>: + 534: 87a6 mv a5,s1 + 536: 4701 li a4,0 + +00000538 <.L113>: + 538: 4394 lw a3,0(a5) + 53a: c236 sw a3,4(sp) + +0000053c <.LBE66>: + 53c: e299 bnez a3,542 <.L122> + 53e: 4781 li a5,0 + +00000540 <.LVL165>: + 540: a8a9 j 59a <.L112> + +00000542 <.L122>: + 542: 43d0 lw a2,4(a5) + 544: ce4d beqz a2,5fe <.L123> + 546: 4814 lw a3,16(s0) + 548: 833a mv t1,a4 + 54a: 8a91 and a3,a3,4 + 54c: ca8d beqz a3,57e <.L115> + +0000054e <.LBB69>: + 54e: 00478313 add t1,a5,4 + 552: 40c30333 sub t1,t1,a2 + +00000556 <.LBE69>: + 556: 02670463 beq a4,t1,57e <.L115> + 55a: 851a mv a0,t1 + 55c: c83e sw a5,16(sp) + +0000055e <.LVL169>: + 55e: c61a sw t1,12(sp) + 560: 00000097 auipc ra,0x0 + 564: 000080e7 jalr ra # 560 <.LVL169+0x2> + +00000568 <.LVL170>: + 568: c02a sw a0,0(sp) + +0000056a <.LVL171>: + 56a: 00014503 lbu a0,0(sp) + +0000056e <.LVL172>: + 56e: 85a2 mv a1,s0 + 570: 00000097 auipc ra,0x0 + 574: 000080e7 jalr ra # 570 <.LVL172+0x2> + +00000578 <.LVL173>: + 578: 47c2 lw a5,16(sp) + 57a: 4332 lw t1,12(sp) + 57c: 82aa mv t0,a0 + +0000057e <.L115>: + 57e: 4702 lw a4,0(sp) + 580: e705 bnez a4,5a8 <.L116> + +00000582 <.LBB71>: + 582: 4798 lw a4,8(a5) + 584: 47d4 lw a3,12(a5) + 586: cc3a sw a4,24(sp) + 588: ce36 sw a3,28(sp) + +0000058a <.L134>: + 58a: cb3d beqz a4,600 <.L118> + +0000058c <.LBE71>: + 58c: 46a2 lw a3,8(sp) + 58e: 4762 lw a4,24(sp) + 590: 40e68733 sub a4,a3,a4 + 594: 46f2 lw a3,28(sp) + 596: 06d77563 bgeu a4,a3,600 <.L118> + +0000059a <.L112>: + 59a: 50a2 lw ra,40(sp) + 59c: 5412 lw s0,36(sp) + +0000059e <.LVL178>: + 59e: 5482 lw s1,32(sp) + 5a0: 853e mv a0,a5 + 5a2: 02c10113 add sp,sp,44 + +000005a6 <.LVL179>: + 5a6: 8082 ret + +000005a8 <.L116>: + 5a8: 00014483 lbu s1,0(sp) + 5ac: 00878613 add a2,a5,8 + 5b0: 8596 mv a1,t0 + 5b2: 0834 add a3,sp,24 + 5b4: 8526 mv a0,s1 + 5b6: ca1a sw t1,20(sp) + 5b8: c83e sw a5,16(sp) + 5ba: c616 sw t0,12(sp) + 5bc: 00000097 auipc ra,0x0 + 5c0: 000080e7 jalr ra # 5bc <.L116+0x14> + +000005c4 <.LVL181>: + 5c4: 862a mv a2,a0 + +000005c6 <.LVL182>: + 5c6: 0874 add a3,sp,28 + 5c8: 4581 li a1,0 + 5ca: 00f4f513 and a0,s1,15 + +000005ce <.LVL183>: + 5ce: 00000097 auipc ra,0x0 + 5d2: 000080e7 jalr ra # 5ce <.LVL183> + +000005d6 <.LVL184>: + 5d6: 8526 mv a0,s1 + 5d8: 00000097 auipc ra,0x0 + 5dc: 000080e7 jalr ra # 5d8 <.LVL184+0x2> + +000005e0 <.LVL185>: + 5e0: 468d li a3,3 + 5e2: 42b2 lw t0,12(sp) + 5e4: 47c2 lw a5,16(sp) + 5e6: 4352 lw t1,20(sp) + 5e8: 577d li a4,-1 + 5ea: 00a6e763 bltu a3,a0,5f8 <.L119> + 5ee: 050e sll a0,a0,0x3 + +000005f0 <.LVL186>: + 5f0: 4705 li a4,1 + 5f2: 00a71733 sll a4,a4,a0 + 5f6: 177d add a4,a4,-1 + +000005f8 <.L119>: + 5f8: 46e2 lw a3,24(sp) + 5fa: 8f75 and a4,a4,a3 + +000005fc <.LVL188>: + 5fc: b779 j 58a <.L134> + +000005fe <.L123>: + 5fe: 833a mv t1,a4 + +00000600 <.L118>: + 600: 4712 lw a4,4(sp) + 602: 0711 add a4,a4,4 + 604: 97ba add a5,a5,a4 + +00000606 <.LVL191>: + 606: 871a mv a4,t1 + 608: bf05 j 538 <.L113> + +0000060a : + 60a: 00450713 add a4,a0,4 + 60e: 4148 lw a0,4(a0) + +00000610 <.LBE76>: + 610: 40a70533 sub a0,a4,a0 + 614: 00000317 auipc t1,0x0 + 618: 00030067 jr t1 # 614 <.LBE76+0x4> + +0000061c : + 61c: 1111 add sp,sp,-28 + 61e: c22a sw a0,4(sp) + 620: 852e mv a0,a1 + +00000622 <.LVL196>: + 622: cc06 sw ra,24(sp) + 624: ca22 sw s0,20(sp) + 626: c826 sw s1,16(sp) + 628: 842e mv s0,a1 + 62a: 84b2 mv s1,a2 + 62c: 00000097 auipc ra,0x0 + 630: 000080e7 jalr ra # 62c <.LVL196+0xa> + +00000634 <.LVL197>: + 634: 4592 lw a1,4(sp) + 636: 0ff57793 zext.b a5,a0 + 63a: 853e mv a0,a5 + +0000063c <.LVL198>: + 63c: c03e sw a5,0(sp) + 63e: 00000097 auipc ra,0x0 + 642: 000080e7 jalr ra # 63e <.LVL198+0x2> + +00000646 <.LVL199>: + 646: 85aa mv a1,a0 + 648: 4502 lw a0,0(sp) + 64a: 00840613 add a2,s0,8 + 64e: 0034 add a3,sp,8 + 650: 00000097 auipc ra,0x0 + 654: 000080e7 jalr ra # 650 <.LVL199+0xa> + +00000658 <.LVL200>: + 658: 8526 mv a0,s1 + 65a: 00000097 auipc ra,0x0 + 65e: 000080e7 jalr ra # 65a <.LVL200+0x2> + +00000662 <.LVL201>: + 662: 4592 lw a1,4(sp) + 664: 0ff57413 zext.b s0,a0 + +00000668 <.LVL202>: + 668: 8522 mv a0,s0 + +0000066a <.LVL203>: + 66a: 00000097 auipc ra,0x0 + 66e: 000080e7 jalr ra # 66a <.LVL203> + +00000672 <.LVL204>: + 672: 85aa mv a1,a0 + 674: 0074 add a3,sp,12 + 676: 00848613 add a2,s1,8 + 67a: 8522 mv a0,s0 + 67c: 00000097 auipc ra,0x0 + 680: 000080e7 jalr ra # 67c <.LVL204+0xa> + +00000684 <.LVL205>: + 684: 4522 lw a0,8(sp) + 686: 47b2 lw a5,12(sp) + 688: 00a7eb63 bltu a5,a0,69e <.L138> + 68c: 00f53533 sltu a0,a0,a5 + 690: 40a00533 neg a0,a0 + +00000694 <.L136>: + 694: 40e2 lw ra,24(sp) + 696: 4452 lw s0,20(sp) + 698: 44c2 lw s1,16(sp) + +0000069a <.LVL206>: + 69a: 0171 add sp,sp,28 + +0000069c <.LVL207>: + 69c: 8082 ret + +0000069e <.L138>: + 69e: 4505 li a0,1 + 6a0: bfd5 j 694 <.L136> + +000006a2 : + 6a2: 1131 add sp,sp,-20 + 6a4: c622 sw s0,12(sp) + 6a6: 05a1 add a1,a1,8 + +000006a8 <.LVL210>: + 6a8: 8432 mv s0,a2 + 6aa: 850a mv a0,sp + +000006ac <.LVL211>: + 6ac: 4611 li a2,4 + +000006ae <.LVL212>: + 6ae: c806 sw ra,16(sp) + 6b0: 00000097 auipc ra,0x0 + 6b4: 000080e7 jalr ra # 6b0 <.LVL212+0x2> + +000006b8 <.LVL213>: + 6b8: 4611 li a2,4 + 6ba: 00840593 add a1,s0,8 + 6be: 0048 add a0,sp,4 + 6c0: 00000097 auipc ra,0x0 + 6c4: 000080e7 jalr ra # 6c0 <.LVL213+0x8> + +000006c8 <.LVL214>: + 6c8: 4782 lw a5,0(sp) + 6ca: 4712 lw a4,4(sp) + 6cc: 4505 li a0,1 + 6ce: 00f76663 bltu a4,a5,6da <.L140> + 6d2: 00e7b7b3 sltu a5,a5,a4 + 6d6: 40f00533 neg a0,a5 + +000006da <.L140>: + 6da: 40c2 lw ra,16(sp) + 6dc: 4432 lw s0,12(sp) + +000006de <.LVL215>: + 6de: 0151 add sp,sp,20 + 6e0: 8082 ret + +000006e2 : + 6e2: 4918 lw a4,16(a0) + 6e4: fd810113 add sp,sp,-40 + 6e8: c22a sw a0,4(sp) + 6ea: 830d srl a4,a4,0x3 + 6ec: 0ff77793 zext.b a5,a4 + 6f0: ca2e sw a1,20(sp) + 6f2: 85aa mv a1,a0 + +000006f4 <.LVL217>: + 6f4: 853e mv a0,a5 + +000006f6 <.LVL218>: + 6f6: ce26 sw s1,28(sp) + 6f8: d206 sw ra,36(sp) + 6fa: d022 sw s0,32(sp) + 6fc: 84b2 mv s1,a2 + 6fe: c03e sw a5,0(sp) + +00000700 <.LVL219>: + 700: 00000097 auipc ra,0x0 + 704: 000080e7 jalr ra # 700 <.LVL219> + +00000708 <.LVL220>: + 708: c62a sw a0,12(sp) + +0000070a <.LVL221>: + 70a: 4701 li a4,0 + +0000070c <.L146>: + 70c: 409c lw a5,0(s1) + 70e: c83e sw a5,16(sp) + +00000710 <.LBE89>: + 710: e799 bnez a5,71e <.L155> + 712: 5092 lw ra,36(sp) + 714: 5402 lw s0,32(sp) + 716: 44f2 lw s1,28(sp) + +00000718 <.LVL224>: + 718: 02810113 add sp,sp,40 + +0000071c <.LVL225>: + 71c: 8082 ret + +0000071e <.L155>: + 71e: 40d0 lw a2,4(s1) + 720: 843a mv s0,a4 + 722: ce31 beqz a2,77e <.L147> + +00000724 <.LVL227>: + 724: 4792 lw a5,4(sp) + 726: 4b94 lw a3,16(a5) + 728: 8a91 and a3,a3,4 + 72a: c685 beqz a3,752 <.L148> + +0000072c <.LBB92>: + 72c: 00448413 add s0,s1,4 + +00000730 <.LVL229>: + 730: 8c11 sub s0,s0,a2 + +00000732 <.LBE92>: + 732: 02870063 beq a4,s0,752 <.L148> + +00000736 <.LVL231>: + 736: 8522 mv a0,s0 + 738: 00000097 auipc ra,0x0 + 73c: 000080e7 jalr ra # 738 <.LVL231+0x2> + +00000740 <.LVL232>: + 740: c02a sw a0,0(sp) + +00000742 <.LVL233>: + 742: 4592 lw a1,4(sp) + 744: 00014503 lbu a0,0(sp) + +00000748 <.LVL234>: + 748: 00000097 auipc ra,0x0 + 74c: 000080e7 jalr ra # 748 <.LVL234> + +00000750 <.LVL235>: + 750: c62a sw a0,12(sp) + +00000752 <.L148>: + 752: 4782 lw a5,0(sp) + +00000754 <.LBB94>: + 754: 00848593 add a1,s1,8 + +00000758 <.LBE94>: + 758: eb8d bnez a5,78a <.L149> + +0000075a <.LBB95>: + 75a: 4611 li a2,4 + 75c: 0828 add a0,sp,24 + 75e: 00000097 auipc ra,0x0 + 762: 000080e7 jalr ra # 75e <.LBB95+0x4> + +00000766 <.LVL237>: + 766: 4762 lw a4,24(sp) + +00000768 <.L164>: + 768: cb19 beqz a4,77e <.L147> + +0000076a <.LBE96>: + 76a: 47d2 lw a5,20(sp) + 76c: 4398 lw a4,0(a5) + +0000076e <.LBB97>: + 76e: cb01 beqz a4,77e <.L147> + 770: 4354 lw a3,4(a4) + 772: 00168613 add a2,a3,1 # 1 + 776: 068a sll a3,a3,0x2 + 778: c350 sw a2,4(a4) + 77a: 9736 add a4,a4,a3 + 77c: c704 sw s1,8(a4) + +0000077e <.L147>: + 77e: 47c2 lw a5,16(sp) + 780: 00478713 add a4,a5,4 + 784: 94ba add s1,s1,a4 + +00000786 <.LVL240>: + 786: 8722 mv a4,s0 + 788: b751 j 70c <.L146> + +0000078a <.L149>: + 78a: 00014703 lbu a4,0(sp) + 78e: 862e mv a2,a1 + 790: 45b2 lw a1,12(sp) + 792: 0834 add a3,sp,24 + 794: 853a mv a0,a4 + 796: c43a sw a4,8(sp) + 798: 00000097 auipc ra,0x0 + 79c: 000080e7 jalr ra # 798 <.L149+0xe> + +000007a0 <.LVL242>: + 7a0: 4522 lw a0,8(sp) + 7a2: 00000097 auipc ra,0x0 + 7a6: 000080e7 jalr ra # 7a2 <.LVL242+0x2> + +000007aa <.LVL243>: + 7aa: 468d li a3,3 + 7ac: 577d li a4,-1 + 7ae: 00a6e763 bltu a3,a0,7bc <.L152> + 7b2: 050e sll a0,a0,0x3 + +000007b4 <.LVL244>: + 7b4: 4705 li a4,1 + 7b6: 00a71733 sll a4,a4,a0 + 7ba: 177d add a4,a4,-1 + +000007bc <.L152>: + 7bc: 46e2 lw a3,24(sp) + 7be: 8f75 and a4,a4,a3 + +000007c0 <.LVL246>: + 7c0: b765 j 768 <.L164> + +000007c2 : + 7c2: 491c lw a5,16(a0) + 7c4: 7139 add sp,sp,-64 + 7c6: dc22 sw s0,56(sp) + 7c8: 0017f713 and a4,a5,1 + 7cc: de06 sw ra,60(sp) + 7ce: da26 sw s1,52(sp) + 7d0: c22e sw a1,4(sp) + 7d2: c43a sw a4,8(sp) + 7d4: 842a mv s0,a0 + 7d6: c715 beqz a4,802 <.L166> + +000007d8 <.L203>: + 7d8: 445c lw a5,12(s0) + +000007da <.LBE130>: + 7da: 4804 lw s1,16(s0) + +000007dc <.LBB135>: + 7dc: c03e sw a5,0(sp) + +000007de <.LBE135>: + 7de: 0014f793 and a5,s1,1 + 7e2: 2c079663 bnez a5,aae <.L167> + 7e6: 8889 and s1,s1,2 + 7e8: 44049463 bnez s1,c30 <.L220> + 7ec: 8522 mv a0,s0 + 7ee: 5462 lw s0,56(sp) + +000007f0 <.LVL249>: + 7f0: 4612 lw a2,4(sp) + 7f2: 4582 lw a1,0(sp) + 7f4: 50f2 lw ra,60(sp) + 7f6: 54d2 lw s1,52(sp) + 7f8: 6121 add sp,sp,64 + 7fa: 00000317 auipc t1,0x0 + 7fe: 00030067 jr t1 # 7fa <.LVL249+0xa> + +00000802 <.L166>: + 802: 00b7d693 srl a3,a5,0xb + +00000806 <.LVL251>: + 806: eead bnez a3,880 <.L169> + 808: 8b89 and a5,a5,2 + +0000080a <.LBB138>: + 80a: 4544 lw s1,12(a0) + +0000080c <.LBE138>: + 80c: ebb1 bnez a5,860 <.L170> + 80e: 85a6 mv a1,s1 + +00000810 <.LVL252>: + 810: 00000097 auipc ra,0x0 + 814: 000080e7 jalr ra # 810 <.LVL252> + +00000818 <.LVL253>: + 818: 57fd li a5,-1 + 81a: 86aa mv a3,a0 + +0000081c <.LVL254>: + 81c: 04f51463 bne a0,a5,864 <.L175> + +00000820 <.LBB141>: + 820: a819 j 836 <.L176> + +00000822 <.L174>: + 822: 8522 mv a0,s0 + 824: c036 sw a3,0(sp) + 826: 00000097 auipc ra,0x0 + 82a: 000080e7 jalr ra # 826 <.L174+0x4> + +0000082e <.LVL256>: + 82e: 57fd li a5,-1 + 830: 4682 lw a3,0(sp) + 832: 02f51563 bne a0,a5,85c <.L172> + +00000836 <.L176>: + 836: 7f800793 li a5,2040 + 83a: c81c sw a5,16(s0) + 83c: 000007b7 lui a5,0x0 + 840: 00078793 mv a5,a5 + 844: c45c sw a5,12(s0) + +00000846 <.L202>: + 846: 401c lw a5,0(s0) + 848: 4712 lw a4,4(sp) + 84a: f8f777e3 bgeu a4,a5,7d8 <.L203> + +0000084e <.L210>: + 84e: 4481 li s1,0 + +00000850 <.L165>: + 850: 50f2 lw ra,60(sp) + 852: 5462 lw s0,56(sp) + 854: 8526 mv a0,s1 + 856: 54d2 lw s1,52(sp) + 858: 6121 add sp,sp,64 + 85a: 8082 ret + +0000085c <.L172>: + 85c: 96aa add a3,a3,a0 + +0000085e <.LBE140>: + 85e: 0491 add s1,s1,4 + +00000860 <.L170>: + 860: 408c lw a1,0(s1) + 862: f1e1 bnez a1,822 <.L174> + +00000864 <.L175>: + 864: 481c lw a5,16(s0) + 866: 00b69713 sll a4,a3,0xb + 86a: 7ff7f793 and a5,a5,2047 + 86e: 8fd9 or a5,a5,a4 + 870: c81c sw a5,16(s0) + +00000872 <.LVL264>: + 872: 00200737 lui a4,0x200 + 876: 06e6e463 bltu a3,a4,8de <.L177> + 87a: 7ff7f793 and a5,a5,2047 + 87e: c81c sw a5,16(s0) + +00000880 <.L169>: + 880: 00268493 add s1,a3,2 + 884: 00249793 sll a5,s1,0x2 + 888: 853e mv a0,a5 + 88a: c636 sw a3,12(sp) + 88c: c03e sw a5,0(sp) + +0000088e <.LVL266>: + 88e: 00000097 auipc ra,0x0 + 892: 000080e7 jalr ra # 88e <.LVL266> + +00000896 <.LVL267>: + 896: d62a sw a0,44(sp) + 898: 84aa mv s1,a0 + 89a: d555 beqz a0,846 <.L202> + 89c: 00052223 sw zero,4(a0) + 8a0: 4502 lw a0,0(sp) + 8a2: 00000097 auipc ra,0x0 + 8a6: 000080e7 jalr ra # 8a2 <.LVL267+0xc> + +000008aa <.LVL268>: + 8aa: d82a sw a0,48(sp) + 8ac: 46b2 lw a3,12(sp) + 8ae: 872a mv a4,a0 + 8b0: c119 beqz a0,8b6 <.L180> + 8b2: 00052223 sw zero,4(a0) + +000008b6 <.L180>: + 8b6: 481c lw a5,16(s0) + +000008b8 <.LBB148>: + 8b8: 00c42303 lw t1,12(s0) + +000008bc <.LBE148>: + 8bc: 0027f613 and a2,a5,2 + 8c0: e221 bnez a2,900 <.L181> + 8c2: 861a mv a2,t1 + 8c4: 106c add a1,sp,44 + 8c6: 8522 mv a0,s0 + 8c8: c83a sw a4,16(sp) + 8ca: c63e sw a5,12(sp) + 8cc: c036 sw a3,0(sp) + 8ce: 00000097 auipc ra,0x0 + 8d2: 000080e7 jalr ra # 8ce <.LBE148+0x12> + +000008d6 <.LVL270>: + 8d6: 4742 lw a4,16(sp) + 8d8: 47b2 lw a5,12(sp) + 8da: 4682 lw a3,0(sp) + 8dc: a02d j 906 <.L184> + +000008de <.L177>: + 8de: d6a5 beqz a3,846 <.L202> + 8e0: b745 j 880 <.L169> + +000008e2 <.L183>: + 8e2: 106c add a1,sp,44 + 8e4: 8522 mv a0,s0 + 8e6: ca3a sw a4,20(sp) + 8e8: c81a sw t1,16(sp) + 8ea: c63e sw a5,12(sp) + 8ec: c036 sw a3,0(sp) + 8ee: 00000097 auipc ra,0x0 + 8f2: 000080e7 jalr ra # 8ee <.L183+0xc> + +000008f6 <.LVL273>: + 8f6: 4342 lw t1,16(sp) + 8f8: 4752 lw a4,20(sp) + 8fa: 47b2 lw a5,12(sp) + 8fc: 4682 lw a3,0(sp) + 8fe: 0311 add t1,t1,4 + +00000900 <.L181>: + 900: 00032603 lw a2,0(t1) + 904: fe79 bnez a2,8e2 <.L183> + +00000906 <.L184>: + 906: 40d0 lw a2,4(s1) + 908: 00d60663 beq a2,a3,914 <.L185> + +0000090c <.L195>: + 90c: 00000097 auipc ra,0x0 + 910: 000080e7 jalr ra # 90c <.L195> + +00000914 <.L185>: + 914: 0047f613 and a2,a5,4 + 918: e21d bnez a2,93e <.L223> + 91a: 7f87f793 and a5,a5,2040 + 91e: e78d bnez a5,948 <.L224> + 920: 00000637 lui a2,0x0 + 924: 00060793 mv a5,a2 + +00000928 <.L252>: + 928: c03e sw a5,0(sp) + +0000092a <.LVL278>: + 92a: 14071663 bnez a4,a76 <.L225> + 92e: 4582 lw a1,0(sp) + 930: 8626 mv a2,s1 + 932: 8522 mv a0,s0 + 934: 00000097 auipc ra,0x0 + 938: 000080e7 jalr ra # 934 <.LVL278+0xa> + +0000093c <.LVL279>: + 93c: a22d j a66 <.L201> + +0000093e <.L223>: + 93e: 00000637 lui a2,0x0 + 942: 00060793 mv a5,a2 + 946: b7cd j 928 <.L252> + +00000948 <.L224>: + 948: 00000637 lui a2,0x0 + 94c: 00060793 mv a5,a2 + 950: bfe1 j 928 <.L252> + +00000952 <.L190>: + 952: 47c2 lw a5,16(sp) + 954: 40f30633 sub a2,t1,a5 + 958: 963a add a2,a2,a4 + 95a: 00862303 lw t1,8(a2) # 8 <.L2+0x4> + +0000095e <.LVL282>: + 95e: 00062423 sw zero,8(a2) + +00000962 <.L187>: + 962: 47b2 lw a5,12(sp) + 964: 02f30663 beq t1,a5,990 <.L189> + 968: 005485b3 add a1,s1,t0 + 96c: 00032603 lw a2,0(t1) + 970: 418c lw a1,0(a1) + 972: 4782 lw a5,0(sp) + 974: d21e sw t2,36(sp) + 976: d03a sw a4,32(sp) + 978: ce36 sw a3,28(sp) + 97a: cc16 sw t0,24(sp) + 97c: ca1a sw t1,20(sp) + 97e: 8522 mv a0,s0 + 980: 9782 jalr a5 + +00000982 <.LVL284>: + 982: 4352 lw t1,20(sp) + 984: 42e2 lw t0,24(sp) + 986: 46f2 lw a3,28(sp) + 988: 5702 lw a4,32(sp) + 98a: 5392 lw t2,36(sp) + 98c: fc0543e3 bltz a0,952 <.L190> + +00000990 <.L189>: + 990: 00570633 add a2,a4,t0 + 994: 00662023 sw t1,0(a2) + +00000998 <.LBE155>: + 998: 0385 add t2,t2,1 + +0000099a <.LBB156>: + 99a: 00548333 add t1,s1,t0 + +0000099e <.LBE156>: + 99e: 0291 add t0,t0,4 + 9a0: fc7691e3 bne a3,t2,962 <.L187> + 9a4: 4601 li a2,0 + 9a6: 4501 li a0,0 + 9a8: 45a1 li a1,8 + +000009aa <.L194>: + 9aa: 00b48333 add t1,s1,a1 + 9ae: 00032283 lw t0,0(t1) + 9b2: 00b70333 add t1,a4,a1 + 9b6: 00032303 lw t1,0(t1) + 9ba: 0c030b63 beqz t1,a90 <.L192> + +000009be <.LVL288>: + 9be: 47a2 lw a5,8(sp) + 9c0: 00279313 sll t1,a5,0x2 + 9c4: 9326 add t1,t1,s1 + 9c6: 0785 add a5,a5,1 # 1 + +000009c8 <.LVL289>: + 9c8: 00532423 sw t0,8(t1) + 9cc: c43e sw a5,8(sp) + +000009ce <.L193>: + 9ce: 0505 add a0,a0,1 + 9d0: 0591 add a1,a1,4 + 9d2: fca69ce3 bne a3,a0,9aa <.L194> + 9d6: 47a2 lw a5,8(sp) + 9d8: c350 sw a2,4(a4) + 9da: c0dc sw a5,4(s1) + +000009dc <.LBE153>: + 9dc: 963e add a2,a2,a5 + 9de: f2c697e3 bne a3,a2,90c <.L195> + 9e2: 4582 lw a1,0(sp) + 9e4: 863a mv a2,a4 + 9e6: 8522 mv a0,s0 + 9e8: c43a sw a4,8(sp) + 9ea: 00000097 auipc ra,0x0 + 9ee: 000080e7 jalr ra # 9ea <.LBE153+0xe> + +000009f2 <.LBB161>: + 9f2: 4722 lw a4,8(sp) + 9f4: 00472303 lw t1,4(a4) # 200004 <.LLST178+0x1fe607> + +000009f8 <.LVL294>: + 9f8: 06030263 beqz t1,a5c <.L196> + 9fc: 0044a283 lw t0,4(s1) + +00000a00 <.L200>: + a00: 137d add t1,t1,-1 + a02: 00231593 sll a1,t1,0x2 + a06: 00b706b3 add a3,a4,a1 + a0a: 4690 lw a2,8(a3) + +00000a0c <.LVL297>: + a0c: 00128693 add a3,t0,1 + a10: 068a sll a3,a3,0x2 + a12: 00458793 add a5,a1,4 + a16: 96a6 add a3,a3,s1 + a18: c43e sw a5,8(sp) + +00000a1a <.L197>: + a1a: 02028663 beqz t0,a46 <.L198> + a1e: 428c lw a1,0(a3) + a20: 4782 lw a5,0(sp) + a22: fff28393 add t2,t0,-1 + a26: d01a sw t1,32(sp) + a28: ce3a sw a4,28(sp) + a2a: cc16 sw t0,24(sp) + a2c: ca1e sw t2,20(sp) + a2e: c832 sw a2,16(sp) + a30: c636 sw a3,12(sp) + a32: 8522 mv a0,s0 + a34: 9782 jalr a5 + +00000a36 <.LVL299>: + a36: 46b2 lw a3,12(sp) + a38: 4642 lw a2,16(sp) + a3a: 43d2 lw t2,20(sp) + a3c: 42e2 lw t0,24(sp) + a3e: 4772 lw a4,28(sp) + a40: 5302 lw t1,32(sp) + a42: 04a04e63 bgtz a0,a9e <.L199> + +00000a46 <.L198>: + a46: 005306b3 add a3,t1,t0 + a4a: 068a sll a3,a3,0x2 + a4c: 96a6 add a3,a3,s1 + a4e: c690 sw a2,8(a3) + a50: fa0318e3 bnez t1,a00 <.L200> + a54: 40d4 lw a3,4(s1) + a56: 4350 lw a2,4(a4) + a58: 96b2 add a3,a3,a2 + a5a: c0d4 sw a3,4(s1) + +00000a5c <.L196>: + a5c: 853a mv a0,a4 + a5e: 00000097 auipc ra,0x0 + a62: 000080e7 jalr ra # a5e <.L196+0x2> + +00000a66 <.L201>: + a66: 4458 lw a4,12(s0) + a68: c444 sw s1,12(s0) + a6a: c098 sw a4,0(s1) + a6c: 481c lw a5,16(s0) + a6e: 0017e793 or a5,a5,1 + a72: c81c sw a5,16(s0) + a74: bbc9 j 846 <.L202> + +00000a76 <.L225>: + a76: 00000637 lui a2,0x0 + a7a: 00060793 mv a5,a2 + +00000a7e <.LVL304>: + a7e: c63e sw a5,12(sp) + +00000a80 <.LBB157>: + a80: 00848793 add a5,s1,8 + +00000a84 <.LBE157>: + a84: 4381 li t2,0 + +00000a86 <.LBE164>: + a86: 42a1 li t0,8 + +00000a88 <.LBB165>: + a88: 00060313 mv t1,a2 + +00000a8c <.LBB158>: + a8c: c83e sw a5,16(sp) + a8e: bdd1 j 962 <.L187> + +00000a90 <.L192>: + a90: 00261313 sll t1,a2,0x2 + a94: 933a add t1,t1,a4 + a96: 00532423 sw t0,8(t1) + a9a: 0605 add a2,a2,1 # 1 + +00000a9c <.LVL306>: + a9c: bf0d j 9ce <.L193> + +00000a9e <.L199>: + a9e: 47a2 lw a5,8(sp) + aa0: 4288 lw a0,0(a3) + aa2: 829e mv t0,t2 + aa4: 00f685b3 add a1,a3,a5 + aa8: c188 sw a0,0(a1) + +00000aaa <.LVL308>: + aaa: 16f1 add a3,a3,-4 + aac: b7bd j a1a <.L197> + +00000aae <.L167>: + aae: 0044f313 and t1,s1,4 + ab2: 08030563 beqz t1,b3c <.L205> + +00000ab6 <.LBB171>: + ab6: 4782 lw a5,0(sp) + ab8: 4381 li t2,0 + aba: 0047a283 lw t0,4(a5) + +00000abe <.L206>: + abe: d853f8e3 bgeu t2,t0,84e <.L210> + +00000ac2 <.LBB132>: + ac2: 00538333 add t1,t2,t0 + ac6: 4702 lw a4,0(sp) + ac8: 00135313 srl t1,t1,0x1 + +00000acc <.LVL312>: + acc: 00231793 sll a5,t1,0x2 + ad0: 97ba add a5,a5,a4 + ad2: 4784 lw s1,8(a5) + +00000ad4 <.LVL313>: + ad4: c81e sw t2,16(sp) + ad6: c61a sw t1,12(sp) + ad8: 8526 mv a0,s1 + ada: ca16 sw t0,20(sp) + adc: 00000097 auipc ra,0x0 + ae0: 000080e7 jalr ra # adc <.LVL313+0x8> + +00000ae4 <.LVL314>: + ae4: 0ff57793 zext.b a5,a0 + ae8: 853e mv a0,a5 + +00000aea <.LVL315>: + aea: 85a2 mv a1,s0 + aec: c43e sw a5,8(sp) + aee: 00000097 auipc ra,0x0 + af2: 000080e7 jalr ra # aee <.LVL315+0x4> + +00000af6 <.LVL316>: + af6: 85aa mv a1,a0 + af8: 4522 lw a0,8(sp) + afa: 1034 add a3,sp,40 + afc: 00848613 add a2,s1,8 + b00: 00000097 auipc ra,0x0 + b04: 000080e7 jalr ra # b00 <.LVL316+0xa> + +00000b08 <.LVL317>: + b08: 47a2 lw a5,8(sp) + b0a: 862a mv a2,a0 + +00000b0c <.LVL318>: + b0c: 1074 add a3,sp,44 + b0e: 00f7f513 and a0,a5,15 + +00000b12 <.LVL319>: + b12: 4581 li a1,0 + b14: 00000097 auipc ra,0x0 + b18: 000080e7 jalr ra # b14 <.LVL319+0x2> + +00000b1c <.LVL320>: + b1c: 56a2 lw a3,40(sp) + b1e: 4792 lw a5,4(sp) + b20: 4332 lw t1,12(sp) + b22: 43c2 lw t2,16(sp) + b24: 00d7ea63 bltu a5,a3,b38 <.L207> + b28: 5632 lw a2,44(sp) + b2a: 96b2 add a3,a3,a2 + b2c: d2d7e2e3 bltu a5,a3,850 <.L165> + b30: 42d2 lw t0,20(sp) + b32: 00130393 add t2,t1,1 + +00000b36 <.LVL321>: + b36: 8316 mv t1,t0 + +00000b38 <.L207>: + b38: 829a mv t0,t1 + b3a: b751 j abe <.L206> + +00000b3c <.L205>: + b3c: 7f84f693 and a3,s1,2040 + b40: eeb1 bnez a3,b9c <.L211> + +00000b42 <.LBB172>: + b42: 4782 lw a5,0(sp) + b44: 43d8 lw a4,4(a5) + +00000b46 <.L212>: + b46: d0e6f4e3 bgeu a3,a4,84e <.L210> + +00000b4a <.LBB174>: + b4a: 00e68433 add s0,a3,a4 + b4e: c63a sw a4,12(sp) + b50: 4702 lw a4,0(sp) + +00000b52 <.LVL326>: + b52: 8005 srl s0,s0,0x1 + +00000b54 <.LVL327>: + b54: 00241793 sll a5,s0,0x2 + b58: 97ba add a5,a5,a4 + b5a: 4784 lw s1,8(a5) + +00000b5c <.LVL328>: + b5c: 4611 li a2,4 + b5e: 1028 add a0,sp,40 + b60: 00848593 add a1,s1,8 + b64: c436 sw a3,8(sp) + b66: 00000097 auipc ra,0x0 + b6a: 000080e7 jalr ra # b66 <.LVL328+0xa> + +00000b6e <.LVL329>: + b6e: 4611 li a2,4 + b70: 00c48593 add a1,s1,12 + b74: 1068 add a0,sp,44 + b76: 00000097 auipc ra,0x0 + b7a: 000080e7 jalr ra # b76 <.LVL329+0x8> + +00000b7e <.LVL330>: + b7e: 5622 lw a2,40(sp) + b80: 4792 lw a5,4(sp) + b82: 46a2 lw a3,8(sp) + b84: 00c7ea63 bltu a5,a2,b98 <.L213> + b88: 56b2 lw a3,44(sp) + b8a: 9636 add a2,a2,a3 + b8c: ccc7e2e3 bltu a5,a2,850 <.L165> + b90: 4732 lw a4,12(sp) + b92: 00140693 add a3,s0,1 + +00000b96 <.LVL331>: + b96: 843a mv s0,a4 + +00000b98 <.L213>: + b98: 8722 mv a4,s0 + b9a: b775 j b46 <.L212> + +00000b9c <.L211>: + b9c: 808d srl s1,s1,0x3 + b9e: 0ff4f793 zext.b a5,s1 + ba2: 85a2 mv a1,s0 + ba4: 853e mv a0,a5 + ba6: c81a sw t1,16(sp) + +00000ba8 <.LBB179>: + ba8: c43e sw a5,8(sp) + +00000baa <.LVL335>: + baa: 00000097 auipc ra,0x0 + bae: 000080e7 jalr ra # baa <.LVL335> + +00000bb2 <.LVL336>: + bb2: 4782 lw a5,0(sp) + bb4: 4342 lw t1,16(sp) + bb6: c62a sw a0,12(sp) + +00000bb8 <.LVL337>: + bb8: 43c0 lw s0,4(a5) + +00000bba <.L216>: + bba: c8837ae3 bgeu t1,s0,84e <.L210> + +00000bbe <.LBB177>: + bbe: 008302b3 add t0,t1,s0 + bc2: 4702 lw a4,0(sp) + bc4: 0012d293 srl t0,t0,0x1 + +00000bc8 <.LVL339>: + bc8: 00229793 sll a5,t0,0x2 + bcc: 97ba add a5,a5,a4 + bce: 4784 lw s1,8(a5) + +00000bd0 <.LVL340>: + bd0: 45b2 lw a1,12(sp) + bd2: 4522 lw a0,8(sp) + bd4: 1034 add a3,sp,40 + bd6: 00848613 add a2,s1,8 + bda: ca1a sw t1,20(sp) + bdc: c816 sw t0,16(sp) + bde: 00000097 auipc ra,0x0 + be2: 000080e7 jalr ra # bde <.LVL340+0xe> + +00000be6 <.LVL341>: + be6: 47a2 lw a5,8(sp) + be8: 862a mv a2,a0 + +00000bea <.LVL342>: + bea: 1074 add a3,sp,44 + bec: 00f7f513 and a0,a5,15 + +00000bf0 <.LVL343>: + bf0: 4581 li a1,0 + bf2: 00000097 auipc ra,0x0 + bf6: 000080e7 jalr ra # bf2 <.LVL343+0x2> + +00000bfa <.LVL344>: + bfa: 56a2 lw a3,40(sp) + bfc: 4792 lw a5,4(sp) + bfe: 42c2 lw t0,16(sp) + c00: 4352 lw t1,20(sp) + c02: 00d7e963 bltu a5,a3,c14 <.L217> + c06: 5632 lw a2,44(sp) + c08: 96b2 add a3,a3,a2 + c0a: c4d7e3e3 bltu a5,a3,850 <.L165> + c0e: 00128313 add t1,t0,1 + +00000c12 <.LVL345>: + c12: 82a2 mv t0,s0 + +00000c14 <.L217>: + c14: 8416 mv s0,t0 + c16: b755 j bba <.L216> + +00000c18 <.L222>: + c18: 4612 lw a2,4(sp) + c1a: 8522 mv a0,s0 + c1c: 00000097 auipc ra,0x0 + c20: 000080e7 jalr ra # c1c <.L222+0x4> + +00000c24 <.LVL348>: + c24: 84aa mv s1,a0 + +00000c26 <.LVL349>: + c26: c20515e3 bnez a0,850 <.L165> + +00000c2a <.LBE181>: + c2a: 4782 lw a5,0(sp) + c2c: 0791 add a5,a5,4 + c2e: c03e sw a5,0(sp) + +00000c30 <.L220>: + c30: 4782 lw a5,0(sp) + c32: 438c lw a1,0(a5) + c34: f1f5 bnez a1,c18 <.L222> + c36: b921 j 84e <.L210> + +00000c38 <__register_frame_info_bases>: + c38: c115 beqz a0,c5c <.L253> + c3a: 411c lw a5,0(a0) + c3c: c385 beqz a5,c5c <.L253> + +00000c3e <.LBB184>: + c3e: 57fd li a5,-1 + c40: c19c sw a5,0(a1) + c42: 7f800793 li a5,2040 + c46: c99c sw a5,16(a1) + c48: 000007b7 lui a5,0x0 + c4c: 0007a703 lw a4,0(a5) # 0 + c50: c1d0 sw a2,4(a1) + c52: c594 sw a3,8(a1) + c54: c5c8 sw a0,12(a1) + c56: c9d8 sw a4,20(a1) + c58: 00b7a023 sw a1,0(a5) + +00000c5c <.L253>: + c5c: 8082 ret + +00000c5e <__register_frame_info>: + c5e: 4681 li a3,0 + c60: 4601 li a2,0 + c62: 00000317 auipc t1,0x0 + c66: 00030067 jr t1 # c62 <__register_frame_info+0x4> + +00000c6a <__register_frame>: + c6a: 411c lw a5,0(a0) + c6c: c39d beqz a5,c92 <.L262> + c6e: 1151 add sp,sp,-12 + c70: c222 sw s0,4(sp) + c72: 842a mv s0,a0 + c74: 4561 li a0,24 + +00000c76 <.LVL357>: + c76: c406 sw ra,8(sp) + c78: 00000097 auipc ra,0x0 + c7c: 000080e7 jalr ra # c78 <.LVL357+0x2> + +00000c80 <.LVL358>: + c80: 85aa mv a1,a0 + +00000c82 <.LVL359>: + c82: 8522 mv a0,s0 + +00000c84 <.LVL360>: + c84: 4412 lw s0,4(sp) + +00000c86 <.LVL361>: + c86: 40a2 lw ra,8(sp) + c88: 0131 add sp,sp,12 + c8a: 00000317 auipc t1,0x0 + c8e: 00030067 jr t1 # c8a <.LVL361+0x4> + +00000c92 <.L262>: + c92: 8082 ret + +00000c94 <__register_frame_info_table_bases>: + c94: 57fd li a5,-1 + c96: c19c sw a5,0(a1) + c98: 7fa00793 li a5,2042 + c9c: c99c sw a5,16(a1) + c9e: 000007b7 lui a5,0x0 + ca2: 0007a703 lw a4,0(a5) # 0 + ca6: c1d0 sw a2,4(a1) + ca8: c594 sw a3,8(a1) + caa: c5c8 sw a0,12(a1) + cac: c9d8 sw a4,20(a1) + cae: 00b7a023 sw a1,0(a5) + cb2: 8082 ret + +00000cb4 <__register_frame_info_table>: + cb4: 4681 li a3,0 + cb6: 4601 li a2,0 + cb8: 00000317 auipc t1,0x0 + cbc: 00030067 jr t1 # cb8 <__register_frame_info_table+0x4> + +00000cc0 <__register_frame_table>: + cc0: 1151 add sp,sp,-12 + cc2: c222 sw s0,4(sp) + cc4: 842a mv s0,a0 + cc6: 4561 li a0,24 + +00000cc8 <.LVL367>: + cc8: c406 sw ra,8(sp) + cca: 00000097 auipc ra,0x0 + cce: 000080e7 jalr ra # cca <.LVL367+0x2> + +00000cd2 <.LVL368>: + cd2: 85aa mv a1,a0 + +00000cd4 <.LVL369>: + cd4: 8522 mv a0,s0 + +00000cd6 <.LVL370>: + cd6: 4412 lw s0,4(sp) + +00000cd8 <.LVL371>: + cd8: 40a2 lw ra,8(sp) + cda: 0131 add sp,sp,12 + cdc: 00000317 auipc t1,0x0 + ce0: 00030067 jr t1 # cdc <.LVL371+0x4> + +00000ce4 <__deregister_frame_info_bases>: + ce4: 1151 add sp,sp,-12 + ce6: c406 sw ra,8(sp) + ce8: c222 sw s0,4(sp) + cea: c93d beqz a0,d60 <.L282> + cec: 4118 lw a4,0(a0) + cee: 87aa mv a5,a0 + cf0: cb25 beqz a4,d60 <.L282> + cf2: 00000737 lui a4,0x0 + cf6: 00072403 lw s0,0(a4) # 0 + cfa: 00070713 mv a4,a4 + +00000cfe <.L273>: + cfe: ec01 bnez s0,d16 <.L275> + +00000d00 <.LBB188>: + d00: 00000737 lui a4,0x0 + +00000d04 <.LVL375>: + d04: 00072403 lw s0,0(a4) # 0 + d08: 00070713 mv a4,a4 + +00000d0c <.L276>: + d0c: e01d bnez s0,d32 <.L279> + +00000d0e <.L280>: + d0e: 00000097 auipc ra,0x0 + d12: 000080e7 jalr ra # d0e <.L280> + +00000d16 <.L275>: + d16: 4450 lw a2,12(s0) + d18: 4854 lw a3,20(s0) + d1a: 00f61863 bne a2,a5,d2a <.L274> + +00000d1e <.LVL379>: + d1e: c314 sw a3,0(a4) + +00000d20 <.L271>: + d20: 40a2 lw ra,8(sp) + d22: 8522 mv a0,s0 + d24: 4412 lw s0,4(sp) + d26: 0131 add sp,sp,12 + d28: 8082 ret + +00000d2a <.L274>: + d2a: 01440713 add a4,s0,20 + d2e: 8436 mv s0,a3 + d30: b7f9 j cfe <.L273> + +00000d32 <.L279>: + d32: 4814 lw a3,16(s0) + d34: 4448 lw a0,12(s0) + d36: 8a85 and a3,a3,1 + d38: ca99 beqz a3,d4e <.L277> + d3a: 4114 lw a3,0(a0) + d3c: 00d79e63 bne a5,a3,d58 <.L278> + +00000d40 <.LVL384>: + d40: 485c lw a5,20(s0) + +00000d42 <.LVL385>: + d42: c31c sw a5,0(a4) + +00000d44 <.LVL386>: + d44: 00000097 auipc ra,0x0 + d48: 000080e7 jalr ra # d44 <.LVL386> + +00000d4c <.LVL387>: + d4c: bfd1 j d20 <.L271> + +00000d4e <.L277>: + d4e: 00f51563 bne a0,a5,d58 <.L278> + +00000d52 <.LVL389>: + d52: 485c lw a5,20(s0) + +00000d54 <.LVL390>: + d54: c31c sw a5,0(a4) + +00000d56 <.LVL391>: + d56: b7e9 j d20 <.L271> + +00000d58 <.L278>: + d58: 01440713 add a4,s0,20 + d5c: 4840 lw s0,20(s0) + d5e: b77d j d0c <.L276> + +00000d60 <.L282>: + d60: 4401 li s0,0 + d62: bf7d j d20 <.L271> + +00000d64 <__deregister_frame_info>: + d64: 00000317 auipc t1,0x0 + d68: 00030067 jr t1 # d64 <__deregister_frame_info> + +00000d6c <__deregister_frame>: + d6c: 411c lw a5,0(a0) + d6e: cf89 beqz a5,d88 <.L285> + +00000d70 <.LBB192>: + d70: 1151 add sp,sp,-12 + d72: c406 sw ra,8(sp) + +00000d74 <.LBB195>: + d74: 00000097 auipc ra,0x0 + d78: 000080e7 jalr ra # d74 <.LBB195> + +00000d7c <.LBE195>: + d7c: 40a2 lw ra,8(sp) + d7e: 0131 add sp,sp,12 + d80: 00000317 auipc t1,0x0 + d84: 00030067 jr t1 # d80 <.LBE195+0x4> + +00000d88 <.L285>: + d88: 8082 ret + +00000d8a <_Unwind_Find_FDE>: + d8a: 1121 add sp,sp,-24 + d8c: 00000637 lui a2,0x0 + d90: c822 sw s0,16(sp) + d92: 00062403 lw s0,0(a2) # 0 + +00000d96 <.LVL402>: + d96: ca06 sw ra,20(sp) + d98: c626 sw s1,12(sp) + d9a: c02a sw a0,0(sp) + d9c: c22e sw a1,4(sp) + +00000d9e <.L291>: + d9e: cc09 beqz s0,db8 <.L294> + da0: 4018 lw a4,0(s0) + da2: 4782 lw a5,0(sp) + da4: 02e7e563 bltu a5,a4,dce <.L292> + da8: 85be mv a1,a5 + +00000daa <.LVL403>: + daa: 8522 mv a0,s0 + +00000dac <.LVL404>: + dac: 00000097 auipc ra,0x0 + db0: 000080e7 jalr ra # dac <.LVL404> + +00000db4 <.LVL405>: + db4: 84aa mv s1,a0 + +00000db6 <.LVL406>: + db6: e521 bnez a0,dfe <.L293> + +00000db8 <.L294>: + db8: 00000337 lui t1,0x0 + +00000dbc <.L299>: + dbc: 00032403 lw s0,0(t1) # 0 + dc0: e809 bnez s0,dd2 <.L300> + +00000dc2 <.L290>: + dc2: 40d2 lw ra,20(sp) + dc4: 8522 mv a0,s0 + dc6: 4442 lw s0,16(sp) + dc8: 44b2 lw s1,12(sp) + dca: 0161 add sp,sp,24 + +00000dcc <.LVL411>: + dcc: 8082 ret + +00000dce <.L292>: + dce: 4840 lw s0,20(s0) + dd0: b7f9 j d9e <.L291> + +00000dd2 <.L300>: + dd2: 4858 lw a4,20(s0) + dd4: 4582 lw a1,0(sp) + dd6: 8522 mv a0,s0 + dd8: 00e32023 sw a4,0(t1) + ddc: 00000097 auipc ra,0x0 + de0: 000080e7 jalr ra # ddc <.L300+0xa> + +00000de4 <.LVL415>: + de4: 00000637 lui a2,0x0 + de8: 00062683 lw a3,0(a2) # 0 + dec: 84aa mv s1,a0 + +00000dee <.LVL416>: + dee: 00060593 mv a1,a2 + df2: 00000337 lui t1,0x0 + +00000df6 <.L296>: + df6: eea1 bnez a3,e4e <.L298> + +00000df8 <.L297>: + df8: c854 sw a3,20(s0) + dfa: c180 sw s0,0(a1) + dfc: d0e1 beqz s1,dbc <.L299> + +00000dfe <.L293>: + dfe: 4054 lw a3,4(s0) + e00: 4792 lw a5,4(sp) + e02: c394 sw a3,0(a5) + e04: 4414 lw a3,8(s0) + e06: c3d4 sw a3,4(a5) + e08: 4814 lw a3,16(s0) + e0a: 0036d513 srl a0,a3,0x3 + e0e: 8a91 and a3,a3,4 + e10: 0ff57513 zext.b a0,a0 + +00000e14 <.LVL419>: + e14: c691 beqz a3,e20 <.L303> + e16: 8526 mv a0,s1 + +00000e18 <.LVL420>: + e18: 00000097 auipc ra,0x0 + e1c: 000080e7 jalr ra # e18 <.LVL420> + +00000e20 <.L303>: + e20: 0ff57793 zext.b a5,a0 + e24: 85a2 mv a1,s0 + e26: 853e mv a0,a5 + +00000e28 <.LVL422>: + e28: c03e sw a5,0(sp) + +00000e2a <.LVL423>: + e2a: 00000097 auipc ra,0x0 + e2e: 000080e7 jalr ra # e2a <.LVL423> + +00000e32 <.LVL424>: + e32: 85aa mv a1,a0 + e34: 4502 lw a0,0(sp) + e36: 0034 add a3,sp,8 + e38: 00848613 add a2,s1,8 + e3c: 00000097 auipc ra,0x0 + e40: 000080e7 jalr ra # e3c <.LVL424+0xa> + +00000e44 <.LVL425>: + e44: 47a2 lw a5,8(sp) + e46: 4712 lw a4,4(sp) + e48: 8426 mv s0,s1 + +00000e4a <.LBB198>: + e4a: c71c sw a5,8(a4) + +00000e4c <.LBE198>: + e4c: bf9d j dc2 <.L290> + +00000e4e <.L298>: + e4e: 0006a283 lw t0,0(a3) + e52: 4008 lw a0,0(s0) + e54: faa2e2e3 bltu t0,a0,df8 <.L297> + e58: 01468593 add a1,a3,20 + e5c: 4ad4 lw a3,20(a3) + e5e: bf61 j df6 <.L296> + +unwind-sjlj.o: file format elf32-littleriscv + + +unwind-c.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 : + 0: 4701 li a4,0 + 2: 4681 li a3,0 + +00000004 <.L2>: + 4: 00054783 lbu a5,0(a0) + 8: 0505 add a0,a0,1 + +0000000a <.LVL2>: + a: 07f7f613 and a2,a5,127 + e: 07e2 sll a5,a5,0x18 + +00000010 <.LVL3>: + 10: 00d61633 sll a2,a2,a3 + 14: 87e1 sra a5,a5,0x18 + 16: 8f51 or a4,a4,a2 + 18: 069d add a3,a3,7 + 1a: fe07c5e3 bltz a5,4 <.L2> + 1e: c198 sw a4,0(a1) + +00000020 <.LVL6>: + 20: 8082 ret + +00000022 : + 22: 1111 add sp,sp,-28 + +00000024 <.LBB11>: + 24: cc06 sw ra,24(sp) + 26: ca22 sw s0,20(sp) + 28: c826 sw s1,16(sp) + 2a: c02e sw a1,0(sp) + +0000002c <.LVL9>: + 2c: c236 sw a3,4(sp) + +0000002e <.LBB15>: + 2e: 0ff00793 li a5,255 + 32: 02f58263 beq a1,a5,56 <.L5> + 36: 0705f413 and s0,a1,112 + 3a: 03000793 li a5,48 + 3e: 84b2 mv s1,a2 + 40: 04f40f63 beq s0,a5,9e <.L6> + 44: 0087ed63 bltu a5,s0,5e <.L7> + 48: 02000793 li a5,32 + 4c: 04f40363 beq s0,a5,92 <.L8> + 50: 4701 li a4,0 + 52: 0087ff63 bgeu a5,s0,70 <.L9> + +00000056 <.L5>: + 56: 00000097 auipc ra,0x0 + 5a: 000080e7 jalr ra # 56 <.L5> + +0000005e <.L7>: + 5e: 04000793 li a5,64 + 62: 04f40363 beq s0,a5,a8 <.L10> + 66: 05000793 li a5,80 + 6a: 4701 li a4,0 + 6c: fef415e3 bne s0,a5,56 <.L5> + +00000070 <.L9>: + 70: 4682 lw a3,0(sp) + 72: 05000793 li a5,80 + 76: 02f69e63 bne a3,a5,b2 <.L11> + +0000007a <.LBB18>: + 7a: 00348513 add a0,s1,3 + 7e: 9971 and a0,a0,-4 + +00000080 <.LVL14>: + 80: 411c lw a5,0(a0) + +00000082 <.LVL15>: + 82: 0511 add a0,a0,4 + +00000084 <.L12>: + 84: 4712 lw a4,4(sp) + +00000086 <.LBE16>: + 86: 40e2 lw ra,24(sp) + 88: 4452 lw s0,20(sp) + +0000008a <.LBB25>: + 8a: c31c sw a5,0(a4) + +0000008c <.LBE25>: + 8c: 44c2 lw s1,16(sp) + +0000008e <.LVL18>: + 8e: 0171 add sp,sp,28 + +00000090 <.LVL19>: + 90: 8082 ret + +00000092 <.L8>: + 92: 00000097 auipc ra,0x0 + 96: 000080e7 jalr ra # 92 <.L8> + +0000009a <.L36>: + 9a: 872a mv a4,a0 + 9c: bfd1 j 70 <.L9> + +0000009e <.L6>: + 9e: 00000097 auipc ra,0x0 + a2: 000080e7 jalr ra # 9e <.L6> + +000000a6 <.LVL23>: + a6: bfd5 j 9a <.L36> + +000000a8 <.L10>: + a8: 00000097 auipc ra,0x0 + ac: 000080e7 jalr ra # a8 <.L10> + +000000b0 <.LVL25>: + b0: b7ed j 9a <.L36> + +000000b2 <.L11>: + b2: 4782 lw a5,0(sp) + b4: 45b1 li a1,12 + b6: 8bbd and a5,a5,15 + b8: f8f5efe3 bltu a1,a5,56 <.L5> + bc: 000005b7 lui a1,0x0 + c0: 078a sll a5,a5,0x2 + c2: 00058593 mv a1,a1 + c6: 97ae add a5,a5,a1 + c8: 439c lw a5,0(a5) + ca: 8782 jr a5 + +000000cc <.L21>: + cc: 006c add a1,sp,12 + ce: 8526 mv a0,s1 + d0: c43a sw a4,8(sp) + d2: 00000097 auipc ra,0x0 + d6: 000080e7 jalr ra # d2 <.L21+0x6> + +000000da <.LVL27>: + da: 47b2 lw a5,12(sp) + +000000dc <.LBE19>: + dc: 4722 lw a4,8(sp) + +000000de <.L23>: + de: d3dd beqz a5,84 <.L12> + e0: a83d j 11e <.L24> + +000000e2 <.L27>: + e2: 8526 mv a0,s1 + e4: 4781 li a5,0 + e6: 4581 li a1,0 + +000000e8 <.L17>: + e8: 00054303 lbu t1,0(a0) + ec: 0505 add a0,a0,1 + +000000ee <.LVL32>: + ee: 07f37293 and t0,t1,127 + f2: 00b292b3 sll t0,t0,a1 + f6: 0057e7b3 or a5,a5,t0 + fa: 01831293 sll t0,t1,0x18 + fe: 4182d293 sra t0,t0,0x18 + 102: 059d add a1,a1,7 # 7 <.L2+0x3> + 104: fe02c2e3 bltz t0,e8 <.L17> + 108: 42fd li t0,31 + 10a: fcb2eae3 bltu t0,a1,de <.L23> + 10e: 04037313 and t1,t1,64 + +00000112 <.LVL35>: + 112: fc0306e3 beqz t1,de <.L23> + 116: 537d li t1,-1 + 118: 00b315b3 sll a1,t1,a1 + +0000011c <.LVL36>: + 11c: 8fcd or a5,a5,a1 + +0000011e <.L24>: + 11e: 45c1 li a1,16 + 120: 00b41363 bne s0,a1,126 <.L25> + 124: 8726 mv a4,s1 + +00000126 <.L25>: + 126: 00010403 lb s0,0(sp) + 12a: 97ba add a5,a5,a4 + 12c: f4045ce3 bgez s0,84 <.L12> + 130: 439c lw a5,0(a5) + 132: bf89 j 84 <.L12> + +00000134 <.L20>: + 134: 0014c783 lbu a5,1(s1) + 138: 0004c583 lbu a1,0(s1) + 13c: 07a2 sll a5,a5,0x8 + 13e: 8fcd or a5,a5,a1 + +00000140 <.L37>: + 140: 00248513 add a0,s1,2 + +00000144 <.LVL42>: + 144: bf69 j de <.L23> + +00000146 <.L16>: + 146: 0014c783 lbu a5,1(s1) + 14a: 0004c583 lbu a1,0(s1) + 14e: 07a2 sll a5,a5,0x8 + 150: 8fcd or a5,a5,a1 + 152: 07c2 sll a5,a5,0x10 + 154: 87c1 sra a5,a5,0x10 + 156: b7ed j 140 <.L37> + +00000158 <.L15>: + 158: 0014c783 lbu a5,1(s1) + 15c: 0004c583 lbu a1,0(s1) + 160: 00448513 add a0,s1,4 + 164: 07a2 sll a5,a5,0x8 + 166: 8fcd or a5,a5,a1 + 168: 0024c583 lbu a1,2(s1) + 16c: 05c2 sll a1,a1,0x10 + 16e: 8ddd or a1,a1,a5 + 170: 0034c783 lbu a5,3(s1) + 174: 07e2 sll a5,a5,0x18 + 176: 8fcd or a5,a5,a1 + +00000178 <.LVL44>: + 178: b79d j de <.L23> + +0000017a <.L13>: + 17a: 0014c783 lbu a5,1(s1) + 17e: 0004c583 lbu a1,0(s1) + 182: 00848513 add a0,s1,8 + 186: 07a2 sll a5,a5,0x8 + 188: 8fcd or a5,a5,a1 + 18a: 0024c583 lbu a1,2(s1) + 18e: 05c2 sll a1,a1,0x10 + 190: 8ddd or a1,a1,a5 + 192: 0034c783 lbu a5,3(s1) + 196: 07e2 sll a5,a5,0x18 + 198: 8fcd or a5,a5,a1 + +0000019a <.LVL46>: + 19a: b791 j de <.L23> + +0000019c <__gcc_personality_v0>: + 19c: fbc10113 add sp,sp,-68 + 1a0: de22 sw s0,60(sp) + 1a2: c086 sw ra,64(sp) + 1a4: 843e mv s0,a5 + 1a6: dc26 sw s1,56(sp) + 1a8: c23a sw a4,4(sp) + 1aa: c602 sw zero,12(sp) + 1ac: 4785 li a5,1 + +000001ae <.LVL48>: + 1ae: 14f51263 bne a0,a5,2f2 <.L53> + 1b2: 8989 and a1,a1,2 + +000001b4 <.LVL49>: + 1b4: c9f5 beqz a1,2a8 <.L41> + 1b6: 8522 mv a0,s0 + +000001b8 <.LVL50>: + 1b8: 00000097 auipc ra,0x0 + 1bc: 000080e7 jalr ra # 1b8 <.LVL50> + +000001c0 <.LVL51>: + 1c0: 84aa mv s1,a0 + +000001c2 <.LVL52>: + 1c2: c17d beqz a0,2a8 <.L41> + +000001c4 <.LBB31>: + 1c4: 4501 li a0,0 + 1c6: c411 beqz s0,1d2 <.L43> + 1c8: 8522 mv a0,s0 + 1ca: 00000097 auipc ra,0x0 + 1ce: 000080e7 jalr ra # 1ca <.LBB31+0x6> + +000001d2 <.L43>: + 1d2: 0004c583 lbu a1,0(s1) + 1d6: d02a sw a0,32(sp) + 1d8: 0ff00793 li a5,255 + 1dc: 00148613 add a2,s1,1 + +000001e0 <.LVL55>: + 1e0: 0cf58b63 beq a1,a5,2b6 <.L44> + 1e4: 1054 add a3,sp,36 + 1e6: 8522 mv a0,s0 + 1e8: 00000097 auipc ra,0x0 + 1ec: 000080e7 jalr ra # 1e8 <.LVL55+0x8> + +000001f0 <.LVL56>: + 1f0: 862a mv a2,a0 + +000001f2 <.L45>: + 1f2: 00064703 lbu a4,0(a2) + 1f6: 0ff00693 li a3,255 + 1fa: 00160513 add a0,a2,1 + +000001fe <.LVL58>: + 1fe: 02e10a23 sb a4,52(sp) + 202: 4781 li a5,0 + 204: 00d70963 beq a4,a3,216 <.L46> + 208: 086c add a1,sp,28 + 20a: 00000097 auipc ra,0x0 + 20e: 000080e7 jalr ra # 20a <.LVL58+0xc> + +00000212 <.LVL59>: + 212: 47f2 lw a5,28(sp) + 214: 97aa add a5,a5,a0 + +00000216 <.L46>: + 216: d63e sw a5,44(sp) + +00000218 <.LVL60>: + 218: 00054783 lbu a5,0(a0) + 21c: 086c add a1,sp,28 + 21e: 0505 add a0,a0,1 + +00000220 <.LVL61>: + 220: c03e sw a5,0(sp) + 222: 02f10aa3 sb a5,53(sp) + 226: 00000097 auipc ra,0x0 + 22a: 000080e7 jalr ra # 226 <.LVL61+0x6> + +0000022e <.LVL62>: + 22e: 4372 lw t1,28(sp) + 230: c42a sw a0,8(sp) + +00000232 <.LBE31>: + 232: 006c add a1,sp,12 + +00000234 <.LBB36>: + 234: 006504b3 add s1,a0,t1 + +00000238 <.LBE36>: + 238: 8522 mv a0,s0 + +0000023a <.LBB37>: + 23a: d826 sw s1,48(sp) + +0000023c <.LBE37>: + 23c: 00000097 auipc ra,0x0 + 240: 000080e7 jalr ra # 23c <.LBE37> + +00000244 <.LVL66>: + 244: 4732 lw a4,12(sp) + 246: 4622 lw a2,8(sp) + 248: 87aa mv a5,a0 + +0000024a <.LVL67>: + 24a: e319 bnez a4,250 <.L48> + 24c: fff50793 add a5,a0,-1 + +00000250 <.L48>: + 250: 04967c63 bgeu a2,s1,2a8 <.L41> + +00000254 <.LBB38>: + 254: 4582 lw a1,0(sp) + 256: 0814 add a3,sp,16 + 258: 4501 li a0,0 + 25a: c43e sw a5,8(sp) + 25c: 00000097 auipc ra,0x0 + 260: 000080e7 jalr ra # 25c <.LBB38+0x8> + +00000264 <.LVL69>: + 264: 4582 lw a1,0(sp) + 266: 862a mv a2,a0 + +00000268 <.LVL70>: + 268: 0854 add a3,sp,20 + 26a: 4501 li a0,0 + +0000026c <.LVL71>: + 26c: 00000097 auipc ra,0x0 + 270: 000080e7 jalr ra # 26c <.LVL71> + +00000274 <.LVL72>: + 274: 4582 lw a1,0(sp) + 276: 862a mv a2,a0 + +00000278 <.LVL73>: + 278: 0834 add a3,sp,24 + 27a: 4501 li a0,0 + +0000027c <.LVL74>: + 27c: 00000097 auipc ra,0x0 + 280: 000080e7 jalr ra # 27c <.LVL74> + +00000284 <.LVL75>: + 284: 086c add a1,sp,28 + 286: 00000097 auipc ra,0x0 + 28a: 000080e7 jalr ra # 286 <.LVL75+0x2> + +0000028e <.LVL76>: + 28e: 5702 lw a4,32(sp) + 290: 46c2 lw a3,16(sp) + 292: 47a2 lw a5,8(sp) + 294: 862a mv a2,a0 + +00000296 <.LVL77>: + 296: 9736 add a4,a4,a3 + 298: 04e7eb63 bltu a5,a4,2ee <.L56> + 29c: 46d2 lw a3,20(sp) + 29e: 9736 add a4,a4,a3 + 2a0: fae7f8e3 bgeu a5,a4,250 <.L48> + 2a4: 47e2 lw a5,24(sp) + 2a6: eb91 bnez a5,2ba <.L50> + +000002a8 <.L41>: + 2a8: 4521 li a0,8 + +000002aa <.L38>: + 2aa: 4086 lw ra,64(sp) + 2ac: 5472 lw s0,60(sp) + +000002ae <.LVL79>: + 2ae: 54e2 lw s1,56(sp) + 2b0: 04410113 add sp,sp,68 + +000002b4 <.LVL80>: + 2b4: 8082 ret + +000002b6 <.L44>: + 2b6: d22a sw a0,36(sp) + 2b8: bf2d j 1f2 <.L45> + +000002ba <.L50>: + 2ba: 5712 lw a4,36(sp) + 2bc: 00e784b3 add s1,a5,a4 + +000002c0 <.LBE40>: + 2c0: d4e5 beqz s1,2a8 <.L41> + 2c2: 4612 lw a2,4(sp) + 2c4: 45a9 li a1,10 + 2c6: 8522 mv a0,s0 + +000002c8 <.LVL84>: + 2c8: 00000097 auipc ra,0x0 + 2cc: 000080e7 jalr ra # 2c8 <.LVL84> + +000002d0 <.LVL85>: + 2d0: 4601 li a2,0 + 2d2: 45ad li a1,11 + 2d4: 8522 mv a0,s0 + 2d6: 00000097 auipc ra,0x0 + 2da: 000080e7 jalr ra # 2d6 <.LVL85+0x6> + +000002de <.LVL86>: + 2de: 8522 mv a0,s0 + 2e0: 85a6 mv a1,s1 + 2e2: 00000097 auipc ra,0x0 + 2e6: 000080e7 jalr ra # 2e2 <.LVL86+0x4> + +000002ea <.LVL87>: + 2ea: 451d li a0,7 + 2ec: bf7d j 2aa <.L38> + +000002ee <.L56>: + 2ee: 8626 mv a2,s1 + +000002f0 <.LVL89>: + 2f0: b785 j 250 <.L48> + +000002f2 <.L53>: + 2f2: 450d li a0,3 + +000002f4 <.LVL91>: + 2f4: bf5d j 2aa <.L38> + +emutls.o: file format elf32-littleriscv + + +Disassembly of section .text: + +00000000 <__emutls_get_address>: + 0: 451c lw a5,8(a0) + 2: 1141 add sp,sp,-16 + 4: c422 sw s0,8(sp) + 6: c606 sw ra,12(sp) + 8: c226 sw s1,4(sp) + a: 842a mv s0,a0 + c: ef95 bnez a5,48 <.L2> + +0000000e <.LBB6>: + e: 4144 lw s1,4(a0) + 10: 4791 li a5,4 + 12: 4110 lw a2,0(a0) + 14: 0497e063 bltu a5,s1,54 <.L3> + 18: 00460513 add a0,a2,4 + +0000001c <.LVL2>: + 1c: c032 sw a2,0(sp) + 1e: 00000097 auipc ra,0x0 + 22: 000080e7 jalr ra # 1e <.LVL2+0x2> + +00000026 <.LVL3>: + 26: 4602 lw a2,0(sp) + 28: e509 bnez a0,32 <.L4> + +0000002a <.L6>: + 2a: 00000097 auipc ra,0x0 + 2e: 000080e7 jalr ra # 2a <.L6> + +00000032 <.L4>: + 32: c108 sw a0,0(a0) + 34: 00450793 add a5,a0,4 + +00000038 <.L5>: + 38: 444c lw a1,12(s0) + 3a: c1a1 beqz a1,7a <.L7> + 3c: 853e mv a0,a5 + +0000003e <.LVL6>: + 3e: 00000097 auipc ra,0x0 + 42: 000080e7 jalr ra # 3e <.LVL6> + +00000046 <.L13>: + 46: c408 sw a0,8(s0) + +00000048 <.L2>: + 48: 4408 lw a0,8(s0) + 4a: 40b2 lw ra,12(sp) + 4c: 4422 lw s0,8(sp) + +0000004e <.LVL8>: + 4e: 4492 lw s1,4(sp) + 50: 0141 add sp,sp,16 + 52: 8082 ret + +00000054 <.L3>: + 54: 00960533 add a0,a2,s1 + 58: 050d add a0,a0,3 + 5a: c032 sw a2,0(sp) + 5c: 00000097 auipc ra,0x0 + 60: 000080e7 jalr ra # 5c <.L3+0x8> + +00000064 <.LVL10>: + 64: d179 beqz a0,2a <.L6> + 66: 00348793 add a5,s1,3 + 6a: 97aa add a5,a5,a0 + 6c: 409004b3 neg s1,s1 + 70: 8fe5 and a5,a5,s1 + +00000072 <.LVL11>: + 72: 4602 lw a2,0(sp) + 74: fea7ae23 sw a0,-4(a5) + 78: b7c1 j 38 <.L5> + +0000007a <.L7>: + 7a: 4581 li a1,0 + 7c: 853e mv a0,a5 + +0000007e <.LVL12>: + 7e: 00000097 auipc ra,0x0 + 82: 000080e7 jalr ra # 7e <.LVL12> + +00000086 <.LVL13>: + 86: b7c1 j 46 <.L13> + +00000088 <__emutls_register_common>: + 88: 411c lw a5,0(a0) + 8a: 00b7f563 bgeu a5,a1,94 <.L15> + 8e: c10c sw a1,0(a0) + 90: 00052623 sw zero,12(a0) + +00000094 <.L15>: + 94: 415c lw a5,4(a0) + 96: 00c7f363 bgeu a5,a2,9c <.L16> + 9a: c150 sw a2,4(a0) + +0000009c <.L16>: + 9c: c689 beqz a3,a6 <.L14> + 9e: 411c lw a5,0(a0) + a0: 00b79363 bne a5,a1,a6 <.L14> + a4: c554 sw a3,12(a0) + +000000a6 <.L14>: + a6: 8082 ret diff --git a/src/misc/factory_bootloader.bin b/src/misc/factory_bootloader.bin new file mode 100644 index 0000000..8522877 Binary files /dev/null and b/src/misc/factory_bootloader.bin differ diff --git a/src/misc/libgcc.a b/src/misc/libgcc.a new file mode 100644 index 0000000..117e412 Binary files /dev/null and b/src/misc/libgcc.a differ diff --git a/src/misc/tests/Makefile b/src/misc/tests/Makefile new file mode 100644 index 0000000..fa10eda --- /dev/null +++ b/src/misc/tests/Makefile @@ -0,0 +1,23 @@ +all : ci + +EXAMPLES := $(wildcard ../../examples/*/.) $(wildcard ../../examples_v10x/*/.) $(wildcard ../../examples_v20x/*/.) $(wildcard ../../examples_v30x/*/.) $(wildcard ../../examples_x035/*/.) + +.PHONY: ci tests all $(EXAMPLES) clean + +results : + mkdir -p results + +$(EXAMPLES) : results + echo $(shell basename $(realpath $(lastword $@))) + ($(MAKE) -C $@ build > results/$(subst .,,$(subst /,_,$@)).txt 2> results/$(subst .,,$(subst /,_,$@)).warning && echo "success" > results/$(subst .,,$(subst /,_,$@)).result) || echo "failure" > results/$(subst .,,$(subst /,_,$@)).result + echo $(shell basename $(realpath $(lastword $@))).bin > results/$(subst .,,$(subst /,_,$@)).stat + sha1sum $@/$(shell basename $(realpath $(lastword $@))).bin | cut -d' ' -f 1 >> results/$(subst .,,$(subst /,_,$@)).stat + wc --bytes $@/$(shell basename $(realpath $(lastword $@))).bin | cut -d' ' -f 1 >> results/$(subst .,,$(subst /,_,$@)).stat + +tests : $(EXAMPLES) + +ci : install tests + +clean : + rm -rf results +